Automattic\WooCommerce\Vendor\GraphQL\Utils

BreakingChangesFinder::findRemovedDirectiveLocationspublic staticWC 1.0

Method of the class: BreakingChangesFinder{}

No Hooks.

Returns

Array. Change>

Usage

$result = BreakingChangesFinder::findRemovedDirectiveLocations( $oldSchema, $newSchema ): array;
$oldSchema(Schema) (required)
.
$newSchema(Schema) (required)
.

BreakingChangesFinder::findRemovedDirectiveLocations() code WC 10.9.1

public static function findRemovedDirectiveLocations(Schema $oldSchema, Schema $newSchema): array
{
    $removedLocations = [];
    $oldSchemaDirectiveMap = self::getDirectiveMapForSchema($oldSchema);

    foreach ($newSchema->getDirectives() as $newDirective) {
        if (! isset($oldSchemaDirectiveMap[$newDirective->name])) {
            continue;
        }

        foreach (
            self::findRemovedLocationsForDirective(
                $oldSchemaDirectiveMap[$newDirective->name],
                $newDirective
            ) as $location
        ) {
            $removedLocations[] = [
                'type' => self::BREAKING_CHANGE_DIRECTIVE_LOCATION_REMOVED,
                'description' => "{$location} was removed from {$newDirective->name}",
            ];
        }
    }

    return $removedLocations;
}