Automattic\WooCommerce\Vendor\GraphQL\Utils

BreakingChangesFinder::findRemovedLocationsForDirectivepublic staticWC 1.0

Method of the class: BreakingChangesFinder{}

No Hooks.

Returns

Array. string>

Usage

$result = BreakingChangesFinder::findRemovedLocationsForDirective( $oldDirective, $newDirective ): array;
$oldDirective(Directive) (required)
.
$newDirective(Directive) (required)
.

BreakingChangesFinder::findRemovedLocationsForDirective() code WC 10.9.1

public static function findRemovedLocationsForDirective(Directive $oldDirective, Directive $newDirective): array
{
    $removedLocations = [];
    $newLocationSet = array_flip($newDirective->locations);
    foreach ($oldDirective->locations as $oldLocation) {
        if (! array_key_exists($oldLocation, $newLocationSet)) {
            $removedLocations[] = $oldLocation;
        }
    }

    return $removedLocations;
}