Change record status: 
Project: 
Introduced in branch: 
8.7.x
Introduced in version: 
8.7.x
Description: 

Functionality from drupal_check_incompatibility() and \Drupal\Core\Extension\ModuleHandler::parseDependency() has moved to Drupal\Core\Extension\Dependency.

In support of this there is a new drupal/core-version component with a single class, Drupal\Component\Version\Constraint that provides functionality to parse and perform checks against constraint strings like >8.x-1.1.

Additionally, the public requires property of Extension objects returned by \Drupal::service('extension.list.module')->reset()->getList() now contains Dependency objects.

Before

$v = \Drupal::moduleHandler()->parseDependency('paragraphs:paragraphs (>8.x-1.3)');
// $version will equal ' (>8.x-1.3)'.
$version = drupal_check_incompatibility($v, '1.2');

$module_list = \Drupal::service('extension.list.module')->getList();
// Assuming the paragraphs_demo module has a dependency like 'paragraphs:paragraphs (>8.x-1.3)'.
$version_info = $module_list['paragraphs_demo']->requires['paragraphs'];
// $version will equal ' (>8.x-1.3)'.
$version = drupal_check_incompatibility($version_info, '1.2');

After

$dependency = Dependency::createFromString('paragraphs:paragraphs (>8.x-1.3)');
if (!$dependency->isCompatible('1.2')) {
  // $constraint will equal '>8.x-1.3'.
  $constraint = $dependency->getConstraintString()
}

$module_list = \Drupal::service('extension.list.module')->getList();
// Assuming the paragraphs_demo module has a dependency like 'paragraphs:paragraphs (>8.x-1.3)'.
if ($module_list['paragraphs_demo']->requires['paragraphs']->isCompatible('1.2')) {
  // $constraint will equal '>8.x-1.3'.
  $constraint = $module_list['paragraphs_demo']->requires['paragraphs']->getConstraintString();
}
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done