diff --git a/src/Type/Introspection.php b/src/Type/Introspection.php index 7326ea4..57be002 100644 --- a/src/Type/Introspection.php +++ b/src/Type/Introspection.php @@ -37,11 +37,25 @@ class Introspection private static $map = []; /** + * Options: + * - descriptions + * Whether to include descriptions in the introspection result. + * Default: true + * + * @param array $options * @return string */ - public static function getIntrospectionQuery($includeDescription = true) + public static function getIntrospectionQuery($options = []) { - $withDescription = <<<'EOD' + if (is_bool($options)) { + trigger_error('Calling Introspection::getIntrospectionQuery(boolean) is deprecated. Please use Introspection::getIntrospectionQuery(["descriptions" => boolean]).', E_USER_DEPRECATED); + $descriptions = $options; + } else { + $descriptions = !array_key_exists('descriptions', $options) || $options['descriptions'] === true; + } + $descriptionField = $descriptions ? 'description' : ''; + + return << false]); $expected = array ( 'data' => array ( diff --git a/tests/Validator/AbstractQuerySecurityTest.php b/tests/Validator/AbstractQuerySecurityTest.php index 885fc99..7e5e36b 100644 --- a/tests/Validator/AbstractQuerySecurityTest.php +++ b/tests/Validator/AbstractQuerySecurityTest.php @@ -53,7 +53,7 @@ abstract class AbstractQuerySecurityTest extends \PHPUnit_Framework_TestCase protected function assertIntrospectionQuery($maxExpected) { - $query = Introspection::getIntrospectionQuery(true); + $query = Introspection::getIntrospectionQuery(); $this->assertMaxValue($query, $maxExpected); }