Automattic\WooCommerce\Vendor\GraphQL\Utils
BreakingChangesFinder::findRemovedLocationsForDirective
Method of the class: BreakingChangesFinder{}
No Hooks.
Returns
Array
Usage
$result = BreakingChangesFinder::findRemovedLocationsForDirective( $oldDirective, $newDirective ): array;
BreakingChangesFinder::findRemovedLocationsForDirective() 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;
}