Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExecutionOrderDependency.php

function ExecutionOrderDependency::diff

@psalm-param list<ExecutionOrderDependency> $left @psalm-param list<ExecutionOrderDependency> $right

@psalm-return list<ExecutionOrderDependency>

1 call to ExecutionOrderDependency::diff()
TestSuite::requires in vendor/phpunit/phpunit/src/Framework/TestSuite.php
@psalm-return list<ExecutionOrderDependency>

File

vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php, line 112

Class

ExecutionOrderDependency
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Framework

Code

public static function diff(array $left, array $right) : array {
    if ($right === []) {
        return $left;
    }
    if ($left === []) {
        return [];
    }
    $diff = [];
    $rightTargets = array_map(static fn($dependency) => $dependency->getTarget(), $right);
    foreach ($left as $dependency) {
        if (in_array($dependency->getTarget(), $rightTargets, true)) {
            continue;
        }
        $diff[] = $dependency;
    }
    return $diff;
}
RSS feed
Powered by Drupal