top level API functions, docstrings

This commit is contained in:
Ben Roberts 2017-11-16 15:53:20 -05:00
parent 55f6d6cf47
commit a1325eeb3f

View File

@ -41,16 +41,12 @@ class FindBreakingChanges
* *
* @return array * @return array
*/ */
public function findDangerousChanges( public function findDangerousChanges(Schema $oldSchema, Schema $newSchema)
Schema $oldSchema, Schema $newSchema
)
{ {
return [ return array_merge(self::findArgChanges($oldSchema, $newSchema)['dangerousChanges'],
/* ...findArgChanges(oldSchema, newSchema).dangerousChanges, self::findValuesAddedToEnums($oldSchema, $newSchema),
...findValuesAddedToEnums(oldSchema, newSchema), self::findTypesAddedToUnions($oldSchema, $newSchema)
...findTypesAddedToUnions(oldSchema, newSchema) );
*/
];
} }
/** /**
@ -59,25 +55,24 @@ class FindBreakingChanges
* *
* @return array * @return array
*/ */
public function findBreakingChanges( public function findBreakingChanges(Schema $oldSchema, Schema $newSchema)
$oldSchema, $newSchema
)
{ {
return [ return array_merge(
/*...findRemovedTypes(oldSchema, newSchema), self::findRemovedTypes($oldSchema, $newSchema),
...findTypesThatChangedKind(oldSchema, newSchema), self::findTypesThatChangedKind($oldSchema, $newSchema),
...findFieldsThatChangedType(oldSchema, newSchema), self::findFieldsThatChangedType($oldSchema, $newSchema),
...findTypesRemovedFromUnions(oldSchema, newSchema), self::findTypesRemovedFromUnions($oldSchema, $newSchema),
...findValuesRemovedFromEnums(oldSchema, newSchema), self::findValuesRemovedFromEnums($oldSchema, $newSchema),
...findArgChanges(oldSchema, newSchema).breakingChanges, self::findArgChanges($oldSchema, $newSchema)['breakingChanges'],
...findInterfacesRemovedFromObjectTypes(oldSchema, newSchema), self::findInterfacesRemovedFromObjectTypes($oldSchema, $newSchema)
*/ );
];
} }
/** /**
* Given two schemas, returns an Array containing descriptions of any breaking * Given two schemas, returns an Array containing descriptions of any breaking
* changes in the newSchema related to removing an entire type. * changes in the newSchema related to removing an entire type.
*
* @return array
*/ */
public function findRemovedTypes( public function findRemovedTypes(
Schema $oldSchema, Schema $newSchema Schema $oldSchema, Schema $newSchema
@ -100,6 +95,8 @@ class FindBreakingChanges
/** /**
* Given two schemas, returns an Array containing descriptions of any breaking * Given two schemas, returns an Array containing descriptions of any breaking
* changes in the newSchema related to changing the type of a type. * changes in the newSchema related to changing the type of a type.
*
* @return array
*/ */
public function findTypesThatChangedKind( public function findTypesThatChangedKind(
Schema $oldSchema, Schema $newSchema Schema $oldSchema, Schema $newSchema
@ -528,6 +525,8 @@ class FindBreakingChanges
/** /**
* Given two schemas, returns an Array containing descriptions of any dangerous * Given two schemas, returns an Array containing descriptions of any dangerous
* changes in the newSchema related to adding values to an enum type. * changes in the newSchema related to adding values to an enum type.
*
* @return array
*/ */
public static function findValuesAddedToEnums( public static function findValuesAddedToEnums(
Schema $oldSchema, Schema $newSchema Schema $oldSchema, Schema $newSchema