WooCommerce Code Reference

BreakingChangesFinder
in package

Utility for finding breaking/dangerous changes between two schemas.

Tags
phpstan-type

Change array{type: string, description: string}

phpstan-type

Changes array{ breakingChanges: array<int, Change>, dangerousChanges: array<int, Change> }

see
BreakingChangesFinderTest

Table of Contents

BREAKING_CHANGE_ARG_CHANGED_KIND  = 'ARG_CHANGED_KIND'
BREAKING_CHANGE_ARG_REMOVED  = 'ARG_REMOVED'
BREAKING_CHANGE_DIRECTIVE_ARG_REMOVED  = 'DIRECTIVE_ARG_REMOVED'
BREAKING_CHANGE_DIRECTIVE_LOCATION_REMOVED  = 'DIRECTIVE_LOCATION_REMOVED'
BREAKING_CHANGE_DIRECTIVE_REMOVED  = 'DIRECTIVE_REMOVED'
BREAKING_CHANGE_FIELD_CHANGED_KIND  = 'FIELD_CHANGED_KIND'
BREAKING_CHANGE_FIELD_REMOVED  = 'FIELD_REMOVED'
BREAKING_CHANGE_IMPLEMENTED_INTERFACE_REMOVED  = 'IMPLEMENTED_INTERFACE_REMOVED'
BREAKING_CHANGE_REQUIRED_ARG_ADDED  = 'REQUIRED_ARG_ADDED'
BREAKING_CHANGE_REQUIRED_DIRECTIVE_ARG_ADDED  = 'REQUIRED_DIRECTIVE_ARG_ADDED'
BREAKING_CHANGE_REQUIRED_INPUT_FIELD_ADDED  = 'REQUIRED_INPUT_FIELD_ADDED'
BREAKING_CHANGE_TYPE_CHANGED_KIND  = 'TYPE_CHANGED_KIND'
BREAKING_CHANGE_TYPE_REMOVED  = 'TYPE_REMOVED'
BREAKING_CHANGE_TYPE_REMOVED_FROM_UNION  = 'TYPE_REMOVED_FROM_UNION'
BREAKING_CHANGE_VALUE_REMOVED_FROM_ENUM  = 'VALUE_REMOVED_FROM_ENUM'
DANGEROUS_CHANGE_ARG_DEFAULT_VALUE_CHANGED  = 'ARG_DEFAULT_VALUE_CHANGE'
DANGEROUS_CHANGE_IMPLEMENTED_INTERFACE_ADDED  = 'IMPLEMENTED_INTERFACE_ADDED'
DANGEROUS_CHANGE_OPTIONAL_ARG_ADDED  = 'OPTIONAL_ARG_ADDED'
DANGEROUS_CHANGE_OPTIONAL_INPUT_FIELD_ADDED  = 'OPTIONAL_INPUT_FIELD_ADDED'
DANGEROUS_CHANGE_TYPE_ADDED_TO_UNION  = 'TYPE_ADDED_TO_UNION'
DANGEROUS_CHANGE_VALUE_ADDED_TO_ENUM  = 'VALUE_ADDED_TO_ENUM'
findAddedArgsForDirective()  : array<int, Argument>
findAddedNonNullDirectiveArgs()  : array<int, Change>
findArgChanges()  : Changes
Given two schemas, returns an Array containing descriptions of any breaking or dangerous changes in the newSchema related to arguments (such as removal or change of type of an argument, or a change in an argument's default value).
findBreakingChanges()  : array<int, Change>
Given two schemas, returns an Array containing descriptions of all the types of breaking changes covered by the other functions down below.
findDangerousChanges()  : array<int, Change>
Given two schemas, returns an Array containing descriptions of all the types of potentially dangerous changes covered by the other functions down below.
findFieldsThatChangedTypeOnInputObjectTypes()  : Changes
findFieldsThatChangedTypeOnObjectOrInterfaceTypes()  : array<int, Change>
findInterfacesAddedToObjectTypes()  : array<int, Change>
findInterfacesRemovedFromObjectTypes()  : array<int, Change>
findRemovedArgsForDirectives()  : array<int, Argument>
findRemovedDirectiveArgs()  : array<int, Change>
findRemovedDirectiveLocations()  : array<int, Change>
findRemovedDirectives()  : array<int, Change>
findRemovedLocationsForDirective()  : array<int, string>
findRemovedTypes()  : array<int, Change>
Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to removing an entire type.
findTypesAddedToUnions()  : array<int, Change>
Given two schemas, returns an Array containing descriptions of any dangerous changes in the newSchema related to adding types to a union type.
findTypesRemovedFromUnions()  : array<int, Change>
Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to removing types from a union type.
findTypesThatChangedKind()  : array<int, Change>
Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to changing the type of a type.
findValuesAddedToEnums()  : array<int, Change>
Given two schemas, returns an Array containing descriptions of any dangerous changes in the newSchema related to adding values to an enum type.
findValuesRemovedFromEnums()  : array<int, Change>
Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to removing values from an enum type.
getArgumentMapForDirective()  : array<string, Argument>
getDirectiveMapForSchema()  : array<string, Directive>
isChangeSafeForInputObjectFieldOrFieldArg()  : bool
isChangeSafeForObjectOrInterfaceField()  : bool
typeKindName()  : string

Constants

Methods

findArgChanges()

Given two schemas, returns an Array containing descriptions of any breaking or dangerous changes in the newSchema related to arguments (such as removal or change of type of an argument, or a change in an argument's default value).

public static findArgChanges(Schema $oldSchema, Schema $newSchema) : Changes
Parameters
$oldSchema : Schema
$newSchema : Schema
Tags
throws
InvariantViolation
Return values
Changes