From aff90764f2727babb24869a93f56a72143c452a1 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 9 Aug 2017 17:49:18 +0200 Subject: [PATCH 01/28] remove all dirty files --- build/artifacts/logs/junit.xml | 10 - images/index.html | 0 vendor/autoload.php | 7 - vendor/composer/ClassLoader.php | 240 ---------------- vendor/composer/autoload_classmap.php | 355 ------------------------ vendor/composer/autoload_namespaces.php | 13 - vendor/composer/autoload_real.php | 47 ---- 7 files changed, 672 deletions(-) delete mode 100644 build/artifacts/logs/junit.xml delete mode 100644 images/index.html delete mode 100644 vendor/autoload.php delete mode 100644 vendor/composer/ClassLoader.php delete mode 100644 vendor/composer/autoload_classmap.php delete mode 100644 vendor/composer/autoload_namespaces.php delete mode 100644 vendor/composer/autoload_real.php diff --git a/build/artifacts/logs/junit.xml b/build/artifacts/logs/junit.xml deleted file mode 100644 index 9ccec58..0000000 --- a/build/artifacts/logs/junit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/images/index.html b/images/index.html deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index a82fdfe..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0 class loader - * - * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - */ -class ClassLoader -{ - private $prefixes = array(); - private $fallbackDirs = array(); - private $useIncludePath = false; - private $classMap = array(); - - public function getPrefixes() - { - return $this->prefixes; - } - - public function getFallbackDirs() - { - return $this->fallbackDirs; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of classes, merging with any others previously set. - * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes - * @param bool $prepend Prepend the location(s) - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirs = array_merge( - (array) $paths, - $this->fallbackDirs - ); - } else { - $this->fallbackDirs = array_merge( - $this->fallbackDirs, - (array) $paths - ); - } - - return; - } - if (!isset($this->prefixes[$prefix])) { - $this->prefixes[$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixes[$prefix] = array_merge( - (array) $paths, - $this->prefixes[$prefix] - ); - } else { - $this->prefixes[$prefix] = array_merge( - $this->prefixes[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of classes, replacing any others previously set. - * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirs = (array) $paths; - - return; - } - $this->prefixes[$prefix] = (array) $paths; - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - include $file; - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; - $className = substr($class, $pos + 1); - } else { - // PEAR-like class name - $classPath = null; - $className = $class; - } - - $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; - - foreach ($this->prefixes as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - } - } - - foreach ($this->fallbackDirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - - if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) { - return $file; - } - - return $this->classMap[$class] = false; - } -} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 0a52832..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,355 +0,0 @@ - $vendorDir . '/phpunit/php-file-iterator/File/Iterator.php', - 'File_Iterator_Facade' => $vendorDir . '/phpunit/php-file-iterator/File/Iterator/Facade.php', - 'File_Iterator_Factory' => $vendorDir . '/phpunit/php-file-iterator/File/Iterator/Factory.php', - 'PHPUnit_Extensions_GroupTestSuite' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php', - 'PHPUnit_Extensions_PhptTestCase' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php', - 'PHPUnit_Extensions_PhptTestCase_Logger' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php', - 'PHPUnit_Extensions_PhptTestSuite' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php', - 'PHPUnit_Extensions_RepeatedTest' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php', - 'PHPUnit_Extensions_TestDecorator' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php', - 'PHPUnit_Extensions_TicketListener' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php', - 'PHPUnit_Framework_Assert' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Assert.php', - 'PHPUnit_Framework_AssertionFailedError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php', - 'PHPUnit_Framework_Comparator' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator.php', - 'PHPUnit_Framework_ComparatorFactory' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php', - 'PHPUnit_Framework_Comparator_Array' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php', - 'PHPUnit_Framework_Comparator_DOMDocument' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php', - 'PHPUnit_Framework_Comparator_Double' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php', - 'PHPUnit_Framework_Comparator_Exception' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php', - 'PHPUnit_Framework_Comparator_MockObject' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php', - 'PHPUnit_Framework_Comparator_Numeric' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php', - 'PHPUnit_Framework_Comparator_Object' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php', - 'PHPUnit_Framework_Comparator_Resource' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php', - 'PHPUnit_Framework_Comparator_Scalar' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php', - 'PHPUnit_Framework_Comparator_SplObjectStorage' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php', - 'PHPUnit_Framework_Comparator_Type' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php', - 'PHPUnit_Framework_ComparisonFailure' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php', - 'PHPUnit_Framework_Constraint' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint.php', - 'PHPUnit_Framework_Constraint_And' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php', - 'PHPUnit_Framework_Constraint_ArrayHasKey' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php', - 'PHPUnit_Framework_Constraint_Attribute' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php', - 'PHPUnit_Framework_Constraint_Callback' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php', - 'PHPUnit_Framework_Constraint_ClassHasAttribute' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php', - 'PHPUnit_Framework_Constraint_ClassHasStaticAttribute' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php', - 'PHPUnit_Framework_Constraint_Composite' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php', - 'PHPUnit_Framework_Constraint_Count' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php', - 'PHPUnit_Framework_Constraint_Exception' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php', - 'PHPUnit_Framework_Constraint_ExceptionCode' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php', - 'PHPUnit_Framework_Constraint_ExceptionMessage' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php', - 'PHPUnit_Framework_Constraint_FileExists' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php', - 'PHPUnit_Framework_Constraint_GreaterThan' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php', - 'PHPUnit_Framework_Constraint_IsAnything' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php', - 'PHPUnit_Framework_Constraint_IsEmpty' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php', - 'PHPUnit_Framework_Constraint_IsEqual' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php', - 'PHPUnit_Framework_Constraint_IsFalse' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php', - 'PHPUnit_Framework_Constraint_IsIdentical' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php', - 'PHPUnit_Framework_Constraint_IsInstanceOf' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php', - 'PHPUnit_Framework_Constraint_IsJson' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php', - 'PHPUnit_Framework_Constraint_IsNull' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php', - 'PHPUnit_Framework_Constraint_IsTrue' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php', - 'PHPUnit_Framework_Constraint_IsType' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php', - 'PHPUnit_Framework_Constraint_JsonMatches' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php', - 'PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php', - 'PHPUnit_Framework_Constraint_LessThan' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php', - 'PHPUnit_Framework_Constraint_Not' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php', - 'PHPUnit_Framework_Constraint_ObjectHasAttribute' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php', - 'PHPUnit_Framework_Constraint_Or' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php', - 'PHPUnit_Framework_Constraint_PCREMatch' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php', - 'PHPUnit_Framework_Constraint_SameSize' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php', - 'PHPUnit_Framework_Constraint_StringContains' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php', - 'PHPUnit_Framework_Constraint_StringEndsWith' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php', - 'PHPUnit_Framework_Constraint_StringMatches' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php', - 'PHPUnit_Framework_Constraint_StringStartsWith' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php', - 'PHPUnit_Framework_Constraint_TraversableContains' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php', - 'PHPUnit_Framework_Constraint_TraversableContainsOnly' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php', - 'PHPUnit_Framework_Constraint_Xor' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php', - 'PHPUnit_Framework_Error' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Error.php', - 'PHPUnit_Framework_Error_Deprecated' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php', - 'PHPUnit_Framework_Error_Notice' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php', - 'PHPUnit_Framework_Error_Warning' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php', - 'PHPUnit_Framework_Exception' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Exception.php', - 'PHPUnit_Framework_ExpectationFailedException' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php', - 'PHPUnit_Framework_IncompleteTest' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php', - 'PHPUnit_Framework_IncompleteTestError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php', - 'PHPUnit_Framework_MockObject_Builder_Identity' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Identity.php', - 'PHPUnit_Framework_MockObject_Builder_InvocationMocker' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/InvocationMocker.php', - 'PHPUnit_Framework_MockObject_Builder_Match' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Match.php', - 'PHPUnit_Framework_MockObject_Builder_MethodNameMatch' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/MethodNameMatch.php', - 'PHPUnit_Framework_MockObject_Builder_Namespace' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Namespace.php', - 'PHPUnit_Framework_MockObject_Builder_ParametersMatch' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/ParametersMatch.php', - 'PHPUnit_Framework_MockObject_Builder_Stub' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Stub.php', - 'PHPUnit_Framework_MockObject_Generator' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator.php', - 'PHPUnit_Framework_MockObject_Invocation' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation.php', - 'PHPUnit_Framework_MockObject_InvocationMocker' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/InvocationMocker.php', - 'PHPUnit_Framework_MockObject_Invocation_Object' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Object.php', - 'PHPUnit_Framework_MockObject_Invocation_Static' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Static.php', - 'PHPUnit_Framework_MockObject_Invokable' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invokable.php', - 'PHPUnit_Framework_MockObject_Matcher' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher.php', - 'PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyInvokedCount.php', - 'PHPUnit_Framework_MockObject_Matcher_AnyParameters' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyParameters.php', - 'PHPUnit_Framework_MockObject_Matcher_Invocation' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Invocation.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtIndex.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtLeastOnce.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedCount' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedCount.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedRecorder' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedRecorder.php', - 'PHPUnit_Framework_MockObject_Matcher_MethodName' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/MethodName.php', - 'PHPUnit_Framework_MockObject_Matcher_Parameters' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Parameters.php', - 'PHPUnit_Framework_MockObject_Matcher_StatelessInvocation' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/StatelessInvocation.php', - 'PHPUnit_Framework_MockObject_MockBuilder' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockBuilder.php', - 'PHPUnit_Framework_MockObject_MockObject' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockObject.php', - 'PHPUnit_Framework_MockObject_Stub' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub.php', - 'PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ConsecutiveCalls.php', - 'PHPUnit_Framework_MockObject_Stub_Exception' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Exception.php', - 'PHPUnit_Framework_MockObject_Stub_MatcherCollection' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/MatcherCollection.php', - 'PHPUnit_Framework_MockObject_Stub_Return' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Return.php', - 'PHPUnit_Framework_MockObject_Stub_ReturnArgument' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnArgument.php', - 'PHPUnit_Framework_MockObject_Stub_ReturnCallback' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnCallback.php', - 'PHPUnit_Framework_MockObject_Stub_ReturnSelf' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnSelf.php', - 'PHPUnit_Framework_MockObject_Stub_ReturnValueMap' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnValueMap.php', - 'PHPUnit_Framework_MockObject_Verifiable' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Verifiable.php', - 'PHPUnit_Framework_OutputError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/OutputError.php', - 'PHPUnit_Framework_SelfDescribing' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php', - 'PHPUnit_Framework_SkippedTest' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php', - 'PHPUnit_Framework_SkippedTestError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php', - 'PHPUnit_Framework_SkippedTestSuiteError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php', - 'PHPUnit_Framework_SyntheticError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php', - 'PHPUnit_Framework_Test' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Test.php', - 'PHPUnit_Framework_TestCase' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestCase.php', - 'PHPUnit_Framework_TestFailure' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestFailure.php', - 'PHPUnit_Framework_TestListener' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestListener.php', - 'PHPUnit_Framework_TestResult' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestResult.php', - 'PHPUnit_Framework_TestSuite' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestSuite.php', - 'PHPUnit_Framework_TestSuite_DataProvider' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php', - 'PHPUnit_Framework_Warning' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Warning.php', - 'PHPUnit_Runner_BaseTestRunner' => $vendorDir . '/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php', - 'PHPUnit_Runner_StandardTestSuiteLoader' => $vendorDir . '/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php', - 'PHPUnit_Runner_TestSuiteLoader' => $vendorDir . '/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php', - 'PHPUnit_Runner_Version' => $vendorDir . '/phpunit/phpunit/PHPUnit/Runner/Version.php', - 'PHPUnit_TextUI_Command' => $vendorDir . '/phpunit/phpunit/PHPUnit/TextUI/Command.php', - 'PHPUnit_TextUI_ResultPrinter' => $vendorDir . '/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php', - 'PHPUnit_TextUI_TestRunner' => $vendorDir . '/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php', - 'PHPUnit_Util_Class' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Class.php', - 'PHPUnit_Util_Configuration' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Configuration.php', - 'PHPUnit_Util_DeprecatedFeature' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php', - 'PHPUnit_Util_DeprecatedFeature_Logger' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php', - 'PHPUnit_Util_Diff' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Diff.php', - 'PHPUnit_Util_ErrorHandler' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php', - 'PHPUnit_Util_Fileloader' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Fileloader.php', - 'PHPUnit_Util_Filesystem' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Filesystem.php', - 'PHPUnit_Util_Filter' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Filter.php', - 'PHPUnit_Util_Getopt' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Getopt.php', - 'PHPUnit_Util_GlobalState' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/GlobalState.php', - 'PHPUnit_Util_InvalidArgumentHelper' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php', - 'PHPUnit_Util_Log_JSON' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Log/JSON.php', - 'PHPUnit_Util_Log_JUnit' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php', - 'PHPUnit_Util_Log_TAP' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Log/TAP.php', - 'PHPUnit_Util_PHP' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/PHP.php', - 'PHPUnit_Util_PHP_Default' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/PHP/Default.php', - 'PHPUnit_Util_PHP_Windows' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php', - 'PHPUnit_Util_Printer' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Printer.php', - 'PHPUnit_Util_String' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/String.php', - 'PHPUnit_Util_Test' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Test.php', - 'PHPUnit_Util_TestDox_NamePrettifier' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php', - 'PHPUnit_Util_TestDox_ResultPrinter' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php', - 'PHPUnit_Util_TestDox_ResultPrinter_HTML' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php', - 'PHPUnit_Util_TestDox_ResultPrinter_Text' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php', - 'PHPUnit_Util_TestSuiteIterator' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php', - 'PHPUnit_Util_Type' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Type.php', - 'PHPUnit_Util_XML' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/XML.php', - 'PHP_CodeCoverage' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage.php', - 'PHP_CodeCoverage_Driver' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Driver.php', - 'PHP_CodeCoverage_Driver_Xdebug' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Driver/Xdebug.php', - 'PHP_CodeCoverage_Exception' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Exception.php', - 'PHP_CodeCoverage_Filter' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Filter.php', - 'PHP_CodeCoverage_Report_Clover' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Clover.php', - 'PHP_CodeCoverage_Report_Factory' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Factory.php', - 'PHP_CodeCoverage_Report_HTML' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML.php', - 'PHP_CodeCoverage_Report_HTML_Renderer' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer.php', - 'PHP_CodeCoverage_Report_HTML_Renderer_Dashboard' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Dashboard.php', - 'PHP_CodeCoverage_Report_HTML_Renderer_Directory' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Directory.php', - 'PHP_CodeCoverage_Report_HTML_Renderer_File' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/File.php', - 'PHP_CodeCoverage_Report_Node' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node.php', - 'PHP_CodeCoverage_Report_Node_Directory' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Directory.php', - 'PHP_CodeCoverage_Report_Node_File' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/File.php', - 'PHP_CodeCoverage_Report_Node_Iterator' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Iterator.php', - 'PHP_CodeCoverage_Report_PHP' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/PHP.php', - 'PHP_CodeCoverage_Report_Text' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Text.php', - 'PHP_CodeCoverage_Util' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Util.php', - 'PHP_CodeCoverage_Util_InvalidArgumentHelper' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Util/InvalidArgumentHelper.php', - 'PHP_CodeCoverage_Version' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Version.php', - 'PHP_Timer' => $vendorDir . '/phpunit/php-timer/PHP/Timer.php', - 'PHP_Token' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_TokenWithScope' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_TokenWithScopeAndVisibility' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ABSTRACT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_AMPERSAND' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_AND_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ARRAY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ARRAY_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_AS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_AT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_BACKTICK' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_BAD_CHARACTER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_BOOLEAN_AND' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_BOOLEAN_OR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_BOOL_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_BREAK' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CALLABLE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CARET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CASE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CATCH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CHARACTER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CLASS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CLASS_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CLASS_NAME_CONSTANT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CLONE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CLOSE_BRACKET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CLOSE_CURLY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CLOSE_SQUARE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CLOSE_TAG' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_COLON' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_COMMA' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_COMMENT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CONCAT_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CONST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CONSTANT_ENCAPSED_STRING' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CONTINUE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_CURLY_OPEN' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DEC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DECLARE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DEFAULT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DIR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DIV' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DIV_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DNUMBER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DO' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DOC_COMMENT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DOLLAR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DOLLAR_OPEN_CURLY_BRACES' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DOT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DOUBLE_ARROW' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DOUBLE_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DOUBLE_COLON' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_DOUBLE_QUOTES' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ECHO' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ELSE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ELSEIF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_EMPTY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ENCAPSED_AND_WHITESPACE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ENDDECLARE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ENDFOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ENDFOREACH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ENDIF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ENDSWITCH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ENDWHILE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_END_HEREDOC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_EVAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_EXCLAMATION_MARK' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_EXIT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_EXTENDS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_FILE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_FINAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_FINALLY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_FOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_FOREACH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_FUNCTION' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_FUNC_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_GLOBAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_GOTO' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_GT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_HALT_COMPILER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_IF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_IMPLEMENTS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_INC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_INCLUDE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_INCLUDE_ONCE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_INLINE_HTML' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_INSTANCEOF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_INSTEADOF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_INTERFACE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_INT_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_ISSET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_IS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_IS_GREATER_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_IS_IDENTICAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_IS_NOT_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_IS_NOT_IDENTICAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_IS_SMALLER_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_Includes' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_LINE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_LIST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_LNUMBER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_LOGICAL_AND' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_LOGICAL_OR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_LOGICAL_XOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_LT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_METHOD_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_MINUS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_MINUS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_MOD_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_MULT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_MUL_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_NAMESPACE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_NEW' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_NS_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_NS_SEPARATOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_NUM_STRING' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_OBJECT_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_OBJECT_OPERATOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_OPEN_BRACKET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_OPEN_CURLY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_OPEN_SQUARE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_OPEN_TAG' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_OPEN_TAG_WITH_ECHO' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PAAMAYIM_NEKUDOTAYIM' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PERCENT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PIPE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PLUS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PLUS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PRINT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PRIVATE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PROTECTED' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_PUBLIC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_QUESTION_MARK' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_REQUIRE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_REQUIRE_ONCE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_RETURN' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_SEMICOLON' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_SL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_SL_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_SR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_SR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_START_HEREDOC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_STATIC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_STRING' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_STRING_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_STRING_VARNAME' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_SWITCH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_Stream' => $vendorDir . '/phpunit/php-token-stream/PHP/Token/Stream.php', - 'PHP_Token_Stream_CachingFactory' => $vendorDir . '/phpunit/php-token-stream/PHP/Token/Stream/CachingFactory.php', - 'PHP_Token_THROW' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_TILDE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_TRAIT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_TRAIT_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_TRY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_UNSET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_UNSET_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_USE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_VAR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_VARIABLE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_WHILE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_WHITESPACE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_XOR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'PHP_Token_YIELD' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', - 'Text_Template' => $vendorDir . '/phpunit/php-text-template/Text/Template.php', -); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 7f734f5..0000000 --- a/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,13 +0,0 @@ - $vendorDir . '/symfony/yaml', - 'JsonSchema' => $vendorDir . '/justinrainbow/json-schema/src', - 'JSONSchema\\Tests' => $baseDir . '/tests', - 'JSONSchema' => $baseDir . '/src', -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index 80c839b..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,47 +0,0 @@ - $path) { - $loader->add($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - - $loader->register(true); - - return $loader; - } -} From a4896fc2ae928736c67d56831ea920bded9863f4 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 9 Aug 2017 18:32:01 +0200 Subject: [PATCH 02/28] update dependencies --- .gitignore | 3 +- composer.json | 5 +- composer.lock | 216 ++++++++++---------- src/JSONSchema/Generator.php | 56 ++--- src/JSONSchema/Parsers/JSONStringParser.php | 189 +++++++++-------- tests/JSONSchema/Tests/GeneratorTest.php | 24 ++- tests/data/example.1.json | 16 ++ 7 files changed, 286 insertions(+), 223 deletions(-) create mode 100644 tests/data/example.1.json diff --git a/.gitignore b/.gitignore index f01ada6..0680878 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /vendor /bin -/report \ No newline at end of file +/report +/build \ No newline at end of file diff --git a/composer.json b/composer.json index 967d8e6..42eedcd 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,8 @@ "php": ">=5.4.0" }, "require-dev": { - "justinrainbow/json-schema" : "*", - "phpunit/phpunit": "3.7.*", - "justinrainbow/json-schema": "*" + "justinrainbow/json-schema" : "5.2.*", + "phpunit/phpunit": "3.7.*" }, "autoload": { "psr-0": { diff --git a/composer.lock b/composer.lock index 8d46c4f..8b10f0a 100644 --- a/composer.lock +++ b/composer.lock @@ -1,34 +1,35 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" - ], - "hash": "dc0d55a532bc0419ed3c06d034e1d90f", - "packages": [ - + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" ], + "hash": "b7e5bfed0b28f62b58b9e276dca5bcf7", + "content-hash": "67c19cd2ba6394d40b0cfe312bd0e8bb", + "packages": [], "packages-dev": [ { "name": "justinrainbow/json-schema", - "version": "1.3.5", + "version": "5.2.1", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "01949f6d2130e9737ffae5d3952909a8de70d114" + "reference": "429be236f296ca249d61c65649cdf2652f4a5e80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/01949f6d2130e9737ffae5d3952909a8de70d114", - "reference": "01949f6d2130e9737ffae5d3952909a8de70d114", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/429be236f296ca249d61c65649cdf2652f4a5e80", + "reference": "429be236f296ca249d61c65649cdf2652f4a5e80", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.3" }, "require-dev": { - "json-schema/json-schema-test-suite": "1.1.0", - "phpdocumentor/phpdocumentor": "~2", - "phpunit/phpunit": "~3.7" + "friendsofphp/php-cs-fixer": "^2.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpdocumentor/phpdocumentor": "^2.7", + "phpunit/phpunit": "^4.8.22" }, "bin": [ "bin/validate-json" @@ -36,24 +37,19 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { - "psr-0": { - "JsonSchema": "src/" + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" - }, { "name": "Bruno Prieto Reis", "email": "bruno.p.reis@gmail.com" @@ -62,10 +58,13 @@ "name": "Justin Rainbow", "email": "justin.rainbow@gmail.com" }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, { "name": "Robert Schönthal", - "email": "seroscho@googlemail.com", - "homepage": "http://digitalkaoz.net" + "email": "seroscho@googlemail.com" } ], "description": "A library to validate a json schema.", @@ -74,27 +73,27 @@ "json", "schema" ], - "time": "2013-12-13 15:21:04" + "time": "2017-05-16 21:06:09" }, { "name": "phpunit/php-code-coverage", - "version": "1.2.13", + "version": "1.2.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94" + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/466e7cd2554b4e264c9e3f31216d25ac0e5f3d94", - "reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", "shasum": "" }, "require": { "php": ">=5.3.3", "phpunit/php-file-iterator": ">=1.3.0@stable", - "phpunit/php-text-template": ">=1.1.1@stable", - "phpunit/php-token-stream": ">=1.1.3@stable" + "phpunit/php-text-template": ">=1.2.0@stable", + "phpunit/php-token-stream": ">=1.1.3,<1.3.0" }, "require-dev": { "phpunit/phpunit": "3.7.*@dev" @@ -135,35 +134,37 @@ "testing", "xunit" ], - "time": "2013-09-10 08:14:32" + "time": "2014-09-02 10:13:14" }, { "name": "phpunit/php-file-iterator", - "version": "1.3.4", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", "shasum": "" }, "require": { "php": ">=5.3.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, "autoload": { "classmap": [ - "File/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -180,20 +181,20 @@ "filesystem", "iterator" ], - "time": "2013-10-10 15:34:57" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", - "version": "1.1.4", + "version": "1.2.1", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-text-template.git", - "reference": "1.1.4" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4", - "reference": "1.1.4", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { @@ -202,20 +203,17 @@ "type": "library", "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -224,35 +222,40 @@ "keywords": [ "template" ], - "time": "2012-10-31 11:15:28" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.5", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -268,20 +271,20 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "5220af2a7929aa35cf663d97c89ad3d50cf5fa3e" + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/5220af2a7929aa35cf663d97c89ad3d50cf5fa3e", - "reference": "5220af2a7929aa35cf663d97c89ad3d50cf5fa3e", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", "shasum": "" }, "require": { @@ -318,43 +321,42 @@ "keywords": [ "tokenizer" ], - "time": "2013-09-13 04:58:23" + "time": "2014-03-03 05:10:30" }, { "name": "phpunit/phpunit", - "version": "3.7.28", + "version": "3.7.38", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d" + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d", - "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", "shasum": "" }, "require": { + "ext-ctype": "*", "ext-dom": "*", + "ext-json": "*", "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpunit/php-code-coverage": "~1.2.1", - "phpunit/php-file-iterator": ">=1.3.1", - "phpunit/php-text-template": ">=1.1.1", - "phpunit/php-timer": ">=1.0.4", - "phpunit/phpunit-mock-objects": "~1.2.0", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", "symfony/yaml": "~2.0" }, "require-dev": { - "pear-pear/pear": "1.9.4" + "pear-pear.php.net/pear": "1.9.4" }, "suggest": { - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "phpunit/php-invoker": ">=1.1.0,<1.2.0" + "phpunit/php-invoker": "~1.1" }, "bin": [ "composer/bin/phpunit" @@ -392,20 +394,20 @@ "testing", "xunit" ], - "time": "2013-10-17 07:27:40" + "time": "2014-10-17 09:04:17" }, { "name": "phpunit/phpunit-mock-objects", "version": "1.2.3", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "1.2.3" + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.3.zip", - "reference": "1.2.3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", "shasum": "" }, "require": { @@ -445,32 +447,34 @@ }, { "name": "symfony/yaml", - "version": "v2.4.0", - "target-dir": "Symfony/Component/Yaml", + "version": "v2.8.26", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5" + "url": "https://github.com/symfony/yaml.git", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5", - "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.8-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Yaml\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -483,25 +487,21 @@ }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2013-11-26 16:40:27" + "homepage": "https://symfony.com", + "time": "2017-06-01 20:52:29" } ], - "aliases": [ - - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": [ - - ], + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, "platform": { "php": ">=5.4.0" }, - "platform-dev": [ - - ] + "platform-dev": [] } diff --git a/src/JSONSchema/Generator.php b/src/JSONSchema/Generator.php index da8141d..3a1ec66 100644 --- a/src/JSONSchema/Generator.php +++ b/src/JSONSchema/Generator.php @@ -5,16 +5,16 @@ use JSONSchema\Parsers\Parser; /** - * + * * JSON Schema Generator - * + * * Duties: * Take object arguments - * Factory load appropriate parser - * - * + * Factory load appropriate parser + * + * * @package JSONSchema - * @author solvire + * @author solvire * */ class Generator @@ -23,19 +23,18 @@ class Generator * @var Parser $parser */ protected $parser = null; - + /** - * * @param mixed $subject * @param array $config - * @return $this instance */ public function __construct($subject = null, array $config = null) { - if($subject !== null) + if ($subject !== null) { $this->parser = Parsers\ParserFactory::load($subject); + } } - + /** * @param Parser $parser * @return $this @@ -43,9 +42,10 @@ public function __construct($subject = null, array $config = null) public function setParser(Parser $parser) { $this->parser = $parser; + return $this; } - + /** * @return Parser $parser */ @@ -53,7 +53,7 @@ public function getParser() { return $this->parser; } - + /** * @return string */ @@ -61,22 +61,28 @@ public function parse() { return $this->parser->parse(); } - + /** - * - * + * + * * @param string $name - * @param array $arguments - * [0] == payload subject - * [1] == config params // not implemented yet + * @param array $arguments + * [0] == payload subject + * [1] == config params // not implemented yet */ - public static function __callStatic($name,array $arguments) + public static function __callStatic($name, array $arguments) { - if(!isset($arguments[0]) || !is_string($arguments[0])) - throw new \InvalidArgumentException("Key: subject must be included in the first position of the array arguments. Provided: " . serialize($arguments)); - - $parser = Parsers\ParserFactory::loadByPrefix($name,$arguments[0]); + if (!isset($arguments[0]) || !is_string($arguments[0])) { + throw new \InvalidArgumentException( + "Key: subject must be included in the first position of the array arguments. Provided: ".serialize( + $arguments + ) + ); + } + + $parser = Parsers\ParserFactory::loadByPrefix($name, $arguments[0]); + return $parser->parse()->json(); } - + } diff --git a/src/JSONSchema/Parsers/JSONStringParser.php b/src/JSONSchema/Parsers/JSONStringParser.php index 53835bd..e149926 100644 --- a/src/JSONSchema/Parsers/JSONStringParser.php +++ b/src/JSONSchema/Parsers/JSONStringParser.php @@ -1,4 +1,5 @@ subject; - - if(!$jsonObj = json_decode($subject)) - throw new Exceptions\UnprocessableSubjectException("The JSONString subject was not processable - decode failed "); - + if (!$subject) { + $subject = $this->subject; + } + + if (!$jsonObj = json_decode($subject)) { + throw new Exceptions\UnprocessableSubjectException( + "The JSONString subject was not processable - decode failed " + ); + } + $this->loadObjectProperties($jsonObj); $this->loadSchema(); + return $this; } - + /** - * top level - * every recurse under this will add to the properties of the property - * + * top level + * every recurse under this will add to the properties of the property + * * @param array $jsonObj */ protected function loadObjectProperties($jsonObj) { // start walking the object - foreach($jsonObj as $key => $property) - { + foreach ($jsonObj as $key => $property) { $this->appendProperty( - $key, - $this->determineProperty($property,$key) + $key, + $this->determineProperty($property, $key) ); } } - + /** - * due to the fact that determining property will be so different between + * due to the fact that determining property will be so different between * parser types we should probably just define this function here * In a JSON string it will be very simple. * enter a string * see what the string looks like - * check the maps of types - * see if it fits some semantics - * + * check the maps of types + * see if it fits some semantics + * * @param object $property * @return Property */ - protected function determineProperty($property,$name) + protected function determineProperty($property, $name) { - - $baseUrl = $this->configKeyExists('baseUrl') ? $this->getConfigSetting('baseUrl') : null ; - $requiredDefault = $this->configKeyExists('requiredDefault') ? $this->getConfigSetting('requiredDefault') : false; + + $baseUrl = $this->configKeyExists('baseUrl') ? $this->getConfigSetting('baseUrl') : null; + $requiredDefault = $this->configKeyExists('requiredDefault') ? $this->getConfigSetting( + 'requiredDefault' + ) : false; $type = StringMapper::map($property); - - if($type == StringMapper::ARRAY_TYPE) - return $this->determineItem($property,$name); + + if ($type == StringMapper::ARRAY_TYPE) { + return $this->determineItem($property, $name); + } $prop = new Property(); $prop->setType($type) ->setName($name) - ->setKey($name) // due to the limited content ability of the basic json string + ->setKey($name)// due to the limited content ability of the basic json string ->setRequired($requiredDefault); - - if($baseUrl) - $prop->setId($baseUrl . '/' . $name); - + + if ($baseUrl) { + $prop->setId($baseUrl.'/'.$name); + } + // since this is an object get the properties of the sub objects - if($type == StringMapper::ARRAY_TYPE ) - { - $prop->addItem($name, - $this->determineItem($property, $name)); - } elseif($type == StringMapper::OBJECT_TYPE) { - foreach($property as $key => $newProperty) - $prop->addProperty($key, - $this->determineProperty($newProperty, $key)); + if ($type == StringMapper::ARRAY_TYPE) { + $prop->addItem( + $name, + $this->determineItem($property, $name) + ); + } elseif ($type == StringMapper::OBJECT_TYPE) { + foreach ($property as $key => $newProperty) { + $prop->addProperty( + $key, + $this->determineProperty($newProperty, $key) + ); + } } - + return $prop; } - - + + /** - * Similar to determineProperty but with a variation - * Notice that in items list there can be a collection of items - no keys here + * Similar to determineProperty but with a variation + * Notice that in items list there can be a collection of items - no keys here * the total items represent a full definition - * we are taking the collection of items - * we should take the cross section of the items and figure out base items - * + * we are taking the collection of items + * we should take the cross section of the items and figure out base items + * * @param array $items * @param string $name * @return Property */ protected function determineItem($items, $name) { - $baseUrl = $this->configKeyExists('baseUrl') ? $this->getConfigSetting('baseUrl') : null ; - $requiredDefault = $this->configKeyExists('requiredDefault') ? $this->getConfigSetting('requiredDefault') : false; + $baseUrl = $this->configKeyExists('baseUrl') ? $this->getConfigSetting('baseUrl') : null; + $requiredDefault = $this->configKeyExists('requiredDefault') ? $this->getConfigSetting( + 'requiredDefault' + ) : false; $type = StringMapper::map($items); - + $retItem = new Item(); $retItem->setType($type) ->setName($name) - ->setKey($name) // due to the limited content ability of the basic json string + ->setKey($name)// due to the limited content ability of the basic json string ->setRequired($requiredDefault); - - if($baseUrl) - $retItem->setId($baseUrl . '/' . $name); - - + + if ($baseUrl) { + $retItem->setId($baseUrl.'/'.$name); + } + + + + // since we stacked the groups of items into their major elements // add ALL of them to the item listings - if($type == StringMapper::ARRAY_TYPE) - { + if ($type == StringMapper::ARRAY_TYPE) { // loop through and get a list of the definitions // stack them together to find the greatest common - foreach($items as $key => $val) - { + foreach ($items as $key => $val) { // a collapse of each type $this->stackItemFields($name, $val); } - + // now that we have our commons lets add them to the items - foreach($this->itemFields[$name] as $key => $newItem) - { - $retItem->addItem($key, + foreach ($this->itemFields[$name] as $key => $newItem) { + $retItem->addItem( + $key, $this->determineItem($newItem, $key), - true); + true + ); } - - } - elseif ($type == StringMapper::OBJECT_TYPE) - { - $retItem->addItem($key, - $this->determineProperty($items, $key)); + + } elseif ($type == StringMapper::OBJECT_TYPE) { + $retItem->addItem( + $key, + $this->determineProperty($items, $key) + ); } - + return $retItem; } - + /** - * + * * @param string $name - * @param mixed $item + * @param mixed $item */ protected function stackItemFields($name, $item) { // for non-loopables - if(!is_array($item) && !is_object($item)) return; - foreach($item as $key => $val) - { + if (!is_array($item) && !is_object($item)) { + return; + } + foreach ($item as $key => $val) { $this->itemFields[$name][$key] = $val; } } - - + + } diff --git a/tests/JSONSchema/Tests/GeneratorTest.php b/tests/JSONSchema/Tests/GeneratorTest.php index 4bcb840..1ece489 100644 --- a/tests/JSONSchema/Tests/GeneratorTest.php +++ b/tests/JSONSchema/Tests/GeneratorTest.php @@ -13,7 +13,29 @@ */ class GeneratorTest extends JSONSchemaTestCase { - + + /** + * @return array + */ + public function provideJsonSamples() + { + $samples = []; + $root = realpath(__DIR__.'/../../data/'); + foreach (glob($root.'/*.json') as $k => $v) { + $samples[substr($v, strlen($root)+1)] = [$v]; + } + return $samples; + } + + /** + * @dataProvider provideJsonSamples + */ + public function testGeneration($file) + { + $result = Generator::JSONString(file_get_contents($file)); + $this->assertEquals($file, ''); + } + /** * the most basic functionality diff --git a/tests/data/example.1.json b/tests/data/example.1.json new file mode 100644 index 0000000..6f283c2 --- /dev/null +++ b/tests/data/example.1.json @@ -0,0 +1,16 @@ +{ + "documents": [ + { + "title": "ldkjdkjd lkdljdl jdl", + "extention": "pdf", + "mimeType": "application/pdf", + "linkTo": { + "contactId": 111 + }, + "id": 666, + "createdOn": "2016-09-20T00:00:00+02:00", + "createdBy": "BATCH-foobar", + "extension": "pdf" + } + ] +} \ No newline at end of file From 9a83582a1a39b6fa47d7ca2c4bccf2b99d69194b Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Mon, 14 Aug 2017 20:06:20 +0200 Subject: [PATCH 03/28] make unit test great again --- composer.json | 7 +- composer.lock | 272 +++++++++-- src/JSONSchema/Generator.php | 66 +-- src/JSONSchema/Mappers/PropertyTypeMapper.php | 26 +- .../Parsers/Exceptions/ParseException.php | 16 + .../Exceptions/UnmappableException.php | 16 + src/JSONSchema/Parsers/JSONStringParser.php | 135 ++---- src/JSONSchema/Parsers/Parser.php | 38 +- src/JSONSchema/Structure/Definition.php | 437 ++++++++++++++++++ src/JSONSchema/Structure/Encodable.php | 2 +- src/JSONSchema/Structure/Item.php | 30 -- src/JSONSchema/Structure/Property.php | 330 ------------- src/JSONSchema/Structure/Schema.php | 336 +------------- src/JSONSchema/Structure/UndefinedValue.php | 16 + tests/JSONSchema/Tests/GeneratorTest.php | 77 ++- tests/json-schema.draft4.json | 151 ++++++ 16 files changed, 1005 insertions(+), 950 deletions(-) create mode 100644 src/JSONSchema/Parsers/Exceptions/ParseException.php create mode 100644 src/JSONSchema/Parsers/Exceptions/UnmappableException.php create mode 100644 src/JSONSchema/Structure/Definition.php delete mode 100644 src/JSONSchema/Structure/Item.php delete mode 100644 src/JSONSchema/Structure/Property.php create mode 100644 src/JSONSchema/Structure/UndefinedValue.php create mode 100644 tests/json-schema.draft4.json diff --git a/composer.json b/composer.json index 42eedcd..aacccbe 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,12 @@ } ], "require": { - "php": ">=5.4.0" + "php": ">=5.4.0", + "league/json-guard": "^1.0" }, "require-dev": { - "justinrainbow/json-schema" : "5.2.*", - "phpunit/phpunit": "3.7.*" + "phpunit/phpunit": "3.7.*", + "league/json-reference": "^1.0" }, "autoload": { "psr-0": { diff --git a/composer.lock b/composer.lock index 8b10f0a..265f0d1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,45 +4,94 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b7e5bfed0b28f62b58b9e276dca5bcf7", - "content-hash": "67c19cd2ba6394d40b0cfe312bd0e8bb", - "packages": [], - "packages-dev": [ + "hash": "c36a3e0b0c1e651fa453b063ebfedeac", + "content-hash": "51537f485bad7a41179aae543ec5842e", + "packages": [ { - "name": "justinrainbow/json-schema", - "version": "5.2.1", + "name": "league/json-guard", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "429be236f296ca249d61c65649cdf2652f4a5e80" + "url": "https://github.com/thephpleague/json-guard.git", + "reference": "596059d2c013bcea1a8a1386bd0e60d32ef39eb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/429be236f296ca249d61c65649cdf2652f4a5e80", - "reference": "429be236f296ca249d61c65649cdf2652f4a5e80", + "url": "https://api.github.com/repos/thephpleague/json-guard/zipball/596059d2c013bcea1a8a1386bd0e60d32ef39eb9", + "reference": "596059d2c013bcea1a8a1386bd0e60d32ef39eb9", "shasum": "" }, "require": { - "php": ">=5.3.3" + "ext-bcmath": "*", + "php": ">=5.6.0", + "psr/container": "^1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.1", + "ext-curl": "*", "json-schema/json-schema-test-suite": "1.2.0", - "phpdocumentor/phpdocumentor": "^2.7", - "phpunit/phpunit": "^4.8.22" + "league/json-reference": "1.0.0", + "phpunit/phpunit": "4.*", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.3" }, - "bin": [ - "bin/validate-json" + "type": "library", + "autoload": { + "psr-4": { + "League\\JsonGuard\\": "src" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Allan", + "email": "matthew.james.allan@gmail.com", + "homepage": "https://mattallan.org", + "role": "Developer" + } ], + "description": "A validator for JSON using json-schema.", + "homepage": "https://github.com/thephpleague/json-guard", + "keywords": [ + "json", + "json-schema", + "json-schema.org", + "schema", + "validation" + ], + "time": "2017-05-03 21:12:30" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "JsonSchema\\": "src/JsonSchema/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -51,29 +100,85 @@ ], "authors": [ { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14 16:28:37" + } + ], + "packages-dev": [ + { + "name": "league/json-reference", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/json-reference.git", + "reference": "5d68eda332488135b5edcd22da93ce53eca5b133" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/json-reference/zipball/5d68eda332488135b5edcd22da93ce53eca5b133", + "reference": "5d68eda332488135b5edcd22da93ce53eca5b133", + "shasum": "" + }, + "require": { + "php": ">=5.6.0", + "psr/simple-cache": "^1.0", + "sabre/uri": "^1.2.1" + }, + "require-dev": { + "cache/array-adapter": "^0.4.2", + "cache/predis-adapter": "^0.4.0", + "cache/simple-cache-bridge": "^0.1.0", + "ext-curl": "*", + "phpbench/phpbench": "^0.13.0", + "phpunit/phpunit": "^5.7", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "League\\JsonReference\\": "src" }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" + "name": "Matthew Allan", + "email": "matthew.james.allan@gmail.com", + "homepage": "https://mattallan.org", + "role": "Developer" } ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", + "description": "A library for working with JSON References", "keywords": [ + "Reference", "json", - "schema" + "json-reference" ], - "time": "2017-05-16 21:06:09" + "time": "2017-04-29 23:08:31" }, { "name": "phpunit/php-code-coverage", @@ -445,6 +550,105 @@ ], "time": "2013-01-13 10:24:48" }, + { + "name": "psr/simple-cache", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/753fa598e8f3b9966c886fe13f370baa45ef0e24", + "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-01-02 13:31:39" + }, + { + "name": "sabre/uri", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/fruux/sabre-uri.git", + "reference": "ada354d83579565949d80b2e15593c2371225e61" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fruux/sabre-uri/zipball/ada354d83579565949d80b2e15593c2371225e61", + "reference": "ada354d83579565949d80b2e15593c2371225e61", + "shasum": "" + }, + "require": { + "php": ">=5.4.7" + }, + "require-dev": { + "phpunit/phpunit": ">=4.0,<6.0", + "sabre/cs": "~1.0.0" + }, + "type": "library", + "autoload": { + "files": [ + "lib/functions.php" + ], + "psr-4": { + "Sabre\\Uri\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "Functions for making sense out of URIs.", + "homepage": "http://sabre.io/uri/", + "keywords": [ + "rfc3986", + "uri", + "url" + ], + "time": "2017-02-20 19:59:28" + }, { "name": "symfony/yaml", "version": "v2.8.26", diff --git a/src/JSONSchema/Generator.php b/src/JSONSchema/Generator.php index 3a1ec66..1eed0cd 100644 --- a/src/JSONSchema/Generator.php +++ b/src/JSONSchema/Generator.php @@ -2,6 +2,7 @@ namespace JSONSchema; +use JSONSchema\Parsers\JSONStringParser; use JSONSchema\Parsers\Parser; /** @@ -17,72 +18,17 @@ * @author solvire * */ -class Generator +abstract class Generator { - /** - * @var Parser $parser - */ - protected $parser = null; - - /** - * @param mixed $subject - * @param array $config - */ - public function __construct($subject = null, array $config = null) - { - if ($subject !== null) { - $this->parser = Parsers\ParserFactory::load($subject); - } - } - - /** - * @param Parser $parser - * @return $this - */ - public function setParser(Parser $parser) - { - $this->parser = $parser; - - return $this; - } - - /** - * @return Parser $parser - */ - public function getParser() - { - return $this->parser; - } /** + * @param string $jsonString * @return string */ - public function parse() - { - return $this->parser->parse(); - } - - /** - * - * - * @param string $name - * @param array $arguments - * [0] == payload subject - * [1] == config params // not implemented yet - */ - public static function __callStatic($name, array $arguments) + public static function fromJson($jsonString, array $config = null) { - if (!isset($arguments[0]) || !is_string($arguments[0])) { - throw new \InvalidArgumentException( - "Key: subject must be included in the first position of the array arguments. Provided: ".serialize( - $arguments - ) - ); - } - - $parser = Parsers\ParserFactory::loadByPrefix($name, $arguments[0]); - - return $parser->parse()->json(); + $parser = new JSONStringParser($config); + return $parser->parse($jsonString)->json(); } } diff --git a/src/JSONSchema/Mappers/PropertyTypeMapper.php b/src/JSONSchema/Mappers/PropertyTypeMapper.php index 1d0411d..0606ca4 100644 --- a/src/JSONSchema/Mappers/PropertyTypeMapper.php +++ b/src/JSONSchema/Mappers/PropertyTypeMapper.php @@ -1,6 +1,8 @@ property = $property; } - - + + /** - * the goal here would be go into a logic tree and work - * from loosest definition to most strict - * + * the goal here would be go into a logic tree and work + * from loosest definition to most strict + * * @param mixed $property - * @throws Exceptions\Unmappable + * @return string + * @throws UnmappableException */ - public static function map( $property) + public static function map($property) { -// if(!is_string($property)) -// throw new UnmappableException('The provided property must be a string.'); // need to find a better way to determine what the string is switch ($property) { @@ -75,7 +76,11 @@ public static function map( $property) case (is_bool($property)): return PropertyTypeMapper::BOOLEAN_TYPE; case (is_array($property)): - return PropertyTypeMapper::ARRAY_TYPE; + if (array_values($property) !== $property) { // hash values + return PropertyTypeMapper::OBJECT_TYPE; + } else { + return PropertyTypeMapper::ARRAY_TYPE; + } case (is_null($property)): return PropertyTypeMapper::NULL_TYPE; case (is_object($property)): @@ -85,7 +90,6 @@ public static function map( $property) default: throw new UnmappableException("The provided argument property"); } - } public function setProperty($property) diff --git a/src/JSONSchema/Parsers/Exceptions/ParseException.php b/src/JSONSchema/Parsers/Exceptions/ParseException.php new file mode 100644 index 0000000..8b57095 --- /dev/null +++ b/src/JSONSchema/Parsers/Exceptions/ParseException.php @@ -0,0 +1,16 @@ + $property) { - $this->appendProperty( - $key, - $this->determineProperty($property, $key) - ); + $this->appendProperty($key, $this->determineProperty($property)); } } @@ -75,44 +74,34 @@ protected function loadObjectProperties($jsonObj) * check the maps of types * see if it fits some semantics * - * @param object $property - * @return Property + * @param mixed $property + * @return Definition */ - protected function determineProperty($property, $name) + protected function determineProperty($property, $id = null) { - $baseUrl = $this->configKeyExists('baseUrl') ? $this->getConfigSetting('baseUrl') : null; $requiredDefault = $this->configKeyExists('requiredDefault') ? $this->getConfigSetting( 'requiredDefault' ) : false; - $type = StringMapper::map($property); - if ($type == StringMapper::ARRAY_TYPE) { - return $this->determineItem($property, $name); - } + $type = StringMapper::map($property); - $prop = new Property(); + $prop = new Definition(); $prop->setType($type) - ->setName($name) - ->setKey($name)// due to the limited content ability of the basic json string - ->setRequired($requiredDefault); + ->setRequired($requiredDefault); - if ($baseUrl) { - $prop->setId($baseUrl.'/'.$name); - } + /* + since this is an object get the properties of the sub objects + */ + if ( $type == StringMapper::ARRAY_TYPE + || $type == StringMapper::OBJECT_TYPE + ) { - // since this is an object get the properties of the sub objects - if ($type == StringMapper::ARRAY_TYPE) { - $prop->addItem( - $name, - $this->determineItem($property, $name) - ); - } elseif ($type == StringMapper::OBJECT_TYPE) { - foreach ($property as $key => $newProperty) { - $prop->addProperty( - $key, - $this->determineProperty($newProperty, $key) - ); + $prop->setId($id); + + foreach ($property as $key => $p) { + $def = $this->determineProperty($p, $prop->getId() ? $prop->getId().'/'.$key : null); + ($type == StringMapper::OBJECT_TYPE) ? $prop->setProperty($key, $def) : $prop->addItem($def); } } @@ -121,68 +110,6 @@ protected function determineProperty($property, $name) /** - * Similar to determineProperty but with a variation - * Notice that in items list there can be a collection of items - no keys here - * the total items represent a full definition - * we are taking the collection of items - * we should take the cross section of the items and figure out base items - * - * @param array $items - * @param string $name - * @return Property - */ - protected function determineItem($items, $name) - { - $baseUrl = $this->configKeyExists('baseUrl') ? $this->getConfigSetting('baseUrl') : null; - $requiredDefault = $this->configKeyExists('requiredDefault') ? $this->getConfigSetting( - 'requiredDefault' - ) : false; - $type = StringMapper::map($items); - - $retItem = new Item(); - $retItem->setType($type) - ->setName($name) - ->setKey($name)// due to the limited content ability of the basic json string - ->setRequired($requiredDefault); - - if ($baseUrl) { - $retItem->setId($baseUrl.'/'.$name); - } - - - - - // since we stacked the groups of items into their major elements - // add ALL of them to the item listings - if ($type == StringMapper::ARRAY_TYPE) { - // loop through and get a list of the definitions - // stack them together to find the greatest common - foreach ($items as $key => $val) { - // a collapse of each type - $this->stackItemFields($name, $val); - } - - // now that we have our commons lets add them to the items - foreach ($this->itemFields[$name] as $key => $newItem) { - $retItem->addItem( - $key, - $this->determineItem($newItem, $key), - true - ); - } - - } elseif ($type == StringMapper::OBJECT_TYPE) { - $retItem->addItem( - $key, - $this->determineProperty($items, $key) - ); - } - - return $retItem; - } - - /** - * * @param string $name * @param mixed $item */ diff --git a/src/JSONSchema/Parsers/Parser.php b/src/JSONSchema/Parsers/Parser.php index d9e3b6b..6fc8caa 100644 --- a/src/JSONSchema/Parsers/Parser.php +++ b/src/JSONSchema/Parsers/Parser.php @@ -1,12 +1,9 @@ config = $config; $this->initSchema(); return $this; } @@ -170,29 +168,35 @@ public function getConfigSchemaRequiredFields() /** * @param string $key - * @param JSONSchema\Structure\Property $property + * @param Definition $property * @return $this */ - protected function appendProperty($key, Property $property) + protected function appendProperty($key, Definition $property) { - if(!isset($this->schemaObject)) + if (!isset($this->schemaObject)) { throw new NoStructureFoundException("The Schema is not attached or is not initialized. "); - - $this->schemaObject->addProperty($key, $property); + } + + if (in_array($property->getType(), [StringMapper::ARRAY_TYPE, StringMapper::OBJECT_TYPE], true)) { + $property->setId($this->schemaObject->getId().'/'.$key); + } + + $this->schemaObject->setProperty($key, $property); return $this; } /** * @param string $key - * @param JSONSchema\Structure\Item $item + * @param Definition $item * @return $this */ - protected function appendItem($key, Item $item) + protected function appendItem($key, Definition $item) { - if(!isset($this->schemaObject)) + if (!isset($this->schemaObject)) { throw new NoStructureFoundException("The Schema is not attached or is not initialized. "); + } - $this->schemaObject->addItem($key, $item); + $this->schemaObject->addItem($item); return $this; } diff --git a/src/JSONSchema/Structure/Definition.php b/src/JSONSchema/Structure/Definition.php new file mode 100644 index 0000000..35d2e04 --- /dev/null +++ b/src/JSONSchema/Structure/Definition.php @@ -0,0 +1,437 @@ +defaultValue = new UndefinedValue(); + } + + + /** + * @return string the $id + */ + public function getId() + { + return $this->id; + } + + /** + * @return string the $type from JSONSchema\Mappers\StringMapper::* + */ + public function getType() + { + return $this->type; + } + + + /** + * @return null|string the $title + */ + public function getTitle() + { + return $this->title; + } + + /** + * @return null|string the $description + */ + public function getDescription() + { + return $this->description; + } + + /** + * @return boolean the $required + */ + public function isRequired() + { + return !!$this->required; + } + + /** + * @return int the $min + */ + public function getMin() + { + return $this->min; + } + + /** + * @return int the $max + */ + public function getMax() + { + return $this->max; + } + + /** + * @return Definition[] the $properties + */ + public function getProperties() + { + return $this->properties; + } + + /** + * @return Definition[] the $items + */ + public function getItems() + { + return $this->items; + } + + /** + * @param string $id + * @return self + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @param string $type + * @return self + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + + + /** + * @param string $title + * @return self + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * @param string $description + * @return self + */ + public function setDescription($description) + { + $this->description = $description; + + return $this; + } + + /** + * @param boolean $required + * @return self + */ + public function setRequired($required = false) + { + $this->required = !!$required; + + return $this; + } + + /** + * @param integer $min + * @return self + */ + public function setMin($min) + { + $this->min = $min; + + return $this; + } + + /** + * @param integer $max + * @return self + */ + public function setMax($max) + { + $this->max = $max; + + return $this; + } + + /** + * @param string $key + * @param Definition $value + * @return self + */ + public function setProperty($key, Definition $value) + { + $this->properties[$key] = $value; + + return $this; + } + + /** + * @param Definition[] $properties + */ + public function setItems($properties) + { + $this->items = []; + foreach ($properties as $p) { + $this->addItem($p); + } + } + + /** + * @param Definition $value + * @return $this + */ + public function addItem(Definition $value) + { + foreach ($this->items as $i) { + if ($i->equals($value)) { + // item already in list + return $this; + } + } + + $this->items[] = $value; + return $this; + } + + + + /** + * @return string[] a list of required properties + */ + public function getRequireds() + { + $requireds = []; + foreach ($this->properties as $name => $p) { + if ($p->isRequired()) { + $requireds[] = $name; + } + } + } + + /** + * @return mixed + */ + public function getDefaultValue() + { + return $this->defaultValue; + } + + /** + * @param mixed $defaultValue + * @return Definition + */ + public function setDefaultValue($defaultValue) + { + $this->defaultValue = $defaultValue; + + return $this; + } + + /** + * @return array|null + */ + public function getEnum() + { + return $this->enum; + } + + /** + * @param array|null $enum + * @return Definition + */ + public function setEnum($enum) + { + $this->enum = $enum; + + return $this; + } + + /** + * @return array flattened fields + */ + public function flatten() + { + // field object - to force the object type in json encode + $fa = new \stdClass(); + + if (!empty($this->getId())) { + $fa->id = $this->getId(); + } + + + + $fa->type = $this->getType(); + + if ($this->getTitle()) { + $fa->title = $this->getTitle(); + } + + if (!empty($this->description)) { + $fa->description = $this->getDescription(); + } + + if ($fa->type == PropertyTypeMapper::INTEGER_TYPE || + $fa->type == PropertyTypeMapper::NUMBER_TYPE + ) { + if (!empty($this->min)) { + $fa->min = $this->getMin(); + } + if (!empty($this->max)) { + $fa->max = $this->getMax(); + } + } + + if (!$this->defaultValue instanceof UndefinedValue) { + $fa->default = $this->defaultValue; + } + + if ($this->getType() === StringMapper::ARRAY_TYPE) { + // add the items + $items = []; + foreach ($this->getItems() as $key => $item) { + $items[] = $item->flatten(); + } + $fa->items = new \StdClass(); + $fa->items->anyOf = $items; + + } else if ($this->getType() === StringMapper::OBJECT_TYPE) { + if ($this->getRequireds()) { + $fa->required = $this->getRequireds(); + } + if ($this->getProperties()) { + $fa->properties = new \StdClass(); + foreach ($this->getProperties() as $key => $property) { + $fa->properties->$key = $property->flatten(); + } + } + } + + return $fa; + } + + /** + * @return \stdClass + */ + function jsonSerialize() + { + return $this->flatten(); + } + + + /** + * @param Definition $d + * @return bool + */ + function equals(Definition $d) + { + return "$d" === "$this"; + } + + /** + * @return string + */ + function __toString() + { + return json_encode($this); + } + + +} diff --git a/src/JSONSchema/Structure/Encodable.php b/src/JSONSchema/Structure/Encodable.php index 1093a18..136e3c3 100644 --- a/src/JSONSchema/Structure/Encodable.php +++ b/src/JSONSchema/Structure/Encodable.php @@ -8,6 +8,6 @@ interface Encodable * @abstract * @return array - all the fields that are necessary for encoding */ - public function asEncodeArray(){} + public function asEncodeArray(); } diff --git a/src/JSONSchema/Structure/Item.php b/src/JSONSchema/Structure/Item.php deleted file mode 100644 index fb1b4d7..0000000 --- a/src/JSONSchema/Structure/Item.php +++ /dev/null @@ -1,30 +0,0 @@ -id; - } - - /** - * @return the $type - */ - public function getType() - { - return $this->type; - } - - /** - * @return the $key - */ - public function getKey() - { - return $this->key; - } - - /** - * @return the $name - */ - public function getName() - { - return $this->name; - } - - /** - * @return the $title - */ - public function getTitle() - { - return $this->title; - } - - /** - * @return the $description - */ - public function getDescription() - { - return $this->description; - } - - /** - * @return the $required - */ - public function getRequired() - { - return $this->required; - } - - /** - * @return the $min - */ - public function getMin() - { - return $this->min; - } - - /** - * @return the $max - */ - public function getMax() - { - return $this->max; - } - - /** - * @return the $properties - */ - public function getProperties() - { - return $this->properties; - } - - /** - * @return the $items - */ - public function getItems() - { - return $this->items; - } - - /** - * @param string $id - */ - public function setId($id) - { - $this->id = $id; - return $this; - } - - /** - * @param string $type - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * @param string $key - */ - public function setKey($key) - { - $this->key = $key; - return $this; - } - - /** - * @param string $name - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * @param string $title - */ - public function setTitle($title) - { - $this->title = $title; - return $this; - } - - /** - * @param string $description - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * @param boolean $required - */ - public function setRequired($required = false) - { - $this->required = $required; - return $this; - } - - /** - * @param integer $min - */ - public function setMin($min) - { - $this->min = $min; - return $this; - } - - /** - * @param integer $max - */ - public function setMax($max) - { - $this->max = $max; - return $this; - } - - /** - * @param string $key - * @param Property $value - * @param boolean $overwrite - * @return $this - * @throws Exceptions\OverwriteKeyException - */ - public function addProperty($key,Property $value,$overwrite = true) - { - if(!empty($this->properties[$key]) && !$overwrite) - throw new Exceptions\OverwriteKeyException(); - - $this->properties[$key] = $value; - return $this; - } - - - /** - * @param string $key - * @param Item $value - * @param boolean $overwrite - * @return $this - * @throws Exceptions\OverwriteKeyException - */ - public function addItem($key,Item $value,$overwrite = true) - { - if(!empty($this->items[$key]) && !$overwrite) - throw new Exceptions\OverwriteKeyException(); - - $this->items[$key] = $value; - return $this; - } - - /** - * @param string $parentId - identifier for the parent element - * @return array fields - */ - public function loadFields($parentId = null) - { - // field object - to force the object type in json encode - $fa = new \stdClass(); - $fa->id = $this->id ? $this->getId() : $parentId . '/' . $this->name; - $fa->type = $this->getType(); - if(isset($this->key)) $fa->key = $this->getKey(); - $fa->name = $this->getName(); - $fa->title = $this->getTitle(); - if(isset($this->description)) $fa->description = $this->getDescription(); - $fa->required = $this->required; - - if($fa->type == PropertyTypeMapper::INTEGER_TYPE || - $fa->type == PropertyTypeMapper::NUMBER_TYPE ) - { - if(!empty($this->min)) $fa->min = $this->getMin(); - if(!empty($this->max)) $fa->max = $this->getMax(); - } - - - $properties = $this->getProperties(); - if($properties)$fa->properties = new \stdClass(); - foreach($properties as $key => $property) - $fa->properties->$key = $property->loadFields($this->getId()); - - // add the items - $items = $this->getItems(); - foreach($items as $key => $item) - $fa->items[] = $item->loadFields($this->getId()); - - return $fa; - } - -} diff --git a/src/JSONSchema/Structure/Schema.php b/src/JSONSchema/Structure/Schema.php index a48f8c4..04bbbab 100644 --- a/src/JSONSchema/Structure/Schema.php +++ b/src/JSONSchema/Structure/Schema.php @@ -2,46 +2,21 @@ namespace JSONSchema\Structure; /** - * A JSON document + * A JSON document * Represents the body of the schema * Can be decomposed and consolidated as a simple array of key values for easy json_encoding - * + * * @link http://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.2 * @author steven - * + * @package JSONSchema\Structure */ -use JSONSchema\Mappers\PropertyTypeMapper; - -class Schema +class Schema extends Definition { - - /** - * From section 3.2 - * Object members are keywords - * - * @var array - */ - protected $keywords = array(); - - /** - * Properties - * - * @var array $properties - */ - protected $properties = array(); - - /** - * Special use case - * JSON Array - * - * @var array $items - */ - protected $items = array(); - + /** * @var string */ - protected $dollarSchema = 'http://json-schema.org/draft-04/schema'; + protected $dollarSchema = 'http://json-schema.org/draft-04/schema#'; /** * the ID is a string reference to the resource that is identified in this document @@ -51,22 +26,6 @@ class Schema * @var string $id */ protected $id = 'http://jsonschema.net'; - - /** - * properties or items in a list which are required - * @var array $required - */ - protected $required = array(); - - /** - * @var string $title - */ - protected $title = ''; - - /** - * @var string $description - */ - protected $description = ''; /** * the JSON primitive type @@ -89,293 +48,34 @@ class Schema */ protected $pruneEmptyFields = true; - - public function __construct() - { - - } - - /** - * @param string $key - * @param string $value - * @param boolean $overwrite - * @return $this - * @throws Exceptions\OverwriteKeyException - */ - public function addKeyword($key,$value,$overwrite = true) - { - if(!empty($this->keywords[$key]) && !$overwrite) - throw new Exceptions\OverwriteKeyException(); - - $this->keywords[$key] = $value; - return $this; - } - - /** - * @param string $key - * @param Property $value - * @param boolean $overwrite - * @return $this - * @throws Exceptions\OverwriteKeyException - */ - public function addProperty($key,Property $value,$overwrite = true) - { - if(!empty($this->properties[$key]) && !$overwrite) - throw new Exceptions\OverwriteKeyException(); - - $value->setId($this->getId() . '/' . $key); - $this->properties[$key] = $value; - return $this; - } - - /** - * @param string $key - * @param string $value - * @param boolean $overwrite - * @return $this - * @throws Exceptions\OverwriteKeyException - */ - public function addItem($key,$value,$overwrite = true) - { - if(!empty($this->items[$key]) && !$overwrite) - throw new Exceptions\OverwriteKeyException(); - - $this->items[$key] = $value; - return $this; - } - - /** - * @param string $key - * @return $this - */ - public function removeKeyword($key) - { - unset($this->keywords[$key]); - return $this; - } - - /** - * @param string $key - * @return $this - */ - - public function removeProperty($key) - { - unset($this->properties[$key]); - return $this; - } - - /** - * @param string $key - * @return $this - */ - - public function removeItem($key) - { - unset($this->items[$key]); - return $this; - } - - /** - * @return array - */ - public function getKeywords() - { - return $this->keywords; - } - - /** - * @return array - */ - public function getProperties() - { - return $this->properties; - } - - /** - * @return array - */ - public function getItems() - { - return $this->items; - } - - - /** - * @return the $dollarSchema - */ - public function getDollarSchema() - { - return $this->dollarSchema; - } - - /** - * @return $id - */ - public function getId() - { - return $this->id; - } - - /** - * @return the $required - */ - public function getRequired() - { - return $this->required; - } - /** - * @return the $title - */ - public function getTitle() - { - return $this->title; - } - - /** - * @return the $description - */ - public function getDescription() - { - return $this->description; - } - - /** - * @return the $type - */ - public function getType() - { - return $this->type; - } - /** - * @return the $mediaType - */ - public function getMediaType() - { - return $this->mediaType; - } - /** - * @param string $dollarSchema - */ - public function setDollarSchema($dollarSchema) - { - $this->dollarSchema = $dollarSchema; - return $this; - } - - /** - * - * - * @param string $id - */ - public function setId($id) - { - $this->id = $id; - return $this; - } - - /** - * @param boolean $required - */ - public function setRequired($required) - { - $this->required = $required; - return $this; - } - - /** - * @param string $title - */ - public function setTitle($title) - { - $this->title = $title; - return $this; - } - - /** - * @param string $description - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * @param string $type - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * @param string $mediaType - */ - public function setMediaType($mediaType) - { - $this->mediaType = $mediaType; - return $this; - } - /** * A string representation of this Schema * @return string */ public function toString() { - return json_encode($this->loadFields()); - } - - /** - * simply convert to an array - * @return array - */ - public function toArray() - { - return $this->loadFields(); + return json_encode($this); } - + /** * Main schema generation utility * * @return array list of fields and values including the properties/items */ - public function loadFields() + public function flatten() { - // schema holder - $sa = new \stdClass(); - $sa->id = $this->id; - $sa->schema = $this->dollarSchema; - $sa->required = $this->required; - $sa->title = $this->title; - $sa->description = $this->description; - $sa->type = $this->type; - $sa->mediaType = $this->mediaType; // not really part of the schema but i'm tacking it here for safe handling - - // add the items - $items = $this->getItems(); - foreach($items as $key => $item) - $sa->items[$key] = $item->loadFields($this->id); - - // add the propertiestas - $properties = $this->getProperties(); - // it's an object so instantiate one - if($properties) - $sa->properties = new \stdClass(); - - foreach($properties as $key => $property) - $sa->properties->$key = $property->loadFields(); + $def = new \stdClass(); + $def->{'$schema'} = $this->dollarSchema; + $def->mediaType = $this->mediaType; // not really part of the schema but i'm tacking it here for safe handling + foreach (parent::flatten() as $k => $v) { + $def->$k = $v; + } - - if($sa->type == PropertyTypeMapper::ARRAY_TYPE) - return (array) $sa; - else - return $sa; - + return $def; } + + } \ No newline at end of file diff --git a/src/JSONSchema/Structure/UndefinedValue.php b/src/JSONSchema/Structure/UndefinedValue.php new file mode 100644 index 0000000..362c77e --- /dev/null +++ b/src/JSONSchema/Structure/UndefinedValue.php @@ -0,0 +1,16 @@ +assertEquals($file, ''); + $json = file_get_contents($file); + $schema = Generator::fromJson($json); + + $this->assertTrue(!!$schema); + +// print_r([ +// "schema" => json_encode(json_decode($result), JSON_PRETTY_PRINT), +// 'json' => $json, +// ]); + + /* + * Validate schema regarding the spec + */ + $dereferencer = \League\JsonReference\Dereferencer::draft4(); + $jsonSchemaSchema = $dereferencer->dereference('http://json-schema.org/draft-04/schema#'); + $validator = new \League\JsonGuard\Validator(json_decode($schema), json_decode(file_get_contents(__DIR__.'/../../json-schema.draft4.json'))); + $this->assertFalse($validator->fails(), 'should validate that the schema is a valid json schema draft 4'); + + /* + * Validate input regarding generated schema + */ + $validator = new \League\JsonGuard\Validator(json_decode($json), json_decode($schema)); + $this->assertFalse($validator->fails(), 'should validate that the given schema ' . $schema . ' validate the input : ' . $json); } @@ -43,65 +65,36 @@ public function testGeneration($file) */ public function testCanParseSimple() { - $result = Generator::JSONString($this->addressJson1,'test'); + $result = Generator::fromJson($this->addressJson1); $decoded = json_decode($result); + $this->assertTrue(is_object($decoded)); - $this->assertTrue(isset($decoded->schema)); + $this->assertTrue(isset($decoded->{'$schema'})); $this->assertTrue(isset($decoded->properties)); $this->assertTrue(isset($decoded->properties->address)); $this->assertTrue(isset($decoded->properties->address->type)); $this->assertEquals($decoded->properties->address->type, 'object'); $this->assertTrue(isset($decoded->properties->phoneNumber)); $this->assertEquals($decoded->properties->phoneNumber->type,'array'); - $this->assertTrue(is_array($decoded->properties->phoneNumber->items)); - $this->assertTrue(count($decoded->properties->phoneNumber->items) == 2); + $this->assertTrue(is_array($decoded->properties->phoneNumber->items->anyOf)); + $this->assertCount(1, $decoded->properties->phoneNumber->items->anyOf); } - - /** - * we are using magic methods to call the app for short signature calls - * We need to know that calling JSONString will call the JSONStringParser and then parse - * - * @expectedException \InvalidArgumentException - */ - public function testFunctionalClassLoad() - { - $generator = new Generator(); - - $this->assertTrue($generator instanceof Generator); - $this->assertNull($generator->getParser()); - - $parser = new JSONStringParser(); - $generator->setParser($parser); - - // set the parser and then get the same parser back - // the type should not have changed - $this->assertSame($generator->getParser(),$parser); - $this->assertTrue($generator->getParser() instanceof JSONStringParser); - - - // test that we throw an exception if the subject is not provided - $result = Generator::JSONString(); - - } /** * the most basic functionality */ public function testCanParseExample2() { - $generator = new Generator($this->addressJson2); - $this->assertTrue($generator->getParser() instanceof JSONStringParser); - // returns itself for chained calls - $this->assertTrue($generator->parse() instanceof JSONStringParser); - $result = $generator->getParser()->json(); - + $result = Generator::fromJson($this->addressJson2); + // most of the same tests as example 1 $this->assertTrue(is_string($result)); $decoded = json_decode($result); +// print_r(json_encode($decoded, JSON_PRETTY_PRINT)); $this->assertTrue(is_object($decoded)); - $this->assertTrue(isset($decoded->schema)); + $this->assertTrue(is_string($decoded->{'$schema'})); $this->assertTrue(isset($decoded->properties)); $this->assertTrue(isset($decoded->properties->bar)); $this->assertTrue(isset($decoded->properties->bar->properties->barAddress)); @@ -111,8 +104,8 @@ public function testCanParseExample2() $this->assertEquals($decoded->properties->address->type, 'object'); $this->assertTrue(isset($decoded->properties->phoneNumber)); $this->assertEquals($decoded->properties->phoneNumber->type,'array'); - $this->assertTrue(is_array($decoded->properties->phoneNumber->items)); - $this->assertTrue(count($decoded->properties->phoneNumber->items) == 4); + $this->assertTrue(is_array($decoded->properties->phoneNumber->items->anyOf)); + $this->assertCount(3, $decoded->properties->phoneNumber->items->anyOf); $this->assertTrue(isset($decoded->properties->test)); $this->assertEquals($decoded->properties->test->type,'string'); $this->assertEquals($decoded->properties->phoneNumber->id,'http://jsonschema.net/phoneNumber'); diff --git a/tests/json-schema.draft4.json b/tests/json-schema.draft4.json new file mode 100644 index 0000000..88f6ca7 --- /dev/null +++ b/tests/json-schema.draft4.json @@ -0,0 +1,151 @@ +{ + "id": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "positiveInteger": { + "type": "integer", + "minimum": 0 + }, + "positiveIntegerDefault0": { + "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] + }, + "simpleTypes": { + "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "minItems": 1, + "uniqueItems": true + } + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "multipleOf": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { "$ref": "#/definitions/positiveInteger" }, + "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": {} + }, + "maxItems": { "$ref": "#/definitions/positiveInteger" }, + "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { "$ref": "#/definitions/positiveInteger" }, + "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "dependencies": { + "exclusiveMaximum": [ "maximum" ], + "exclusiveMinimum": [ "minimum" ] + }, + "default": {} +} \ No newline at end of file From 5a0099d58c6de773f7098dc075aa5041b3a38bb8 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Mon, 14 Aug 2017 20:07:04 +0200 Subject: [PATCH 04/28] make unit test great again --- tests/JSONSchema/Tests/GeneratorTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/JSONSchema/Tests/GeneratorTest.php b/tests/JSONSchema/Tests/GeneratorTest.php index cb5d728..d83a866 100644 --- a/tests/JSONSchema/Tests/GeneratorTest.php +++ b/tests/JSONSchema/Tests/GeneratorTest.php @@ -92,7 +92,6 @@ public function testCanParseExample2() // most of the same tests as example 1 $this->assertTrue(is_string($result)); $decoded = json_decode($result); -// print_r(json_encode($decoded, JSON_PRETTY_PRINT)); $this->assertTrue(is_object($decoded)); $this->assertTrue(is_string($decoded->{'$schema'})); $this->assertTrue(isset($decoded->properties)); From c36ecf9f907f7e511ed10976a7f3a3aa75b84241 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Mon, 14 Aug 2017 20:35:26 +0200 Subject: [PATCH 05/28] test travis --- .coveralls.yml | 3 + .travis.yml | 25 +- README.md | 23 + composer.json | 13 +- composer.lock | 809 +++++++++++++++--- src/JSONSchema/Parsers/ArrayObjectParser.php | 1 - src/JSONSchema/Parsers/ArrayParser.php | 1 - .../Parsers/DoctrineEntityParser.php | 1 - src/JSONSchema/Parsers/ObjectParser.php | 1 - src/JSONSchema/Parsers/ParserFactory.php | 102 --- src/JSONSchema/Structure/Encodable.php | 13 - src/JSONSchema/Structure/Schema.php | 5 +- src/JSONSchema/Structure/SubSchema.php | 1 - tests/JSONSchema/Tests/GeneratorTest.php | 10 +- tests/JSONSchema/Tests/JSONSchemaTestCase.php | 26 +- 15 files changed, 782 insertions(+), 252 deletions(-) create mode 100644 .coveralls.yml delete mode 100644 src/JSONSchema/Parsers/ArrayObjectParser.php delete mode 100644 src/JSONSchema/Parsers/ArrayParser.php delete mode 100644 src/JSONSchema/Parsers/DoctrineEntityParser.php delete mode 100644 src/JSONSchema/Parsers/ObjectParser.php delete mode 100644 src/JSONSchema/Parsers/ParserFactory.php delete mode 100644 src/JSONSchema/Structure/Encodable.php delete mode 100644 src/JSONSchema/Structure/SubSchema.php diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..5697ff1 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,3 @@ +src_dir: . +coverage_clover: build/logs/clover.xml +json_path: build/logs/coveralls-upload.json \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index b336775..f8a96ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,27 @@ language: php php: - - 5.4 - 5.5 + - 5.6 + - 7.0 + - hhvm -before_script: - - composer install --dev -script: phpunit --coverage-text +matrix: + allow_failures: +# - php: 7.0 + - php: hhvm + fast_finish: true + + +install: + - composer install --dev --no-interaction + + +script: + - mkdir -p build/logs + - phpunit + + +after_script: + - php vendor/bin/coveralls -v \ No newline at end of file diff --git a/README.md b/README.md index ade638f..76198b3 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,29 @@ Package: php-json-schema-generator PHP JSON Schema Generator +## Quickstart + +Can't be easier + + + $output = JSONSchema\Generator::fromJson('{"a":{"b":2}'); + // $output ==> json string + // { + // "$schema": "http://json-schema.org/draft-04/schema#", + // "type": "object", + // "properties": { + // "a": { + // "type": "object", + // "properties": { + // "b": { + // "type": "integer" + // } + // } + // } + // } + // } + + ## About JSON Schema JSON has become a mainstay in the vast HTTP toolbox. In order to make JSON more stable and to increase the longevity of the data structure there must be some standards put into place. These standards will help to define the structure in a way that the industry can rely on. A uniform way to parse the data and interpret the meaning of the data elements can be found in building a schema that represents it. diff --git a/composer.json b/composer.json index aacccbe..bd154e3 100644 --- a/composer.json +++ b/composer.json @@ -1,22 +1,27 @@ { - "name": "solvire/php-json-schema-generator", + "name": "evaisse/php-json-schema-generator", "type": "library", - "description": "A JSON Schema Generator written in PHP. The implementation is based on current internet drafts.", + "description": "A JSON Schema Generator.", "keywords": ["PHP", "JSON", "Schema", "generator", "validation", "parser"], - "homepage": "https://github.com/solvire/php-json-schema-generator", + "homepage": "https://github.com/evaisse/php-json-schema-generator", "license": "MIT", "authors": [ { "name": "Steven Scott", "email": "steve@openfoc.us" + }, + { + "name": "Emmanuel VAÏSSE", + "email": "evaisse@gmail.com" } ], "require": { "php": ">=5.4.0", - "league/json-guard": "^1.0" + "satooshi/php-coveralls": "^1.0" }, "require-dev": { "phpunit/phpunit": "3.7.*", + "league/json-guard": "^1.0", "league/json-reference": "^1.0" }, "autoload": { diff --git a/composer.lock b/composer.lock index 265f0d1..f80e948 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,665 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "c36a3e0b0c1e651fa453b063ebfedeac", - "content-hash": "51537f485bad7a41179aae543ec5842e", + "hash": "e0d2047c1c8a016f2591ea9681529f7f", + "content-hash": "c7e9fa8fa672eeba9d68195bf0e12cf7", "packages": [ + { + "name": "guzzle/guzzle", + "version": "v3.9.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" + }, + "suggest": { + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.9-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18 18:23:50" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10 12:19:37" + }, + { + "name": "satooshi/php-coveralls", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/satooshi/php-coveralls.git", + "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/da51d304fe8622bf9a6da39a8446e7afd432115c", + "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8|^3.0", + "php": ">=5.3.3", + "psr/log": "^1.0", + "symfony/config": "^2.1|^3.0", + "symfony/console": "^2.1|^3.0", + "symfony/stopwatch": "^2.0|^3.0", + "symfony/yaml": "^2.0|^3.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/satooshi/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2016-01-20 17:35:46" + }, + { + "name": "symfony/config", + "version": "v3.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "54ee12b0dd60f294132cabae6f5da9573d2e5297" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/54ee12b0dd60f294132cabae6f5da9573d2e5297", + "reference": "54ee12b0dd60f294132cabae6f5da9573d2e5297", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/filesystem": "~2.8|~3.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~3.3", + "symfony/finder": "~3.3", + "symfony/yaml": "~3.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-07-19 07:37:29" + }, + { + "name": "symfony/console", + "version": "v3.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "b0878233cb5c4391347e5495089c7af11b8e6201" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201", + "reference": "b0878233cb5c4391347e5495089c7af11b8e6201", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/filesystem": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-07-29 21:27:59" + }, + { + "name": "symfony/debug", + "version": "v3.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13", + "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-07-28 15:27:31" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1377400fd641d7d1935981546aaef780ecd5bf6d", + "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-06-02 07:47:27" + }, + { + "name": "symfony/filesystem", + "version": "v3.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "427987eb4eed764c3b6e38d52a0f87989e010676" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/427987eb4eed764c3b6e38d52a0f87989e010676", + "reference": "427987eb4eed764c3b6e38d52a0f87989e010676", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-07-11 07:17:58" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-06-09 14:24:12" + }, + { + "name": "symfony/stopwatch", + "version": "v3.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "602a15299dc01556013b07167d4f5d3a60e90d15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/602a15299dc01556013b07167d4f5d3a60e90d15", + "reference": "602a15299dc01556013b07167d4f5d3a60e90d15", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2017-04-12 14:14:56" + }, + { + "name": "symfony/yaml", + "version": "v2.8.26", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-06-01 20:52:29" + } + ], + "packages-dev": [ { "name": "league/json-guard", "version": "1.0.1", @@ -66,57 +722,6 @@ ], "time": "2017-05-03 21:12:30" }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14 16:28:37" - } - ], - "packages-dev": [ { "name": "league/json-reference", "version": "1.0.0", @@ -550,6 +1155,55 @@ ], "time": "2013-01-13 10:24:48" }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14 16:28:37" + }, { "name": "psr/simple-cache", "version": "1.0.0", @@ -648,55 +1302,6 @@ "url" ], "time": "2017-02-20 19:59:28" - }, - { - "name": "symfony/yaml", - "version": "v2.8.26", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", - "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2017-06-01 20:52:29" } ], "aliases": [], diff --git a/src/JSONSchema/Parsers/ArrayObjectParser.php b/src/JSONSchema/Parsers/ArrayObjectParser.php deleted file mode 100644 index b3d9bbc..0000000 --- a/src/JSONSchema/Parsers/ArrayObjectParser.php +++ /dev/null @@ -1 +0,0 @@ -{'$schema'} = $this->dollarSchema; - $def->mediaType = $this->mediaType; // not really part of the schema but i'm tacking it here for safe handling foreach (parent::flatten() as $k => $v) { $def->$k = $v; } diff --git a/src/JSONSchema/Structure/SubSchema.php b/src/JSONSchema/Structure/SubSchema.php deleted file mode 100644 index b3d9bbc..0000000 --- a/src/JSONSchema/Structure/SubSchema.php +++ /dev/null @@ -1 +0,0 @@ -getDataPath(); foreach (glob($root.'/*.json') as $k => $v) { $samples[substr($v, strlen($root)+1)] = [$v]; } return $samples; } + + public function testBasics() + { + $this->assertEquals('{"$schema":"http:\/\/json-schema.org\/draft-04\/schema#","mediaType":"application\/schema+json","id":"http:\/\/jsonschema.net","type":"object","properties":{"a":{"id":"http:\/\/jsonschema.net\/a","type":"object","properties":{"b":{"type":"integer"}}}}}', \JSONSchema\Generator::fromJson('{"a":{"b":2}}')); + } + /** * @dataProvider provideJsonSamples */ @@ -36,6 +42,8 @@ public function testGeneration($file) $json = file_get_contents($file); $schema = Generator::fromJson($json); + + $this->assertTrue(!!$schema); // print_r([ diff --git a/tests/JSONSchema/Tests/JSONSchemaTestCase.php b/tests/JSONSchema/Tests/JSONSchemaTestCase.php index 2a9e557..fe4fb4d 100644 --- a/tests/JSONSchema/Tests/JSONSchemaTestCase.php +++ b/tests/JSONSchema/Tests/JSONSchemaTestCase.php @@ -26,7 +26,12 @@ abstract class JSONSchemaTestCase extends \PHPUnit_Framework_TestCase * list of the parser types */ protected $parsers = array(); - + + + public function getDataPath() + { + return realpath(__DIR__.'/../../data/'); + } /** * since we will probably use the example.address.json data all over the place lets go ahead and load it up @@ -34,22 +39,7 @@ abstract class JSONSchemaTestCase extends \PHPUnit_Framework_TestCase */ public function setup() { - $dataFile = realpath(__DIR__ . '/../../data/example.address1.json'); - if(!file_exists($dataFile)) - throw new \RuntimeException("The file: $dataFile does not exist"); - - // encoded and decoded to pack it down - $this->addressJson1 = json_encode(json_decode(file_get_contents($dataFile))); - - - $dataFile = realpath(__DIR__ . '/../../data/example.address2.json'); - if(!file_exists($dataFile)) - throw new \RuntimeException("The file: $dataFile does not exist"); - $this->addressJson2 = json_encode(json_decode(file_get_contents($dataFile))); - - - $this->parsers = ParserFactory::getParserTypes(); - - + $this->addressJson1 = json_encode(json_decode(file_get_contents($this->getDataPath().'/example.address1.json')), JSON_PRETTY_PRINT); + $this->addressJson2 = json_encode(json_decode(file_get_contents($this->getDataPath().'/example.address2.json')), JSON_PRETTY_PRINT); } } From 4baef1e6e521da03029465d750acbe89f6afa807 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Mon, 14 Aug 2017 20:36:35 +0200 Subject: [PATCH 06/28] update travis config --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8a96ef..76572d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,12 @@ php: - 5.5 - 5.6 - 7.0 + - 7.1 - hhvm matrix: allow_failures: -# - php: 7.0 - php: hhvm fast_finish: true @@ -23,5 +23,5 @@ script: - phpunit -after_script: - - php vendor/bin/coveralls -v \ No newline at end of file +#after_script: +# - php vendor/bin/coveralls -v \ No newline at end of file From 8678f8ad01cf260b809b8885f30759fede570269 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Mon, 14 Aug 2017 20:38:59 +0200 Subject: [PATCH 07/28] add all --- src/JSONSchema/Parsers/Parser.php | 2 +- tests/JSONSchema/Tests/GeneratorTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/JSONSchema/Parsers/Parser.php b/src/JSONSchema/Parsers/Parser.php index 6fc8caa..7fa24f3 100644 --- a/src/JSONSchema/Parsers/Parser.php +++ b/src/JSONSchema/Parsers/Parser.php @@ -178,7 +178,7 @@ protected function appendProperty($key, Definition $property) } if (in_array($property->getType(), [StringMapper::ARRAY_TYPE, StringMapper::OBJECT_TYPE], true)) { - $property->setId($this->schemaObject->getId().'/'.$key); + $property->setId($this->schemaObject->getId() ? $this->schemaObject->getId().'/'.$key : null); } $this->schemaObject->setProperty($key, $property); diff --git a/tests/JSONSchema/Tests/GeneratorTest.php b/tests/JSONSchema/Tests/GeneratorTest.php index 8ca9b1d..c934dcb 100644 --- a/tests/JSONSchema/Tests/GeneratorTest.php +++ b/tests/JSONSchema/Tests/GeneratorTest.php @@ -31,7 +31,8 @@ public function provideJsonSamples() public function testBasics() { - $this->assertEquals('{"$schema":"http:\/\/json-schema.org\/draft-04\/schema#","mediaType":"application\/schema+json","id":"http:\/\/jsonschema.net","type":"object","properties":{"a":{"id":"http:\/\/jsonschema.net\/a","type":"object","properties":{"b":{"type":"integer"}}}}}', \JSONSchema\Generator::fromJson('{"a":{"b":2}}')); + $expected = '{"$schema":"http:\/\/json-schema.org\/draft-04\/schema#","type":"object","properties":{"a":{"type":"object","properties":{"b":{"type":"integer"}}}}}'; + $this->assertEquals($expected, \JSONSchema\Generator::fromJson('{"a":{"b":2}}')); } /** From 4ee2b85cb5655cc7efe000787f492bb5835dd1f1 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Tue, 15 Aug 2017 16:15:55 +0200 Subject: [PATCH 08/28] cleanup --- src/JSONSchema/Generator.php | 17 +- src/JSONSchema/Parsers/BaseParser.php | 214 +++++++++++++++ src/JSONSchema/Parsers/JSONStringParser.php | 128 --------- src/JSONSchema/Parsers/Parser.php | 246 ------------------ src/JSONSchema/Structure/Definition.php | 65 ++++- src/JSONSchema/Structure/Schema.php | 18 +- tests/JSONSchema/Tests/GeneratorTest.php | 65 ++++- .../Tests/Parsers/ArrayObjectParserTest.php | 0 .../Tests/Parsers/ArrayParserTest.php | 29 --- .../Tests/Parsers/JSONStringParserTest.php | 0 .../Tests/Parsers/ObjectParserTest.php | 0 tests/JSONSchema/Tests/Parsers/ParserTest.php | 1 - 12 files changed, 351 insertions(+), 432 deletions(-) create mode 100644 src/JSONSchema/Parsers/BaseParser.php delete mode 100644 src/JSONSchema/Parsers/JSONStringParser.php delete mode 100644 src/JSONSchema/Parsers/Parser.php delete mode 100644 tests/JSONSchema/Tests/Parsers/ArrayObjectParserTest.php delete mode 100644 tests/JSONSchema/Tests/Parsers/ArrayParserTest.php delete mode 100644 tests/JSONSchema/Tests/Parsers/JSONStringParserTest.php delete mode 100644 tests/JSONSchema/Tests/Parsers/ObjectParserTest.php delete mode 100644 tests/JSONSchema/Tests/Parsers/ParserTest.php diff --git a/src/JSONSchema/Generator.php b/src/JSONSchema/Generator.php index 1eed0cd..af0a5dd 100644 --- a/src/JSONSchema/Generator.php +++ b/src/JSONSchema/Generator.php @@ -2,8 +2,7 @@ namespace JSONSchema; -use JSONSchema\Parsers\JSONStringParser; -use JSONSchema\Parsers\Parser; +use JSONSchema\Parsers\BaseParser; /** * @@ -21,14 +20,24 @@ abstract class Generator { + /** + * @param mixed $object + * @return string + */ + public static function from($object, array $config = null) + { + $parser = new BaseParser($config); + return $parser->parse($object)->json(); + } + /** * @param string $jsonString * @return string */ public static function fromJson($jsonString, array $config = null) { - $parser = new JSONStringParser($config); - return $parser->parse($jsonString)->json(); + $parser = new BaseParser($config); + return $parser->parse(json_decode($jsonString))->json(); } } diff --git a/src/JSONSchema/Parsers/BaseParser.php b/src/JSONSchema/Parsers/BaseParser.php new file mode 100644 index 0000000..cea5a7d --- /dev/null +++ b/src/JSONSchema/Parsers/BaseParser.php @@ -0,0 +1,214 @@ +config = array_merge([ + 'schema_id' => null, + 'properties_required_by_default' => true, + 'schema_uri' => 'http://json-schema.org/draft-04/schema#', + 'schema_title' => null, + 'schema_description' => null, + 'schema_type' => null, + "items_schema_collect_mode" => 0, + 'schema_required_field_names' => [] + ], $config ? $config : []); + + $this->initSchema(); + } + + + /** + * + */ + public function initSchema() + { + $this->schemaObject = new Schema(); + $this->loadSchema(); + } + + /** + * @param string $key + * @param Definition $property + * @return $this + */ + protected function appendProperty($key, Definition $property) + { + if (!isset($this->schemaObject)) { + throw new NoStructureFoundException("The Schema is not attached or is not initialized. "); + } + + if (in_array($property->getType(), [StringMapper::ARRAY_TYPE, StringMapper::OBJECT_TYPE], true)) { + $property->setId($this->schemaObject->getId() ? $this->schemaObject->getId().'/'.$key : null); + } + + $this->schemaObject->setProperty($key, $property); + + return $this; + } + + /** + * basically set up the schema object with the properties + * provided in the config + * most items are defaulted as they are probably domain specific + * + * @throws InvalidConfigItemException + */ + protected function loadSchema() + { + if (isset($this->config['schema_id'])) { + $this->schemaObject->setId($this->config['schema_id']); + } + + // namespace is schema_ + // try to set all the variables for the schema from the supplied config + if (isset($this->config['schema_dollarSchema'])) { + $this->schemaObject->setDollarSchema($this->config['schema_dollarSchema']); + } + + if (isset($this->config['schema_required'])) { + $this->schemaObject->setRequired($this->config['schema_required']); + } + + if (isset($this->config['schema_title'])) { + $this->schemaObject->setTitle($this->config['schema_title']); + } + + if (isset($this->config['schema_description'])) { + $this->schemaObject->setDescription($this->config['schema_description']); + } + + if (isset($this->config['schema_type'])) { + $this->schemaObject->setType($this->config['schema_type']); + } + + return $this; + } + + /** + * @param null|string $subject + * @return $this + */ + public function parse($subject = null) + { + $this->loadObjectProperties($subject); + $this->loadSchema(); + + return $this; + } + + /** + * top level + * every recurse under this will add to the properties of the property + * + * @param array $jsonObj + */ + protected function loadObjectProperties($jsonObj) + { + // start walking the object + foreach ($jsonObj as $key => $property) { + $this->appendProperty($key, $this->determineProperty($property)); + } + } + + + /** + * due to the fact that determining property will be so different between + * parser types we should probably just define this function here + * In a JSON string it will be very simple. + * enter a string + * see what the string looks like + * check the maps of types + * see if it fits some semantics + * + * @param mixed $property + * @return Definition + */ + protected function determineProperty($property, $id = null) + { + $id = $id ?: $this->config['schema_id']; + $requiredDefault = $this->config['properties_required_by_default']; + + $type = StringMapper::map($property); + + $prop = new Definition(); + $prop->setType($type) + ->setCollectionMode($this->config['items_schema_collect_mode'] + ? Definition::ITEMS_AS_LIST + : Definition::ITEMS_AS_COLLECTION) + ->setRequired($requiredDefault); + + /* + since this is an object get the properties of the sub objects + */ + if ( $type == StringMapper::ARRAY_TYPE + || $type == StringMapper::OBJECT_TYPE + ) { + + $prop->setId($id); + + foreach ($property as $key => $p) { + $def = $this->determineProperty($p, $prop->getId() ? $prop->getId().'/'.$key : null); + ($type == StringMapper::OBJECT_TYPE) ? $prop->setProperty($key, $def) : $prop->addItem($def); + if (in_array($key, $this->config['schema_required_field_names'], true)) { + $def->setRequired(true); + } + } + } + + return $prop; + } + + + /** + * after a successful parse we want to return the json of the Schema + * it should probably be compressed string + * they can beautify it later or maybe we will need to add a beauty function + * + * @return string $json + */ + public function json() + { + return $this->schemaObject->toString(); + } +} diff --git a/src/JSONSchema/Parsers/JSONStringParser.php b/src/JSONSchema/Parsers/JSONStringParser.php deleted file mode 100644 index 04e4aa7..0000000 --- a/src/JSONSchema/Parsers/JSONStringParser.php +++ /dev/null @@ -1,128 +0,0 @@ -subject; - } - - if (!$jsonObj = json_decode($subject)) { - throw new Exceptions\UnprocessableSubjectException( - "The JSONString subject was not processable - decode failed " - ); - } - - $this->loadObjectProperties($jsonObj); - $this->loadSchema(); - - return $this; - } - - /** - * top level - * every recurse under this will add to the properties of the property - * - * @param array $jsonObj - */ - protected function loadObjectProperties($jsonObj) - { - // start walking the object - foreach ($jsonObj as $key => $property) { - $this->appendProperty($key, $this->determineProperty($property)); - } - } - - - /** - * due to the fact that determining property will be so different between - * parser types we should probably just define this function here - * In a JSON string it will be very simple. - * enter a string - * see what the string looks like - * check the maps of types - * see if it fits some semantics - * - * @param mixed $property - * @return Definition - */ - protected function determineProperty($property, $id = null) - { - $baseUrl = $this->configKeyExists('baseUrl') ? $this->getConfigSetting('baseUrl') : null; - $requiredDefault = $this->configKeyExists('requiredDefault') ? $this->getConfigSetting( - 'requiredDefault' - ) : false; - - $type = StringMapper::map($property); - - $prop = new Definition(); - $prop->setType($type) - ->setRequired($requiredDefault); - - /* - since this is an object get the properties of the sub objects - */ - if ( $type == StringMapper::ARRAY_TYPE - || $type == StringMapper::OBJECT_TYPE - ) { - - $prop->setId($id); - - foreach ($property as $key => $p) { - $def = $this->determineProperty($p, $prop->getId() ? $prop->getId().'/'.$key : null); - ($type == StringMapper::OBJECT_TYPE) ? $prop->setProperty($key, $def) : $prop->addItem($def); - } - } - - return $prop; - } - - - /** - * @param string $name - * @param mixed $item - */ - protected function stackItemFields($name, $item) - { - // for non-loopables - if (!is_array($item) && !is_object($item)) { - return; - } - foreach ($item as $key => $val) { - $this->itemFields[$name][$key] = $val; - } - } - - -} diff --git a/src/JSONSchema/Parsers/Parser.php b/src/JSONSchema/Parsers/Parser.php deleted file mode 100644 index 7fa24f3..0000000 --- a/src/JSONSchema/Parsers/Parser.php +++ /dev/null @@ -1,246 +0,0 @@ -subject = $subject; - if(isset($config['isJSONObject'])) - $this->isJSONObject = $config['isJSONObject']; - - $this->config = $config; - $this->initSchema(); - } - - /** - * TODO implement this function - make sure we check the params - * @param array $config - * @return $this - */ - public function loadConfig(array $config) - { - $this->config = $config; - $this->initSchema(); - return $this; - } - - /** - * TODO need to add some value to this - * @return boolean - */ - public function validateSchemaConfigVariables() - { - return true; - } - - - /** - * @param string $key - */ - public function getConfigSetting($key) - { - if(!isset($this->config[$key]) || !is_string($key)) - throw new InvalidConfigItemException("They key: $key is not set "); - - return $this->config[$key]; - } - - /** - * @param string $key - * @return boolean - */ - public function configKeyExists($key) - { - return isset($this->config[$key]); - } - - /** - * abstract function for parsing - * A few concepts we will define here - * Lets assume that it's a JSON Object type that it will end up - * Properties rather than Items - * - * @abstract - * @param mixed $subject - */ - public function parse($subject=null){} - - /** - * - */ - public function initSchema() - { - $this->schemaObject = new Schema(); - $this->loadSchema(); - } - - /** - * @param mixed $subject - * @return $this - */ - public function setSubject($subject) - { - $this->subject = $subject; - return $this; - } - - /** - * @return $subject - */ - public function getSubject() - { - return $this->subject; - } - - /** - * providing an empty array to blow out settings - * @param array $requiredFields - * @return $this - */ - public function setConfigSchemaRequiredFields(array $requiredFields) - { - $this->configSchemaRequiredFields = array_merge($this->configSchemaRequiredFields,$requiredFields); - return $this; - } - - /** - * @return array - */ - public function getConfigSchemaRequiredFields() - { - return $this->configSchemaRequiredFields; - } - - /** - * @param string $key - * @param Definition $property - * @return $this - */ - protected function appendProperty($key, Definition $property) - { - if (!isset($this->schemaObject)) { - throw new NoStructureFoundException("The Schema is not attached or is not initialized. "); - } - - if (in_array($property->getType(), [StringMapper::ARRAY_TYPE, StringMapper::OBJECT_TYPE], true)) { - $property->setId($this->schemaObject->getId() ? $this->schemaObject->getId().'/'.$key : null); - } - - $this->schemaObject->setProperty($key, $property); - return $this; - } - - /** - * @param string $key - * @param Definition $item - * @return $this - */ - protected function appendItem($key, Definition $item) - { - if (!isset($this->schemaObject)) { - throw new NoStructureFoundException("The Schema is not attached or is not initialized. "); - } - - $this->schemaObject->addItem($item); - return $this; - } - - /** - * basically set up the schema object with the properties - * provided in the config - * most items are defaulted as they are probably domain specific - * - * @throws InvalidConfigItemException - */ - protected function loadSchema() - { - if(!$this->validateSchemaConfigVariables()) - throw new InvalidConfigItemException("The provided config does not fill the Schema properly "); - - // namespace is schema_ - // try to set all the variables for the schema from the supplied config - if(isset($this->config['schema_dollarSchema'])) - $this->schemaObject->setDollarSchema($this->config['schema_dollarSchema']); - - if(isset($this->config['schema_required'])) - $this->schemaObject->setRequired($this->config['schema_required']); - - if(isset($this->config['schema_title'])) - $this->schemaObject->setTitle($this->config['schema_title']); - - if(isset($this->config['schema_description'])) - $this->schemaObject->setDescription($this->config['schema_description']); - - if(isset($this->config['schema_type'])) - $this->schemaObject->setType($this->config['schema_type']); - - return $this; - } - - /** - * after a successful parse we want to return the json of the Schema - * it should probably be compressed string - * they can beautify it later or maybe we will need to add a beauty function - * - * @return string $json - */ - public function json() - { - return $this->schemaObject->toString(); - } -} diff --git a/src/JSONSchema/Structure/Definition.php b/src/JSONSchema/Structure/Definition.php index 35d2e04..aaca5a4 100644 --- a/src/JSONSchema/Structure/Definition.php +++ b/src/JSONSchema/Structure/Definition.php @@ -15,6 +15,10 @@ class Definition implements \JsonSerializable { + + const ITEMS_AS_COLLECTION = 0; // use anyOf instead of strict collection + const ITEMS_AS_LIST = 1; + /** * link to the resource identifier * @@ -90,6 +94,10 @@ class Definition implements \JsonSerializable */ protected $enum = null; + /** + * @var int items collection mode, convert a list of various schema using anyOf or strict positionnal list of schema + */ + protected $collectionMode = 0; /** * setup default values @@ -275,19 +283,23 @@ public function setItems($properties) } /** - * @param Definition $value + * @param Definition $def * @return $this */ - public function addItem(Definition $value) + public function addItem(Definition $def) { + if ($this->getCollectionMode() === self::ITEMS_AS_COLLECTION) { + $def->setId(null); // make schema anonymous + } + foreach ($this->items as $i) { - if ($i->equals($value)) { - // item already in list + if ($this->getCollectionMode() === self::ITEMS_AS_COLLECTION && $i->equals($def)) { + // item schema type already in list return $this; } } - $this->items[] = $value; + $this->items[] = $def; return $this; } @@ -356,15 +368,13 @@ public function flatten() $fa->id = $this->getId(); } - - $fa->type = $this->getType(); if ($this->getTitle()) { $fa->title = $this->getTitle(); } - if (!empty($this->description)) { + if ($this->getDescription()) { $fa->description = $this->getDescription(); } @@ -379,23 +389,37 @@ public function flatten() } } + /* + * If a default value had been set + */ if (!$this->defaultValue instanceof UndefinedValue) { $fa->default = $this->defaultValue; } if ($this->getType() === StringMapper::ARRAY_TYPE) { + // add the items $items = []; foreach ($this->getItems() as $key => $item) { $items[] = $item->flatten(); } - $fa->items = new \StdClass(); - $fa->items->anyOf = $items; + + if ($this->getCollectionMode() == self::ITEMS_AS_LIST) { + $fa->items = $items; + } else { + // collection of various schema using 'anyOf' + $fa->items = new \StdClass(); + $fa->items->anyOf = $items; + } } else if ($this->getType() === StringMapper::OBJECT_TYPE) { + + + if ($this->getRequireds()) { $fa->required = $this->getRequireds(); } + if ($this->getProperties()) { $fa->properties = new \StdClass(); foreach ($this->getProperties() as $key => $property) { @@ -407,6 +431,27 @@ public function flatten() return $fa; } + /** + * @return int + */ + public function getCollectionMode() + { + return $this->collectionMode; + } + + /** + * @param int $collectionMode + * @return Definition + */ + public function setCollectionMode($collectionMode) + { + $this->collectionMode = $collectionMode; + + return $this; + } + + + /** * @return \stdClass */ diff --git a/src/JSONSchema/Structure/Schema.php b/src/JSONSchema/Structure/Schema.php index 68b5f97..c839338 100644 --- a/src/JSONSchema/Structure/Schema.php +++ b/src/JSONSchema/Structure/Schema.php @@ -16,7 +16,7 @@ class Schema extends Definition /** * @var string */ - protected $dollarSchema = 'http://json-schema.org/draft-04/schema#'; + protected $dollarSchema = 'http://json-schema.org/draft-04/schema#'; /** * the ID is a string reference to the resource that is identified in this document @@ -76,5 +76,21 @@ public function flatten() return $def; } + /** + * @return string + */ + public function getDollarSchema() + { + return $this->dollarSchema; + } + + /** + * @param string $dollarSchema + */ + public function setDollarSchema($dollarSchema) + { + $this->dollarSchema = $dollarSchema; + } + } \ No newline at end of file diff --git a/tests/JSONSchema/Tests/GeneratorTest.php b/tests/JSONSchema/Tests/GeneratorTest.php index c934dcb..4d41fbf 100644 --- a/tests/JSONSchema/Tests/GeneratorTest.php +++ b/tests/JSONSchema/Tests/GeneratorTest.php @@ -3,6 +3,7 @@ use JSONSchema\Parsers\JSONStringParser; use JSONSchema\Generator; +use JSONSchema\Structure\Definition; use JsonSchema\Validator; /** @@ -43,15 +44,8 @@ public function testGeneration($file) $json = file_get_contents($file); $schema = Generator::fromJson($json); - - $this->assertTrue(!!$schema); -// print_r([ -// "schema" => json_encode(json_decode($result), JSON_PRETTY_PRINT), -// 'json' => $json, -// ]); - /* * Validate schema regarding the spec */ @@ -74,9 +68,13 @@ public function testGeneration($file) */ public function testCanParseSimple() { - $result = Generator::fromJson($this->addressJson1); + $result = Generator::fromJson($this->addressJson1, [ + 'schema_id' => 'http://foo.bar/schema' + ]); $decoded = json_decode($result); + print_r(json_encode($decoded, JSON_PRETTY_PRINT)); + $this->assertTrue(is_object($decoded)); $this->assertTrue(isset($decoded->{'$schema'})); $this->assertTrue(isset($decoded->properties)); @@ -89,18 +87,21 @@ public function testCanParseSimple() $this->assertCount(1, $decoded->properties->phoneNumber->items->anyOf); } - /** * the most basic functionality */ public function testCanParseExample2() { - $result = Generator::fromJson($this->addressJson2); - + $result = Generator::fromJson($this->addressJson2, [ + 'schema_id' => "http://foo.bar" + ]); // most of the same tests as example 1 $this->assertTrue(is_string($result)); $decoded = json_decode($result); + + print_r(json_encode($decoded, JSON_PRETTY_PRINT)); + $this->assertTrue(is_object($decoded)); $this->assertTrue(is_string($decoded->{'$schema'})); $this->assertTrue(isset($decoded->properties)); @@ -116,8 +117,46 @@ public function testCanParseExample2() $this->assertCount(3, $decoded->properties->phoneNumber->items->anyOf); $this->assertTrue(isset($decoded->properties->test)); $this->assertEquals($decoded->properties->test->type,'string'); - $this->assertEquals($decoded->properties->phoneNumber->id,'http://jsonschema.net/phoneNumber'); + $this->assertEquals($decoded->properties->phoneNumber->id,'http://foo.bar/phoneNumber'); } - + + + + /** + * the most basic functionality + * simple tests to just show it's working + */ + public function testCanParseStrictModeList() + { + $result = Generator::fromJson($this->addressJson2, [ + 'schema_id' => 'http://bar.foo/schema2', + 'schema_title' => 'coucouc', + 'schema_description' => 'desc', +// 'schema_type' => 'mytype', + "items_schema_collect_mode" => Definition::ITEMS_AS_LIST, + ]); + + // most of the same tests as example 1 + $this->assertTrue(is_string($result)); + $decoded = json_decode($result); + + $this->assertTrue(is_object($decoded)); + $this->assertTrue(is_string($decoded->{'$schema'})); + $this->assertTrue(isset($decoded->properties)); + $this->assertTrue(isset($decoded->properties->bar)); + $this->assertTrue(isset($decoded->properties->bar->properties->barAddress)); + $this->assertTrue(isset($decoded->properties->bar->properties->city)); + $this->assertTrue(isset($decoded->properties->address)); + $this->assertTrue(isset($decoded->properties->address->type)); + $this->assertEquals($decoded->properties->address->type, 'object'); + $this->assertTrue(isset($decoded->properties->phoneNumber)); + $this->assertEquals($decoded->properties->phoneNumber->type,'array'); + $this->assertTrue(is_array($decoded->properties->phoneNumber->items)); + $this->assertCount(4, $decoded->properties->phoneNumber->items); + $this->assertTrue(isset($decoded->properties->test)); + $this->assertEquals($decoded->properties->test->type,'string'); + $this->assertEquals($decoded->properties->phoneNumber->id,'http://bar.foo/schema2/phoneNumber'); + + } } \ No newline at end of file diff --git a/tests/JSONSchema/Tests/Parsers/ArrayObjectParserTest.php b/tests/JSONSchema/Tests/Parsers/ArrayObjectParserTest.php deleted file mode 100644 index e69de29..0000000 diff --git a/tests/JSONSchema/Tests/Parsers/ArrayParserTest.php b/tests/JSONSchema/Tests/Parsers/ArrayParserTest.php deleted file mode 100644 index 203e495..0000000 --- a/tests/JSONSchema/Tests/Parsers/ArrayParserTest.php +++ /dev/null @@ -1,29 +0,0 @@ - Date: Tue, 15 Aug 2017 16:23:42 +0200 Subject: [PATCH 09/28] update travis config & composer packages --- .travis.yml | 2 - composer.json | 2 +- composer.lock | 1042 +++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 969 insertions(+), 77 deletions(-) diff --git a/.travis.yml b/.travis.yml index 76572d9..3e41fae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,9 @@ language: php php: - - 5.5 - 5.6 - 7.0 - 7.1 - - hhvm matrix: diff --git a/composer.json b/composer.json index bd154e3..d7f11b0 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "satooshi/php-coveralls": "^1.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*", + "phpunit/phpunit": "5.7.*", "league/json-guard": "^1.0", "league/json-reference": "^1.0" }, diff --git a/composer.lock b/composer.lock index f80e948..4482979 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e0d2047c1c8a016f2591ea9681529f7f", - "content-hash": "c7e9fa8fa672eeba9d68195bf0e12cf7", + "hash": "90fb05ba83ef606683a9531a0f614c3b", + "content-hash": "65d7f404a6f52d47727d6b37338a5049", "packages": [ { "name": "guzzle/guzzle", @@ -614,25 +614,31 @@ }, { "name": "symfony/yaml", - "version": "v2.8.26", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5" + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", - "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -659,10 +665,64 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-06-01 20:52:29" + "time": "2017-07-23 12:43:26" } ], "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, { "name": "league/json-guard", "version": "1.0.1", @@ -785,48 +845,301 @@ ], "time": "2017-04-29 23:08:31" }, + { + "name": "myclabs/deep-copy", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-04-12 18:52:22" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.3.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-08-08 06:39:58" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-06-03 08:32:36" + }, + { + "name": "phpspec/prophecy", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2017-03-02 20:05:34" + }, { "name": "phpunit/php-code-coverage", - "version": "1.2.18", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", - "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.0@stable", - "phpunit/php-text-template": ">=1.2.0@stable", - "phpunit/php-token-stream": ">=1.1.3,<1.3.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*@dev" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.0.5" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -844,7 +1157,7 @@ "testing", "xunit" ], - "time": "2014-09-02 10:13:14" + "time": "2017-04-02 07:44:40" }, { "name": "phpunit/php-file-iterator", @@ -985,45 +1298,44 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.2.2", + "version": "1.4.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.4-dev" } }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], "description": "Wrapper around PHP's tokenizer extension.", @@ -1031,62 +1343,71 @@ "keywords": [ "tokenizer" ], - "time": "2014-03-03 05:10:30" + "time": "2017-02-27 10:12:30" }, { "name": "phpunit/phpunit", - "version": "3.7.38", + "version": "5.7.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" + "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", - "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b91adfb64264ddec5a2dee9851f354aa66327db", + "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db", "shasum": "" }, "require": { - "ext-ctype": "*", "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": "~1.2", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.1", - "phpunit/php-timer": "~1.0", - "phpunit/phpunit-mock-objects": "~1.2", - "symfony/yaml": "~2.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0.3|~2.0", + "symfony/yaml": "~2.1|~3.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" }, "require-dev": { - "pear-pear.php.net/pear": "1.9.4" + "ext-pdo": "*" }, "suggest": { + "ext-xdebug": "*", "phpunit/php-invoker": "~1.1" }, "bin": [ - "composer/bin/phpunit" + "phpunit" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7.x-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], "license": [ "BSD-3-Clause" ], @@ -1098,45 +1419,55 @@ } ], "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", + "homepage": "https://phpunit.de/", "keywords": [ "phpunit", "testing", "xunit" ], - "time": "2014-10-17 09:04:17" + "time": "2017-06-21 08:11:54" }, { "name": "phpunit/phpunit-mock-objects", - "version": "1.2.3", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", - "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-text-template": ">=1.1.1@stable" + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" }, "suggest": { "ext-soap": "*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -1153,7 +1484,7 @@ "mock", "xunit" ], - "time": "2013-01-13 10:24:48" + "time": "2017-06-30 09:13:00" }, { "name": "psr/container", @@ -1302,6 +1633,569 @@ "url" ], "time": "2017-02-20 19:59:28" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04 06:30:41" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29 09:50:25" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22 07:24:03" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26 07:53:53" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-11-19 08:54:04" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12 03:26:01" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18 15:18:39" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19 07:33:16" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28 20:34:47" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03 07:35:21" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23 20:04:58" } ], "aliases": [], From 7701813bcaa889ff6fdbb5ec4d22b078dafb7a0b Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 10:26:05 +0200 Subject: [PATCH 10/28] fix PH7.1 travis error --- .travis.yml | 3 ++- composer.json | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e41fae..a712a04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,8 @@ language: php php: - 5.6 - 7.0 - - 7.1 +# disable since phpunit break +# - 7.1 matrix: diff --git a/composer.json b/composer.json index d7f11b0..053dfc4 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.4.0", + "php": ">=5.6.0", "satooshi/php-coveralls": "^1.0" }, "require-dev": { @@ -29,5 +29,10 @@ "JSONSchema\\Tests": "tests/", "JSONSchema": "src/" } + }, + "scripts": { + "tests": [ + "php vendor/phpunit/phpunit/phpunit" + ] } } From 6320a7fb76257c88ba4bea4a6be21ea60a22134e Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 10:26:52 +0200 Subject: [PATCH 11/28] use composer test command instead of hitting directly the phpunit executable --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a712a04..efebfda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,4 @@ install: script: - mkdir -p build/logs - - phpunit - - -#after_script: -# - php vendor/bin/coveralls -v \ No newline at end of file + - composer test From 0a6a42db41cd761f436790e5934841b636172554 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 10:42:03 +0200 Subject: [PATCH 12/28] Rename classes to fit package name --- .travis.yml | 3 +-- composer.json | 6 ++--- phpunit.xml | 24 +++++++++---------- src/JSONSchema/Mappers/StringMapper.php | 16 ------------- .../Generator.php | 4 ++-- .../Exceptions/UnmappableException.php | 4 ++-- .../Mappers/PropertyTypeMapper.php | 6 ++--- .../Mappers/StringMapper.php | 16 +++++++++++++ .../Parsers/BaseParser.php | 14 +++++------ .../Exceptions/InvalidConfigItemException.php | 4 ++-- .../Exceptions/InvalidParamException.php | 4 ++-- .../Exceptions/NoParserFoundException.php | 2 +- .../Exceptions/NoStructureFoundException.php | 2 +- .../Parsers/Exceptions/ParseException.php | 4 ++-- .../Exceptions/UnmappableException.php | 4 ++-- .../UnprocessableSubjectException.php | 4 ++-- .../Structure/Definition.php | 8 +++---- .../Exceptions/OverwriteKeyException.php | 4 ++-- .../Structure/Schema.php | 4 ++-- .../Structure/UndefinedValue.php | 4 ++-- .../Tests/GeneratorTest.php | 10 ++++---- .../Tests/JSONSchemaTestCase.php | 4 ++-- tests/bootstrap.php | 6 ++--- 23 files changed, 77 insertions(+), 80 deletions(-) delete mode 100644 src/JSONSchema/Mappers/StringMapper.php rename src/{JSONSchema => JSONSchemaGenerator}/Generator.php (90%) rename src/{JSONSchema => JSONSchemaGenerator}/Mappers/Exceptions/UnmappableException.php (73%) rename src/{JSONSchema => JSONSchemaGenerator}/Mappers/PropertyTypeMapper.php (95%) create mode 100644 src/JSONSchemaGenerator/Mappers/StringMapper.php rename src/{JSONSchema => JSONSchemaGenerator}/Parsers/BaseParser.php (94%) rename src/{JSONSchema => JSONSchemaGenerator}/Parsers/Exceptions/InvalidConfigItemException.php (72%) rename src/{JSONSchema => JSONSchemaGenerator}/Parsers/Exceptions/InvalidParamException.php (73%) rename src/{JSONSchema => JSONSchemaGenerator}/Parsers/Exceptions/NoParserFoundException.php (83%) rename src/{JSONSchema => JSONSchemaGenerator}/Parsers/Exceptions/NoStructureFoundException.php (83%) rename src/{JSONSchema => JSONSchemaGenerator}/Parsers/Exceptions/ParseException.php (58%) rename src/{JSONSchema => JSONSchemaGenerator}/Parsers/Exceptions/UnmappableException.php (60%) rename src/{JSONSchema => JSONSchemaGenerator}/Parsers/Exceptions/UnprocessableSubjectException.php (74%) rename src/{JSONSchema => JSONSchemaGenerator}/Structure/Definition.php (97%) rename src/{JSONSchema => JSONSchemaGenerator}/Structure/Exceptions/OverwriteKeyException.php (74%) rename src/{JSONSchema => JSONSchemaGenerator}/Structure/Schema.php (95%) rename src/{JSONSchema => JSONSchemaGenerator}/Structure/UndefinedValue.php (58%) rename tests/{JSONSchema => JSONSchemaGenerator}/Tests/GeneratorTest.php (95%) rename tests/{JSONSchema => JSONSchemaGenerator}/Tests/JSONSchemaTestCase.php (92%) diff --git a/.travis.yml b/.travis.yml index efebfda..cf35294 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,7 @@ language: php php: - 5.6 - 7.0 -# disable since phpunit break -# - 7.1 + - 7.1 matrix: diff --git a/composer.json b/composer.json index 053dfc4..947a863 100644 --- a/composer.json +++ b/composer.json @@ -25,9 +25,9 @@ "league/json-reference": "^1.0" }, "autoload": { - "psr-0": { - "JSONSchema\\Tests": "tests/", - "JSONSchema": "src/" + "psr-4": { + "JSONSchemaGenerator\\Tests\\": "tests/JSONSchemaGenerator/Tests/", + "JSONSchemaGenerator\\": "src/JSONSchemaGenerator/" } }, "scripts": { diff --git a/phpunit.xml b/phpunit.xml index 63dac46..eb60248 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -10,22 +10,22 @@ testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"> - - ./tests/JSONSchema + + ./tests/JSONSchemaGenerator - - - - - - - - ./src/JSONSchema + + ./src/JSONSchemaGenerator + ./vendor + ./Tests - - + + + + + + \ No newline at end of file diff --git a/src/JSONSchema/Mappers/StringMapper.php b/src/JSONSchema/Mappers/StringMapper.php deleted file mode 100644 index 4657523..0000000 --- a/src/JSONSchema/Mappers/StringMapper.php +++ /dev/null @@ -1,16 +0,0 @@ -assertEquals($expected, \JSONSchema\Generator::fromJson('{"a":{"b":2}}')); + $this->assertEquals($expected, \JSONSchemaGenerator\Generator::fromJson('{"a":{"b":2}}')); } /** diff --git a/tests/JSONSchema/Tests/JSONSchemaTestCase.php b/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php similarity index 92% rename from tests/JSONSchema/Tests/JSONSchemaTestCase.php rename to tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php index fe4fb4d..bb349ce 100644 --- a/tests/JSONSchema/Tests/JSONSchemaTestCase.php +++ b/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php @@ -1,8 +1,8 @@ Date: Wed, 16 Aug 2017 11:56:04 +0200 Subject: [PATCH 13/28] Add docs & some additionnals tests. --- README.md | 71 +++++++++++++- .../Structure/Definition.php | 2 +- .../Tests/GeneratorTest.php | 98 +++++++++++++++---- .../Tests/JSONSchemaTestCase.php | 50 ++++++++-- 4 files changed, 191 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 76198b3..25655f4 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ PHP JSON Schema Generator ## Quickstart -Can't be easier +Most simple case - - $output = JSONSchema\Generator::fromJson('{"a":{"b":2}'); + $output = JSONSchemaGenerator\Generator::fromJson('{"a":{"b":2}'); + // $output ==> json string // { // "$schema": "http://json-schema.org/draft-04/schema#", @@ -30,6 +30,71 @@ Can't be easier // } // } +Default configuration values + + [ + 'schema_id' => null, + 'properties_required_by_default' => true, + 'schema_uri' => 'http://json-schema.org/draft-04/schema#', + 'schema_title' => null, + 'schema_description' => null, + 'schema_type' => null, + "items_schema_collect_mode" => 0, + 'schema_required_field_names' => [] + ] + +Advanced usage + + $result = Generator::fromJson($this->addressJson1, [ + 'schema_id' => 'http://foo.bar/schema' + ]); + + /* + + { + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "http://foo.bar/schema", + "type": "object", + "properties": { + "a": { + "type": "object", + "id": "http://foo.bar/schema/a", + "properties": { + "b": { + "id": "http://foo.bar/schema/a/b", + "type": "integer" + } + } + } + } + + */ + + + // if you want items as strict lists instead of "anyOf" type + $result = Generator::fromJson($this->addressJson1, [ + 'schema_id' => 'http://bar.foo/schema2', + 'schema_title' => 'coucouc', + 'schema_description' => 'desc', + "items_schema_collect_mode" => Definition::ITEMS_AS_LIST, + ]); + + /* + { + "$schema":"http:\/\/json-schema.org\/draft-04\/schema#", + ... + "properties": { + "phoneNumber":{ + "id":"http:\/\/bar.foo\/schema2\/phoneNumber", + "type":"array", + "items": [ + {"id":"http:\/\/bar.foo\/schema2\/0",...}, + {"id":"http:\/\/bar.foo\/schema2\/1",...}} + */ + + +For more advanced usage, see `tests/JSONSchemaGenerator/Tests/GeneratorTest.php` + ## About JSON Schema diff --git a/src/JSONSchemaGenerator/Structure/Definition.php b/src/JSONSchemaGenerator/Structure/Definition.php index 93960a8..5a7b570 100644 --- a/src/JSONSchemaGenerator/Structure/Definition.php +++ b/src/JSONSchemaGenerator/Structure/Definition.php @@ -316,6 +316,7 @@ public function getRequireds() $requireds[] = $name; } } + return $requireds; } /** @@ -415,7 +416,6 @@ public function flatten() } else if ($this->getType() === StringMapper::OBJECT_TYPE) { - if ($this->getRequireds()) { $fa->required = $this->getRequireds(); } diff --git a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php index 87fee55..d3186fc 100644 --- a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php +++ b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php @@ -32,8 +32,11 @@ public function provideJsonSamples() public function testBasics() { - $expected = '{"$schema":"http:\/\/json-schema.org\/draft-04\/schema#","type":"object","properties":{"a":{"type":"object","properties":{"b":{"type":"integer"}}}}}'; - $this->assertEquals($expected, \JSONSchemaGenerator\Generator::fromJson('{"a":{"b":2}}')); + $input = '{"a":{"b":2}}'; + $res = \JSONSchemaGenerator\Generator::fromJson($input); + $expected = '{"$schema":"http:\/\/json-schema.org\/draft-04\/schema#","type":"object","required":["a"],"properties":{"a":{"type":"object","required":["b"],"properties":{"b":{"type":"integer"}}}}}'; + $this->assertEquals($expected, $res); + $this->validateSchemaAgainst($res, $input); } /** @@ -46,19 +49,7 @@ public function testGeneration($file) $this->assertTrue(!!$schema); - /* - * Validate schema regarding the spec - */ - $dereferencer = \League\JsonReference\Dereferencer::draft4(); - $jsonSchemaSchema = $dereferencer->dereference('http://json-schema.org/draft-04/schema#'); - $validator = new \League\JsonGuard\Validator(json_decode($schema), json_decode(file_get_contents(__DIR__.'/../../json-schema.draft4.json'))); - $this->assertFalse($validator->fails(), 'should validate that the schema is a valid json schema draft 4'); - - /* - * Validate input regarding generated schema - */ - $validator = new \League\JsonGuard\Validator(json_decode($json), json_decode($schema)); - $this->assertFalse($validator->fails(), 'should validate that the given schema ' . $schema . ' validate the input : ' . $json); + $this->validateSchemaAgainst($schema, $json); } @@ -71,9 +62,12 @@ public function testCanParseSimple() $result = Generator::fromJson($this->addressJson1, [ 'schema_id' => 'http://foo.bar/schema' ]); + + $this->debug($result); + $decoded = json_decode($result); - print_r(json_encode($decoded, JSON_PRETTY_PRINT)); + $this->validateSchemaAgainst($result, $this->addressJson1); $this->assertTrue(is_object($decoded)); $this->assertTrue(isset($decoded->{'$schema'})); @@ -86,6 +80,7 @@ public function testCanParseSimple() $this->assertTrue(is_array($decoded->properties->phoneNumber->items->anyOf)); $this->assertCount(1, $decoded->properties->phoneNumber->items->anyOf); + } /** @@ -96,11 +91,17 @@ public function testCanParseExample2() $result = Generator::fromJson($this->addressJson2, [ 'schema_id' => "http://foo.bar" ]); + + $this->validateSchemaAgainst($result, $this->addressJson2); + // most of the same tests as example 1 $this->assertTrue(is_string($result)); + + $this->debug($result); + $decoded = json_decode($result); - print_r(json_encode($decoded, JSON_PRETTY_PRINT)); + $this->debug(json_encode($decoded, JSON_PRETTY_PRINT)); $this->assertTrue(is_object($decoded)); $this->assertTrue(is_string($decoded->{'$schema'})); @@ -133,10 +134,13 @@ public function testCanParseStrictModeList() 'schema_id' => 'http://bar.foo/schema2', 'schema_title' => 'coucouc', 'schema_description' => 'desc', -// 'schema_type' => 'mytype', "items_schema_collect_mode" => Definition::ITEMS_AS_LIST, ]); + $this->debug($result); + + $this->validateSchemaAgainst($result, $this->addressJson2); + // most of the same tests as example 1 $this->assertTrue(is_string($result)); $decoded = json_decode($result); @@ -159,4 +163,62 @@ public function testCanParseStrictModeList() $this->assertEquals($decoded->properties->phoneNumber->id,'http://bar.foo/schema2/phoneNumber'); } + + + public function testRequiredProperties() + { + $result = Generator::fromJson($this->addressJson2); + + $this->validateSchemaAgainst($result, $this->addressJson2); + + $this->assertTrue(is_string($result)); + $decoded = json_decode($result); + + $this->debug($result); + + $this->assertCount(4, $decoded->required, 'should have required properties'); + $this->assertCount(2, $decoded->properties->bar->required, 'sub selements should have required properties'); + + $result = Generator::fromJson($this->addressJson2, [ + 'properties_required_by_default' => false, + ]); + + $this->validateSchemaAgainst($result, $this->addressJson2); + + $this->assertTrue(is_string($result)); + $decoded = json_decode($result); + $this->assertTrue(!isset($decoded->required), 'should not have the required property'); + $this->assertTrue(!isset($decoded->properties->bar->required), 'sub definitions should not have the required property also'); + + $result = Generator::fromJson($this->addressJson2, [ + 'properties_required_by_default' => false, + 'schema_required_field_names' => ['barAddress'], // just make this field required + ]); + + $this->validateSchemaAgainst($result, $this->addressJson2); + + $this->assertTrue(is_string($result)); + $decoded = json_decode($result); + + $this->assertTrue(!isset($decoded->required), 'should only have the required property for one def'); + $this->assertTrue(!isset($decoded->properties->address->required), 'should only have the required property for one def'); + $this->assertCount(1, $decoded->properties->bar->required, 'One prop only should be required'); + $this->assertContains("barAddress", $decoded->properties->bar->required, '"barAddress", Should be required'); + + $this->debug($decoded); + } + + + + /** + * display output only if getenv('DEBUG') is set + */ + protected function debug() + { + if (getenv('DEBUG')) { + foreach (func_get_args() as $a) { + is_scalar($a) ? var_dump($a) : print_r($a); + } + } + } } \ No newline at end of file diff --git a/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php b/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php index bb349ce..114358f 100644 --- a/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php +++ b/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php @@ -11,19 +11,19 @@ abstract class JSONSchemaTestCase extends \PHPUnit_Framework_TestCase { /** * simple address object found on json-schema - * + * * @var string */ protected $addressJson1; - + /** * little more complex version of the 1st address problem * @var string */ protected $addressJson2; - + /** - * list of the parser types + * list of the parser types */ protected $parsers = array(); @@ -34,12 +34,46 @@ public function getDataPath() } /** - * since we will probably use the example.address.json data all over the place lets go ahead and load it up - * + * since we will probably use the example.address.json data all over the place lets go ahead and load it up + * */ public function setup() { - $this->addressJson1 = json_encode(json_decode(file_get_contents($this->getDataPath().'/example.address1.json')), JSON_PRETTY_PRINT); - $this->addressJson2 = json_encode(json_decode(file_get_contents($this->getDataPath().'/example.address2.json')), JSON_PRETTY_PRINT); + $this->addressJson1 = json_encode( + json_decode(file_get_contents($this->getDataPath().'/example.address1.json')), + JSON_PRETTY_PRINT + ); + $this->addressJson2 = json_encode( + json_decode(file_get_contents($this->getDataPath().'/example.address2.json')), + JSON_PRETTY_PRINT + ); + } + + + /** + * @param string $schema + * @param string $inputJson + */ + protected function validateSchemaAgainst($schema, $inputJson) + { + /* + * Validate schema regarding the spec + */ + $dereferencer = \League\JsonReference\Dereferencer::draft4(); + $jsonSchemaSchema = $dereferencer->dereference('http://json-schema.org/draft-04/schema#'); + $validator = new \League\JsonGuard\Validator( + json_decode($schema), + json_decode(file_get_contents(__DIR__.'/../../json-schema.draft4.json')) + ); + $this->assertFalse($validator->fails(), 'should validate that the schema is a valid json schema draft 4'); + + /* + * Validate input regarding generated schema + */ + $validator = new \League\JsonGuard\Validator(json_decode($inputJson), json_decode($schema)); + $this->assertFalse( + $validator->fails(), + 'should validate that the given schema '.$schema.' validate the input : '.$inputJson + ); } } From f64e70d1e9801122668040ef0a6931064a42950f Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 12:02:34 +0200 Subject: [PATCH 14/28] Add docs & travis build badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25655f4..ff31e2d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PHP JSON Schema Generator ====================== -[![Build Status](https://secure.travis-ci.org/solvire/php-json-schema-generator.png)](http://travis-ci.org/solvire/php-json-schema-generator) +![Build Status](https://travis-ci.org/evaisse/php-json-schema-generator#) Package: php-json-schema-generator From 6a6c3745a651a5f0283c95f4e19815fc54d4456d Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 12:16:40 +0200 Subject: [PATCH 15/28] fix docs --- README.md | 69 +++++++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index ff31e2d..fbe672a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,17 @@ # PHP JSON Schema Generator -====================== -![Build Status](https://travis-ci.org/evaisse/php-json-schema-generator#) +![Build Status](https://travis-ci.org/evaisse/php-json-schema-generator.svg?branch=master#) -Package: php-json-schema-generator +PHP JSON Schema Generator, introduction to json schema below : + + - http://json-schema.org + - http://www.jsonschemavalidator.net + - https://www.openapis.org + +To validate your structure against a given schema, you can use : + - http://json-guard.thephpleague.com -PHP JSON Schema Generator ## Quickstart @@ -94,60 +99,22 @@ Advanced usage For more advanced usage, see `tests/JSONSchemaGenerator/Tests/GeneratorTest.php` - - -## About JSON Schema - -JSON has become a mainstay in the vast HTTP toolbox. In order to make JSON more stable and to increase the longevity of the data structure there must be some standards put into place. These standards will help to define the structure in a way that the industry can rely on. A uniform way to parse the data and interpret the meaning of the data elements can be found in building a schema that represents it. - -Due to the flexible nature of JSON a solid Schema definition has been slow coming. At this time there is an internet draft being worked on. -(http://tools.ietf.org/html/draft-zyp-json-schema-04) - -The uses/pros/cons and other discussions related to what a schema can and cannot do for you are beyond the scope of this document. Seek your creativity for possible scenarios. - -## About This Tool - -It is a bit tedious to have to manually write out a JSON Schema every time a new REST point or Data object is created. Because JSON can be used to represent a variety of data objects it can be helpful to have a dynamic way to map from one object to a JSON Schema. A php array is considered an object here for the sake of ease of communication. - -The goal of the tool is to provide an trivial implement for generating a JSON Schema off a wide range of objects. Some objects provide more options for rich schema generation and some do not. JSON itself is very light on metadata so there is a requirement to infer certain meanings based on the structure of the objects. - -### Parser Objects Supported -* JSON string - * Defined [RFC 4627](http://tools.ietf.org/html/rfc4627) - * No validation yet - -### Parsers To Be Supported -* JSON/Schema Object - * Loading the Schema + Properties manually - * Can be built up easier with an API -* Array - * Simple hash - * API to load an array - * Will validate the array structure -* ArrayObject - * Similar to array hash -* Doctrine Entity - * Use the Doctrine 2 infrastructure - * Generate the schema off the doctrine metadata - * Map to DB settings - * Allow map overrides -* Extensible Objects - * Load user defined parsers - * Inherit major functionality + ## Installation + Simple, assuming you use composer. Add the below lines to your composer.json and run composer update. + composer require evaisse/php-json-schema-generator - "require": { - "solvire/php-json-schema-generator": "dev-master" - } ## Testing -PHPUnit should be included with the composer require-dev configuration. The installation will put an -executable in the vendor/bin directly so it can be run from there. -Run: +just run phpunit through + + composer test + +debug with - $ vendor/bin/phpunit + DEBUG=true composer test -- --filter="SearchWord" # for filtering *SearchWord* test case with output debugging From 6d375b8a054a92270273c0b5a07c65decb690012 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 12:24:01 +0200 Subject: [PATCH 16/28] fix doc & better debugging in tests --- README.md | 6 +++-- .../Tests/GeneratorTest.php | 12 ---------- .../Tests/JSONSchemaTestCase.php | 22 +++++++++++++++++++ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index fbe672a..89d9d7c 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,11 @@ Most simple case // "b": { // "type": "integer" // } - // } + // }, + // "required": ["b"] // } - // } + // }, + // "required": ["a"] // } Default configuration values diff --git a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php index d3186fc..752f77d 100644 --- a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php +++ b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php @@ -209,16 +209,4 @@ public function testRequiredProperties() } - - /** - * display output only if getenv('DEBUG') is set - */ - protected function debug() - { - if (getenv('DEBUG')) { - foreach (func_get_args() as $a) { - is_scalar($a) ? var_dump($a) : print_r($a); - } - } - } } \ No newline at end of file diff --git a/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php b/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php index 114358f..5313407 100644 --- a/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php +++ b/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php @@ -56,6 +56,8 @@ public function setup() */ protected function validateSchemaAgainst($schema, $inputJson) { + $this->debug("Schema => $schema", "JSON Struct => $inputJson"); + /* * Validate schema regarding the spec */ @@ -76,4 +78,24 @@ protected function validateSchemaAgainst($schema, $inputJson) 'should validate that the given schema '.$schema.' validate the input : '.$inputJson ); } + + + + /** + * display output only if getenv('DEBUG') is set + */ + protected function debug() + { + if (getenv('DEBUG')) { + foreach (func_get_args() as $a) { + if (is_string($a)) { + empty($a) ? var_dump($a) : print_r($a); + } else if (is_scalar($a)) { + var_dump($a); + } else { + print_r($a); + } + } + } + } } From d5a079fa808e46d7ef7d7b43bdeea0a91d18b340 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 15:39:14 +0200 Subject: [PATCH 17/28] Add custom string formating to be detected if possible --- README.md | 1 + composer.json | 4 +- .../Mappers/StringMapper.php | 136 +++++++++++++++++- .../Parsers/BaseParser.php | 44 +++++- .../Structure/Definition.php | 31 +++- tests/data/example.array.json | 37 +++++ tests/data/example.scalar.json | 1 + 7 files changed, 237 insertions(+), 17 deletions(-) create mode 100644 tests/data/example.array.json create mode 100644 tests/data/example.scalar.json diff --git a/README.md b/README.md index 89d9d7c..5429139 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ PHP JSON Schema Generator, introduction to json schema below : - http://json-schema.org - http://www.jsonschemavalidator.net - https://www.openapis.org + - https://jsonschema.net/#/editor To validate your structure against a given schema, you can use : diff --git a/composer.json b/composer.json index 947a863..3b74c33 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ }, "require-dev": { "phpunit/phpunit": "5.7.*", - "league/json-guard": "^1.0", - "league/json-reference": "^1.0" + "league/json-guard": "1.*", + "league/json-reference": "1.*" }, "autoload": { "psr-4": { diff --git a/src/JSONSchemaGenerator/Mappers/StringMapper.php b/src/JSONSchemaGenerator/Mappers/StringMapper.php index 8c02e47..8bd2ed6 100644 --- a/src/JSONSchemaGenerator/Mappers/StringMapper.php +++ b/src/JSONSchemaGenerator/Mappers/StringMapper.php @@ -1,16 +1,142 @@ $property) { - $this->appendProperty($key, $this->determineProperty($property)); + $type = StringMapper::map($inputVar); + + $this->schemaObject->setType($type); + + if ($type === StringMapper::STRING_TYPE) { + $this->schemaObject->setFormat(StringMapper::guessStringFormat($inputVar)); + } + + /* + * Top level schema is a simple salar value, just stop there + */ + if (!in_array($type, [StringMapper::ARRAY_TYPE, StringMapper::OBJECT_TYPE], true)) { + return $this; + } + + /* + * Top level Schema is an array of an object, continue for deep inspection + */ + foreach ($inputVar as $key => $property) { + $property = $this->determineProperty($property); + + if (in_array($property->getType(), [StringMapper::ARRAY_TYPE, StringMapper::OBJECT_TYPE], true)) { + $property->setId($this->schemaObject->getId() ? $this->schemaObject->getId().'/'.$key : null); + } + + $type == StringMapper::ARRAY_TYPE ? $this->schemaObject->addItem($property) + : $this->schemaObject->setProperty($key, $property); } } @@ -178,6 +202,10 @@ protected function determineProperty($property, $id = null) : Definition::ITEMS_AS_COLLECTION) ->setRequired($requiredDefault); + if ($type === StringMapper::STRING_TYPE) { + $prop->setFormat(StringMapper::guessStringFormat($property)); + } + /* since this is an object get the properties of the sub objects */ @@ -185,6 +213,8 @@ protected function determineProperty($property, $id = null) || $type == StringMapper::OBJECT_TYPE ) { + + $prop->setId($id); foreach ($property as $key => $p) { diff --git a/src/JSONSchemaGenerator/Structure/Definition.php b/src/JSONSchemaGenerator/Structure/Definition.php index 5a7b570..07ead7b 100644 --- a/src/JSONSchemaGenerator/Structure/Definition.php +++ b/src/JSONSchemaGenerator/Structure/Definition.php @@ -1,7 +1,6 @@ description = $this->getDescription(); } - if ($fa->type == PropertyTypeMapper::INTEGER_TYPE || - $fa->type == PropertyTypeMapper::NUMBER_TYPE + if ($fa->type === StringMapper::INTEGER_TYPE || + $fa->type === StringMapper::NUMBER_TYPE ) { if (!empty($this->min)) { $fa->min = $this->getMin(); @@ -389,6 +393,12 @@ public function flatten() $fa->max = $this->getMax(); } } + + if ( $fa->type === StringMapper::STRING_TYPE + && $this->getFormat() + ) { + $fa->format = $this->getFormat(); + } /* * If a default value had been set @@ -450,6 +460,21 @@ public function setCollectionMode($collectionMode) return $this; } + /** + * @return null|string + */ + public function getFormat() + { + return $this->format; + } + + /** + * @param null|string $format + */ + public function setFormat($format) + { + $this->format = $format; + } /** diff --git a/tests/data/example.array.json b/tests/data/example.array.json new file mode 100644 index 0000000..255ccf0 --- /dev/null +++ b/tests/data/example.array.json @@ -0,0 +1,37 @@ +[ + { + "id": 7, + "ip": "127.0.0.1", + "country": "FR", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3", + "saveDate": "2017-07-06 11:51:06" + }, + { + "id": 8, + "ip": "127.0.0.1", + "country": "FR", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko', language='en-us,en;q=0.5", + "saveDate": "2017-07-06 11:52:48" + }, + { + "id": 13, + "ip": "127.0.0.1", + "country": "FR", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3", + "saveDate": "2017-07-06 11:51:06" + }, + { + "id": 14, + "ip": "127.0.0.1", + "country": "FR", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko', language='en-us,en;q=0.5", + "saveDate": "2017-07-06 11:52:48" + }, + { + "id": 19, + "ip": "127.0.0.1", + "country": "FR", + "userAgent": "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko', language='en-us,en;q=0.5", + "saveDate": "2017-07-06 12:01:51" + } +] \ No newline at end of file diff --git a/tests/data/example.scalar.json b/tests/data/example.scalar.json new file mode 100644 index 0000000..c37a24c --- /dev/null +++ b/tests/data/example.scalar.json @@ -0,0 +1 @@ +"my custom string" \ No newline at end of file From 3a131d8a1bd785181455452b94463a5a96cd5759 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 15:59:06 +0200 Subject: [PATCH 18/28] udpate tests --- .travis.yml | 4 + .../Tests/GeneratorTest.php | 14 ++- .../Tests/JSONSchemaTestCase.php | 4 +- .../{example.1.json => example-1.input.json} | 0 tests/data/example-1.schema.json | 64 +++++++++++++ ...ress1.json => example-address1.input.json} | 0 tests/data/example-address1.schema.json | 47 +++++++++ ...ress2.json => example-address2.input.json} | 0 tests/data/example-address2.schema.json | 96 +++++++++++++++++++ ...le.array.json => example-array.input.json} | 10 +- tests/data/example-array.schema.json | 37 +++++++ ....scalar.json => example-scalar.input.json} | 0 tests/data/example-scalar.schema.json | 4 + 13 files changed, 271 insertions(+), 9 deletions(-) rename tests/data/{example.1.json => example-1.input.json} (100%) create mode 100644 tests/data/example-1.schema.json rename tests/data/{example.address1.json => example-address1.input.json} (100%) create mode 100644 tests/data/example-address1.schema.json rename tests/data/{example.address2.json => example-address2.input.json} (100%) create mode 100644 tests/data/example-address2.schema.json rename tests/data/{example.array.json => example-array.input.json} (82%) create mode 100644 tests/data/example-array.schema.json rename tests/data/{example.scalar.json => example-scalar.input.json} (100%) create mode 100644 tests/data/example-scalar.schema.json diff --git a/.travis.yml b/.travis.yml index cf35294..69941ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,3 +19,7 @@ install: script: - mkdir -p build/logs - composer test + + +#after_success: +# - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php index 752f77d..bdfe1b9 100644 --- a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php +++ b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php @@ -23,7 +23,7 @@ public function provideJsonSamples() { $samples = []; $root = $this->getDataPath(); - foreach (glob($root.'/*.json') as $k => $v) { + foreach (glob($root.'/example*.input.json') as $k => $v) { $samples[substr($v, strlen($root)+1)] = [$v]; } return $samples; @@ -42,7 +42,7 @@ public function testBasics() /** * @dataProvider provideJsonSamples */ - public function testGeneration($file) + public function testDefaultGeneration($file) { $json = file_get_contents($file); $schema = Generator::fromJson($json); @@ -50,8 +50,18 @@ public function testGeneration($file) $this->assertTrue(!!$schema); $this->validateSchemaAgainst($schema, $json); + + /* + * Check mocks against their schema + */ + $this->assertEquals( + $schema, + json_encode(json_decode(file_get_contents(str_replace('.input.json', '.schema.json', $file)))), // disable pretty prinitng + 'Should be equals to data examples' + ); } + /** * the most basic functionality diff --git a/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php b/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php index 5313407..ffe0866 100644 --- a/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php +++ b/tests/JSONSchemaGenerator/Tests/JSONSchemaTestCase.php @@ -40,11 +40,11 @@ public function getDataPath() public function setup() { $this->addressJson1 = json_encode( - json_decode(file_get_contents($this->getDataPath().'/example.address1.json')), + json_decode(file_get_contents($this->getDataPath().'/example-address1.input.json')), JSON_PRETTY_PRINT ); $this->addressJson2 = json_encode( - json_decode(file_get_contents($this->getDataPath().'/example.address2.json')), + json_decode(file_get_contents($this->getDataPath().'/example-address2.input.json')), JSON_PRETTY_PRINT ); } diff --git a/tests/data/example.1.json b/tests/data/example-1.input.json similarity index 100% rename from tests/data/example.1.json rename to tests/data/example-1.input.json diff --git a/tests/data/example-1.schema.json b/tests/data/example-1.schema.json new file mode 100644 index 0000000..45af792 --- /dev/null +++ b/tests/data/example-1.schema.json @@ -0,0 +1,64 @@ +{ + "$schema": "http:\/\/json-schema.org\/draft-04\/schema#", + "type": "object", + "required": [ + "documents" + ], + "properties": { + "documents": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "title", + "extention", + "mimeType", + "linkTo", + "id", + "createdOn", + "createdBy", + "extension" + ], + "properties": { + "title": { + "type": "string" + }, + "extention": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "linkTo": { + "type": "object", + "required": [ + "contactId" + ], + "properties": { + "contactId": { + "type": "integer" + } + } + }, + "id": { + "type": "integer" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "string" + }, + "extension": { + "type": "string" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/tests/data/example.address1.json b/tests/data/example-address1.input.json similarity index 100% rename from tests/data/example.address1.json rename to tests/data/example-address1.input.json diff --git a/tests/data/example-address1.schema.json b/tests/data/example-address1.schema.json new file mode 100644 index 0000000..5fc54b8 --- /dev/null +++ b/tests/data/example-address1.schema.json @@ -0,0 +1,47 @@ +{ + "$schema": "http:\/\/json-schema.org\/draft-04\/schema#", + "type": "object", + "required": [ + "address", + "phoneNumber" + ], + "properties": { + "address": { + "type": "object", + "required": [ + "streetAddress", + "city" + ], + "properties": { + "streetAddress": { + "type": "string" + }, + "city": { + "type": "string" + } + } + }, + "phoneNumber": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "type", + "number" + ], + "properties": { + "type": { + "type": "string" + }, + "number": { + "type": "string" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/tests/data/example.address2.json b/tests/data/example-address2.input.json similarity index 100% rename from tests/data/example.address2.json rename to tests/data/example-address2.input.json diff --git a/tests/data/example-address2.schema.json b/tests/data/example-address2.schema.json new file mode 100644 index 0000000..2542348 --- /dev/null +++ b/tests/data/example-address2.schema.json @@ -0,0 +1,96 @@ +{ + "$schema": "http:\/\/json-schema.org\/draft-04\/schema#", + "type": "object", + "required": [ + "address", + "bar", + "phoneNumber", + "test" + ], + "properties": { + "address": { + "type": "object", + "required": [ + "streetAddress", + "city" + ], + "properties": { + "streetAddress": { + "type": "string" + }, + "city": { + "type": "string" + } + } + }, + "bar": { + "type": "object", + "required": [ + "barAddress", + "city" + ], + "properties": { + "barAddress": { + "type": "string" + }, + "city": { + "type": "string" + } + } + }, + "phoneNumber": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "type", + "number" + ], + "properties": { + "type": { + "type": "string" + }, + "number": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type", + "number", + "digits" + ], + "properties": { + "type": { + "type": "string" + }, + "number": { + "type": "string" + }, + "digits": { + "type": "string" + } + } + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + } + ] + } + } + ] + } + }, + "test": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/tests/data/example.array.json b/tests/data/example-array.input.json similarity index 82% rename from tests/data/example.array.json rename to tests/data/example-array.input.json index 255ccf0..f5b4efd 100644 --- a/tests/data/example.array.json +++ b/tests/data/example-array.input.json @@ -4,34 +4,34 @@ "ip": "127.0.0.1", "country": "FR", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3", - "saveDate": "2017-07-06 11:51:06" + "saveDate": "2017-07-06T11:51:06" }, { "id": 8, "ip": "127.0.0.1", "country": "FR", "userAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko', language='en-us,en;q=0.5", - "saveDate": "2017-07-06 11:52:48" + "saveDate": "2017-07-06T11:52:48" }, { "id": 13, "ip": "127.0.0.1", "country": "FR", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3", - "saveDate": "2017-07-06 11:51:06" + "saveDate": "2017-07-06T11:51:06" }, { "id": 14, "ip": "127.0.0.1", "country": "FR", "userAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko', language='en-us,en;q=0.5", - "saveDate": "2017-07-06 11:52:48" + "saveDate": "2017-07-06T11:52:48" }, { "id": 19, "ip": "127.0.0.1", "country": "FR", "userAgent": "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko', language='en-us,en;q=0.5", - "saveDate": "2017-07-06 12:01:51" + "saveDate": "2017-07-06T12:01:51" } ] \ No newline at end of file diff --git a/tests/data/example-array.schema.json b/tests/data/example-array.schema.json new file mode 100644 index 0000000..0b87d86 --- /dev/null +++ b/tests/data/example-array.schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "http:\/\/json-schema.org\/draft-04\/schema#", + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "id", + "ip", + "country", + "userAgent", + "saveDate" + ], + "properties": { + "id": { + "type": "integer" + }, + "ip": { + "type": "string", + "format": "ipv4" + }, + "country": { + "type": "string" + }, + "userAgent": { + "type": "string" + }, + "saveDate": { + "type": "string", + "format": "date-time" + } + } + } + ] + } +} \ No newline at end of file diff --git a/tests/data/example.scalar.json b/tests/data/example-scalar.input.json similarity index 100% rename from tests/data/example.scalar.json rename to tests/data/example-scalar.input.json diff --git a/tests/data/example-scalar.schema.json b/tests/data/example-scalar.schema.json new file mode 100644 index 0000000..eecc003 --- /dev/null +++ b/tests/data/example-scalar.schema.json @@ -0,0 +1,4 @@ +{ + "$schema": "http:\/\/json-schema.org\/draft-04\/schema#", + "type": "string" +} \ No newline at end of file From 8d2d5ad15df30c59ea0b1649819b5d919d50231a Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 18:13:06 +0200 Subject: [PATCH 19/28] test codecoverage reporting --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69941ff..0f5be64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,10 @@ install: script: - - mkdir -p build/logs - - composer test + - mkdir -p build/logs + - composer test + - mv build/logs/clover.xml ./coverage.xml -#after_success: -# - bash <(curl -s https://codecov.io/bash) \ No newline at end of file +after_success: + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file From 10224dc4effed3fe10a216bda3281b3ecc864d2b Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Wed, 16 Aug 2017 18:18:04 +0200 Subject: [PATCH 20/28] add codecoverage badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5429139..ea82386 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # PHP JSON Schema Generator ![Build Status](https://travis-ci.org/evaisse/php-json-schema-generator.svg?branch=master#) +[![codecov](https://codecov.io/gh/evaisse/php-json-schema-generator/branch/master/graph/badge.svg)](https://codecov.io/gh/evaisse/php-json-schema-generator) PHP JSON Schema Generator, introduction to json schema below : From 07cbfb5ab67b01028c8718bc34b934f41453a73b Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Thu, 17 Aug 2017 11:09:54 +0200 Subject: [PATCH 21/28] Ensure deduplicate entries and re-order json properties to output unique schema in collections --- README.md | 8 ++++++ .../Parsers/BaseParser.php | 2 -- .../Structure/Definition.php | 26 ++++++++++++++++++- .../Tests/GeneratorTest.php | 20 ++++++++++++-- tests/data/example-1.schema.json | 12 ++++----- tests/data/example-address1.input.json | 4 +++ tests/data/example-address1.schema.json | 8 +++--- tests/data/example-address2.schema.json | 12 ++++----- tests/data/example-array.schema.json | 6 ++--- 9 files changed, 74 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ea82386..8ade9bb 100644 --- a/README.md +++ b/README.md @@ -122,3 +122,11 @@ debug with DEBUG=true composer test -- --filter="SearchWord" # for filtering *SearchWord* test case with output debugging + +## Roadmap + + - Adjust schema comparison using re-ordering of properties to compare two schema against + their semantic values instead of just comparing their JSON form. For example `{ a: 1, b: 2 }`, and `{ b: 2, a: 1 }` + should result in the same schema. + + - provide an option to allow null values in most fields `("type": ["string", "null"]}` \ No newline at end of file diff --git a/src/JSONSchemaGenerator/Parsers/BaseParser.php b/src/JSONSchemaGenerator/Parsers/BaseParser.php index fc4f2d8..511fbe3 100644 --- a/src/JSONSchemaGenerator/Parsers/BaseParser.php +++ b/src/JSONSchemaGenerator/Parsers/BaseParser.php @@ -213,8 +213,6 @@ protected function determineProperty($property, $id = null) || $type == StringMapper::OBJECT_TYPE ) { - - $prop->setId($id); foreach ($property as $key => $p) { diff --git a/src/JSONSchemaGenerator/Structure/Definition.php b/src/JSONSchemaGenerator/Structure/Definition.php index 07ead7b..ab8dae7 100644 --- a/src/JSONSchemaGenerator/Structure/Definition.php +++ b/src/JSONSchemaGenerator/Structure/Definition.php @@ -320,6 +320,7 @@ public function getRequireds() $requireds[] = $name; } } + sort($requireds); return $requireds; } @@ -420,6 +421,7 @@ public function flatten() } else { // collection of various schema using 'anyOf' $fa->items = new \StdClass(); + // deduplicate items in anyOf type $fa->items->anyOf = $items; } @@ -492,7 +494,29 @@ function jsonSerialize() */ function equals(Definition $d) { - return "$d" === "$this"; + $one = json_decode(json_encode($d), true); + $two = json_decode(json_encode($this), true); + + $this->sortJsonArray($one); + $this->sortJsonArray($two); + + return json_encode($one) === json_encode($two); + } + + /** + * Recursively key sorting for json comparison + * @param $arr + * @return mixed + */ + protected function sortJsonArray(&$arr) + { + foreach ($arr as &$value) { + if (is_array($value)) { + $this->sortJsonArray($value); + } + } + ksort($arr); + return $arr; } /** diff --git a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php index bdfe1b9..2965ef5 100644 --- a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php +++ b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php @@ -55,9 +55,9 @@ public function testDefaultGeneration($file) * Check mocks against their schema */ $this->assertEquals( - $schema, json_encode(json_decode(file_get_contents(str_replace('.input.json', '.schema.json', $file)))), // disable pretty prinitng - 'Should be equals to data examples' + $schema, + 'Should be equal to data example in ' . basename(str_replace('.input.json', '.schema.json', $file)) ); } @@ -132,7 +132,23 @@ public function testCanParseExample2() } + /** + * the most basic functionality + * simple tests to just show it's working + */ + public function testDeduplicationOfSchemaInCollection() + { + $result = Generator::fromJson($this->addressJson1); + + $this->debug($result); + + $this->validateSchemaAgainst($result, $this->addressJson1); + + $decoded = json_decode($result); + $this->assertTrue(is_array($decoded->properties->phoneNumber->items->anyOf)); + $this->assertCount(1, $decoded->properties->phoneNumber->items->anyOf); + } /** * the most basic functionality diff --git a/tests/data/example-1.schema.json b/tests/data/example-1.schema.json index 45af792..1d1ff89 100644 --- a/tests/data/example-1.schema.json +++ b/tests/data/example-1.schema.json @@ -12,14 +12,14 @@ { "type": "object", "required": [ - "title", + "createdBy", + "createdOn", + "extension", "extention", - "mimeType", - "linkTo", "id", - "createdOn", - "createdBy", - "extension" + "linkTo", + "mimeType", + "title" ], "properties": { "title": { diff --git a/tests/data/example-address1.input.json b/tests/data/example-address1.input.json index 79dea56..891f7bd 100644 --- a/tests/data/example-address1.input.json +++ b/tests/data/example-address1.input.json @@ -8,6 +8,10 @@ { "type":"home", "number":"212 555-1234" + }, + { + "number":"212 555-5678", + "type":"work" } ] } \ No newline at end of file diff --git a/tests/data/example-address1.schema.json b/tests/data/example-address1.schema.json index 5fc54b8..e984045 100644 --- a/tests/data/example-address1.schema.json +++ b/tests/data/example-address1.schema.json @@ -9,8 +9,8 @@ "address": { "type": "object", "required": [ - "streetAddress", - "city" + "city", + "streetAddress" ], "properties": { "streetAddress": { @@ -28,8 +28,8 @@ { "type": "object", "required": [ - "type", - "number" + "number", + "type" ], "properties": { "type": { diff --git a/tests/data/example-address2.schema.json b/tests/data/example-address2.schema.json index 2542348..7126c65 100644 --- a/tests/data/example-address2.schema.json +++ b/tests/data/example-address2.schema.json @@ -11,8 +11,8 @@ "address": { "type": "object", "required": [ - "streetAddress", - "city" + "city", + "streetAddress" ], "properties": { "streetAddress": { @@ -45,8 +45,8 @@ { "type": "object", "required": [ - "type", - "number" + "number", + "type" ], "properties": { "type": { @@ -60,9 +60,9 @@ { "type": "object", "required": [ - "type", + "digits", "number", - "digits" + "type" ], "properties": { "type": { diff --git a/tests/data/example-array.schema.json b/tests/data/example-array.schema.json index 0b87d86..3664754 100644 --- a/tests/data/example-array.schema.json +++ b/tests/data/example-array.schema.json @@ -6,11 +6,11 @@ { "type": "object", "required": [ + "country", "id", "ip", - "country", - "userAgent", - "saveDate" + "saveDate", + "userAgent" ], "properties": { "id": { From d9f891ff3b397de1a92a03237eb1ce44256bcff8 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Thu, 17 Aug 2017 11:14:51 +0200 Subject: [PATCH 22/28] Add credits --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8ade9bb..168d568 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ ![Build Status](https://travis-ci.org/evaisse/php-json-schema-generator.svg?branch=master#) [![codecov](https://codecov.io/gh/evaisse/php-json-schema-generator/branch/master/graph/badge.svg)](https://codecov.io/gh/evaisse/php-json-schema-generator) +original forked from [solvire/php-json-schema-generator](https://github.com/solvire/php-json-schema-generator) + PHP JSON Schema Generator, introduction to json schema below : - http://json-schema.org From 8fb1bd2f81db756d0bc5bb5db5897214d6c89d94 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Thu, 17 Aug 2017 11:25:22 +0200 Subject: [PATCH 23/28] more code coverage --- .../JSONSchemaGenerator/Tests/GeneratorTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php index 2965ef5..5e36a89 100644 --- a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php +++ b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php @@ -235,4 +235,20 @@ public function testRequiredProperties() } + + public function testFrom() + { + $result = Generator::from(json_decode($this->addressJson2)); + + $this->validateSchemaAgainst($result, $this->addressJson2); + + $this->assertTrue(is_string($result)); + $decoded = json_decode($result); + + $this->debug($result); + + $this->assertCount(4, $decoded->required, 'should have required properties'); + $this->assertCount(2, $decoded->properties->bar->required, 'sub selements should have required properties'); + } + } \ No newline at end of file From ab254484f4d60fbf0170e06765bf05c7d7960f82 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Thu, 17 Aug 2017 11:26:28 +0200 Subject: [PATCH 24/28] change doc --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 168d568..478ea98 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ To validate your structure against a given schema, you can use : ## Quickstart +Install using composer + + composer require evaisse/php-json-schema-generator + Most simple case $output = JSONSchemaGenerator\Generator::fromJson('{"a":{"b":2}'); @@ -107,11 +111,6 @@ Advanced usage For more advanced usage, see `tests/JSONSchemaGenerator/Tests/GeneratorTest.php` -## Installation - -Simple, assuming you use composer. Add the below lines to your composer.json and run composer update. - - composer require evaisse/php-json-schema-generator ## Testing From ecf16132db4e5ad6cf5ba47b995e6a558ebb0b3a Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Thu, 17 Aug 2017 11:28:38 +0200 Subject: [PATCH 25/28] more docs --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 478ea98..f1f89b1 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ ![Build Status](https://travis-ci.org/evaisse/php-json-schema-generator.svg?branch=master#) [![codecov](https://codecov.io/gh/evaisse/php-json-schema-generator/branch/master/graph/badge.svg)](https://codecov.io/gh/evaisse/php-json-schema-generator) -original forked from [solvire/php-json-schema-generator](https://github.com/solvire/php-json-schema-generator) +Originaly forked from [solvire/php-json-schema-generator](https://github.com/solvire/php-json-schema-generator) -PHP JSON Schema Generator, introduction to json schema below : +Introduction to json schema below (and tools) : - - http://json-schema.org - - http://www.jsonschemavalidator.net - - https://www.openapis.org - - https://jsonschema.net/#/editor + - http://json-schema.org — reference + - http://www.jsonschemavalidator.net - validator (not 100% valid) + - https://www.openapis.org - use json schema to define REST API docs + - https://jsonschema.net/#/editor - convenient editor for json schema To validate your structure against a given schema, you can use : From f5fa45559fcbd61ce1f7b3a39f6b3b1158860dd8 Mon Sep 17 00:00:00 2001 From: Emmanuel VAISSE Date: Fri, 18 Aug 2017 18:45:34 +0200 Subject: [PATCH 26/28] Better JSON equality assertions --- .../Mappers/PropertyTypeMapper.php | 18 +++--- .../Tests/GeneratorTest.php | 7 +++ tests/data/example-2.input.json | 15 +++++ tests/data/example-2.schema.json | 57 +++++++++++++++++++ 4 files changed, 88 insertions(+), 9 deletions(-) create mode 100644 tests/data/example-2.input.json create mode 100644 tests/data/example-2.schema.json diff --git a/src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php b/src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php index 926db56..3db17ce 100644 --- a/src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php +++ b/src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php @@ -67,25 +67,25 @@ public function __construct($property) public static function map($property) { // need to find a better way to determine what the string is - switch ($property) - { - case (is_float($property)): + switch (strtolower(gettype($property))) { + case "double": + case "float": return PropertyTypeMapper::NUMBER_TYPE; - case (is_int($property)): + case 'integer': return PropertyTypeMapper::INTEGER_TYPE; - case (is_bool($property)): + case 'boolean': return PropertyTypeMapper::BOOLEAN_TYPE; - case (is_array($property)): + case 'array': if (array_values($property) !== $property) { // hash values return PropertyTypeMapper::OBJECT_TYPE; } else { return PropertyTypeMapper::ARRAY_TYPE; } - case (is_null($property)): + case 'NULL': return PropertyTypeMapper::NULL_TYPE; - case (is_object($property)): + case 'object': return PropertyTypeMapper::OBJECT_TYPE; - case (is_string($property)): + case 'string': return PropertyTypeMapper::STRING_TYPE; default: throw new UnmappableException("The provided argument property"); diff --git a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php index 5e36a89..24a42c9 100644 --- a/tests/JSONSchemaGenerator/Tests/GeneratorTest.php +++ b/tests/JSONSchemaGenerator/Tests/GeneratorTest.php @@ -45,10 +45,17 @@ public function testBasics() public function testDefaultGeneration($file) { $json = file_get_contents($file); + $expectedJsonSchema = file_get_contents(str_replace('.input.json', '.schema.json', $file)); $schema = Generator::fromJson($json); + $this->assertTrue(!!$schema); + $this->debug($schema); + + $this->assertJsonStringEqualsJsonString($expectedJsonSchema, $schema); + +// $this->assertEquals($json, json_encode(json_decode($schema), JSON_PRETTY_PRINT)); $this->validateSchemaAgainst($schema, $json); /* diff --git a/tests/data/example-2.input.json b/tests/data/example-2.input.json new file mode 100644 index 0000000..e45e8ae --- /dev/null +++ b/tests/data/example-2.input.json @@ -0,0 +1,15 @@ +{ + "error": { + "type": "this error type", + "code": 54564897, + "message": "broken foo", + "trace": [ + "#0 ...", + "#1 ...", + "#2 ....." + ], + "debug": "debug informations" + }, + "data": [], + "errors": [] +} \ No newline at end of file diff --git a/tests/data/example-2.schema.json b/tests/data/example-2.schema.json new file mode 100644 index 0000000..cc5d4ed --- /dev/null +++ b/tests/data/example-2.schema.json @@ -0,0 +1,57 @@ +{ + "$schema": "http:\/\/json-schema.org\/draft-04\/schema#", + "type": "object", + "required": [ + "data", + "error", + "errors" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "debug", + "message", + "trace", + "type" + ], + "properties": { + "type": { + "type": "string" + }, + "code": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "trace": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + } + ] + } + }, + "debug": { + "type": "string" + } + } + }, + "data": { + "type": "array", + "items": { + "anyOf": [] + } + }, + "errors": { + "type": "array", + "items": { + "anyOf": [] + } + } + } +} \ No newline at end of file From 059345fbfe9436366be950bfb958d957138fe423 Mon Sep 17 00:00:00 2001 From: Cyril Labbe <4123392+ryden54@users.noreply.github.com> Date: Fri, 24 Jun 2022 10:17:08 +0200 Subject: [PATCH 27/28] fix(deps): Replace deprecated coveralls package [support-sf-5] --- composer.json | 14 +- composer.lock | 3238 +++++++++++------ .../Exceptions/UnmappableException.php | 4 +- .../Mappers/PropertyTypeMapper.php | 11 +- .../Exceptions/InvalidParamException.php | 2 +- .../Structure/Definition.php | 7 +- 6 files changed, 2224 insertions(+), 1052 deletions(-) diff --git a/composer.json b/composer.json index 3b74c33..fb35f68 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,14 @@ "name": "evaisse/php-json-schema-generator", "type": "library", "description": "A JSON Schema Generator.", - "keywords": ["PHP", "JSON", "Schema", "generator", "validation", "parser"], + "keywords": [ + "PHP", + "JSON", + "Schema", + "generator", + "validation", + "parser" + ], "homepage": "https://github.com/evaisse/php-json-schema-generator", "license": "MIT", "authors": [ @@ -17,12 +24,13 @@ ], "require": { "php": ">=5.6.0", - "satooshi/php-coveralls": "^1.0" + "ext-json": "*" }, "require-dev": { "phpunit/phpunit": "5.7.*", "league/json-guard": "1.*", - "league/json-reference": "1.*" + "league/json-reference": "1.*", + "php-coveralls/php-coveralls": "^2.0.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 4482979..a0a2c90 100644 --- a/composer.lock +++ b/composer.lock @@ -1,77 +1,45 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "hash": "90fb05ba83ef606683a9531a0f614c3b", - "content-hash": "65d7f404a6f52d47727d6b37338a5049", - "packages": [ + "content-hash": "ceb741779df4fde48b8cc287d7267dfb", + "packages": [], + "packages-dev": [ { - "name": "guzzle/guzzle", - "version": "v3.9.3", + "name": "doctrine/instantiator", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.9-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -80,55 +48,68 @@ ], "authors": [ { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" } ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" + "constructor", + "instantiate" ], - "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18 18:23:50" + "time": "2015-06-14T21:17:01+00:00" }, { - "name": "psr/log", - "version": "1.0.2", + "name": "guzzlehttp/guzzle", + "version": "7.4.5", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", "shasum": "" }, "require": { - "php": ">=5.3.0" + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.9 || ^2.4", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "7.4-dev" } }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "GuzzleHttp\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -137,54 +118,105 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Guzzle is a PHP HTTP client library", "keywords": [ - "log", - "psr", - "psr-3" + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.5" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } ], - "time": "2016-10-10 12:19:37" + "time": "2022-06-20T22:16:13+00:00" }, { - "name": "satooshi/php-coveralls", - "version": "v1.0.1", + "name": "guzzlehttp/promises", + "version": "1.5.1", "source": { "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c" + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/da51d304fe8622bf9a6da39a8446e7afd432115c", - "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": "^2.8|^3.0", - "php": ">=5.3.3", - "psr/log": "^1.0", - "symfony/config": "^2.1|^3.0", - "symfony/console": "^2.1|^3.0", - "symfony/stopwatch": "^2.0|^3.0", - "symfony/yaml": "^2.0|^3.0" + "php": ">=5.5" }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, - "bin": [ - "bin/coveralls" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "Satooshi\\": "src/Satooshi/" + "GuzzleHttp\\Promise\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -193,64 +225,92 @@ ], "authors": [ { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", + "description": "Guzzle promises library", "keywords": [ - "ci", - "coverage", - "github", - "test" + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } ], - "time": "2016-01-20 17:35:46" + "time": "2021-10-22T20:56:57+00:00" }, { - "name": "symfony/config", - "version": "v3.3.6", + "name": "guzzlehttp/psr7", + "version": "2.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "54ee12b0dd60f294132cabae6f5da9573d2e5297" + "url": "https://github.com/guzzle/psr7.git", + "reference": "13388f00956b1503577598873fffb5ae994b5737" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/54ee12b0dd60f294132cabae6f5da9573d2e5297", - "reference": "54ee12b0dd60f294132cabae6f5da9573d2e5297", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", + "reference": "13388f00956b1503577598873fffb5ae994b5737", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/filesystem": "~2.8|~3.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" }, - "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" }, "require-dev": { - "symfony/dependency-injection": "~3.3", - "symfony/finder": "~3.3", - "symfony/yaml": "~3.0" + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" }, "suggest": { - "symfony/yaml": "To use the yaml reference dumper" + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "2.4-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "GuzzleHttp\\Psr7\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -258,67 +318,106 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2017-07-19 07:37:29" + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.4.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2022-06-20T21:43:11+00:00" }, { - "name": "symfony/console", - "version": "v3.3.6", + "name": "league/json-guard", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "b0878233cb5c4391347e5495089c7af11b8e6201" + "url": "https://github.com/thephpleague/json-guard.git", + "reference": "596059d2c013bcea1a8a1386bd0e60d32ef39eb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201", - "reference": "b0878233cb5c4391347e5495089c7af11b8e6201", + "url": "https://api.github.com/repos/thephpleague/json-guard/zipball/596059d2c013bcea1a8a1386bd0e60d32ef39eb9", + "reference": "596059d2c013bcea1a8a1386bd0e60d32ef39eb9", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/debug": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" + "ext-bcmath": "*", + "php": ">=5.6.0", + "psr/container": "^1.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3", - "symfony/dependency-injection": "~3.3", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/filesystem": "", - "symfony/process": "" + "ext-curl": "*", + "json-schema/json-schema-test-suite": "1.2.0", + "league/json-reference": "1.0.0", + "phpunit/phpunit": "4.*", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" + "League\\JsonGuard\\": "src" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "src/functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -327,54 +426,64 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Matthew Allan", + "email": "matthew.james.allan@gmail.com", + "homepage": "https://mattallan.org", + "role": "Developer" } ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2017-07-29 21:27:59" + "description": "A validator for JSON using json-schema.", + "homepage": "https://github.com/thephpleague/json-guard", + "keywords": [ + "json", + "json-schema", + "json-schema.org", + "schema", + "validation" + ], + "time": "2017-05-03T21:12:30+00:00" }, { - "name": "symfony/debug", - "version": "v3.3.6", + "name": "league/json-reference", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13" + "url": "https://github.com/thephpleague/json-reference.git", + "reference": "5d68eda332488135b5edcd22da93ce53eca5b133" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13", - "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13", + "url": "https://api.github.com/repos/thephpleague/json-reference/zipball/5d68eda332488135b5edcd22da93ce53eca5b133", + "reference": "5d68eda332488135b5edcd22da93ce53eca5b133", "shasum": "" }, "require": { - "php": ">=5.5.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "php": ">=5.6.0", + "psr/simple-cache": "^1.0", + "sabre/uri": "^1.2.1" }, "require-dev": { - "symfony/http-kernel": "~2.8|~3.0" + "cache/array-adapter": "^0.4.2", + "cache/predis-adapter": "^0.4.0", + "cache/simple-cache-bridge": "^0.1.0", + "ext-curl": "*", + "phpbench/phpbench": "^0.13.0", + "phpunit/phpunit": "^5.7", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" + "League\\JsonReference\\": "src" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "src/functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -383,108 +492,771 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Matthew Allan", + "email": "matthew.james.allan@gmail.com", + "homepage": "https://mattallan.org", + "role": "Developer" + } + ], + "description": "A library for working with JSON References", + "keywords": [ + "Reference", + "json", + "json-reference" + ], + "time": "2017-04-29T23:08:31+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-04-12T18:52:22+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4", + "reference": "007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.0 || ^7.0", + "php": "^5.5 || ^7.0 || ^8.0", + "psr/log": "^1.0 || ^2.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "sanmai/phpunit-legacy-adapter": "^6.1 || ^8.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/php-coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "PhpCoveralls\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp", + "role": "Original creator" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Takashi Matsuo", + "email": "tmatsuo@google.com" + }, + { + "name": "Google Inc" + }, + { + "name": "Dariusz Ruminski", + "email": "dariusz.ruminski@gmail.com", + "homepage": "https://github.com/keradus" + }, + { + "name": "Contributors", + "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "support": { + "issues": "https://github.com/php-coveralls/php-coveralls/issues", + "source": "https://github.com/php-coveralls/php-coveralls/tree/v2.5.2" + }, + "time": "2021-12-06T17:05:08+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27T11:43:31+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.3.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-08-08T06:39:58+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-06-03T08:32:36+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2017-03-02T20:05:34+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03T07:40:28+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-02-27T10:12:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.21", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b91adfb64264ddec5a2dee9851f354aa66327db", + "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0.3|~2.0", + "symfony/yaml": "~2.1|~3.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2017-07-28 15:27:31" + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-06-21T08:11:54+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v2.8.26", + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d" + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1377400fd641d7d1935981546aaef780ecd5bf6d", - "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { - "php": ">=5.3.9" + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" + "phpunit/phpunit": "^5.4" }, "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "ext-soap": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2017-06-02 07:47:27" + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" }, { - "name": "symfony/filesystem", - "version": "v3.3.6", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "427987eb4eed764c3b6e38d52a0f87989e010676" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/427987eb4eed764c3b6e38d52a0f87989e010676", - "reference": "427987eb4eed764c3b6e38d52a0f87989e010676", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -492,51 +1264,49 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2017-07-11 07:17:58" + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.4.0", + "name": "psr/http-client", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] + "Psr\\Http\\Client\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -544,55 +1314,51 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "http", + "http-client", + "psr", + "psr-18" ], - "time": "2017-06-09 14:24:12" + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" }, { - "name": "symfony/stopwatch", - "version": "v3.3.6", + "name": "psr/http-factory", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "602a15299dc01556013b07167d4f5d3a60e90d15" + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/602a15299dc01556013b07167d4f5d3a60e90d15", - "reference": "602a15299dc01556013b07167d4f5d3a60e90d15", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=7.0.0", + "psr/http-message": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Psr\\Http\\Message\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -600,54 +1366,53 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2017-04-12 14:14:56" + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" }, { - "name": "symfony/yaml", - "version": "v3.3.6", + "name": "psr/http-message", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Psr\\Http\\Message\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -655,43 +1420,91 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2017-07-23 12:43:26" - } - ], - "packages-dev": [ + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, { - "name": "doctrine/instantiator", - "version": "1.0.5", + "name": "psr/log", + "version": "1.1.4", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/753fa598e8f3b9966c886fe13f370baa45ef0e24", + "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24", + "shasum": "" }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "require": { + "php": ">=5.3.0" }, "type": "library", "extra": { @@ -701,7 +1514,7 @@ }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "Psr\\SimpleCache\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -710,53 +1523,45 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "description": "Common interfaces for simple caching", "keywords": [ - "constructor", - "instantiate" + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" ], - "time": "2015-06-14 21:17:01" + "time": "2017-01-02T13:31:39+00:00" }, { - "name": "league/json-guard", - "version": "1.0.1", + "name": "ralouphie/getallheaders", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/thephpleague/json-guard.git", - "reference": "596059d2c013bcea1a8a1386bd0e60d32ef39eb9" + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/json-guard/zipball/596059d2c013bcea1a8a1386bd0e60d32ef39eb9", - "reference": "596059d2c013bcea1a8a1386bd0e60d32ef39eb9", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "ext-bcmath": "*", - "php": ">=5.6.0", - "psr/container": "^1.0" + "php": ">=5.6" }, "require-dev": { - "ext-curl": "*", - "json-schema/json-schema-test-suite": "1.2.0", - "league/json-reference": "1.0.0", - "phpunit/phpunit": "4.*", - "scrutinizer/ocular": "~1.1", - "squizlabs/php_codesniffer": "~2.3" + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", "autoload": { - "psr-4": { - "League\\JsonGuard\\": "src" - }, "files": [ - "src/functions.php" + "src/getallheaders.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -765,373 +1570,373 @@ ], "authors": [ { - "name": "Matthew Allan", - "email": "matthew.james.allan@gmail.com", - "homepage": "https://mattallan.org", - "role": "Developer" + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" } ], - "description": "A validator for JSON using json-schema.", - "homepage": "https://github.com/thephpleague/json-guard", - "keywords": [ - "json", - "json-schema", - "json-schema.org", - "schema", - "validation" - ], - "time": "2017-05-03 21:12:30" + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" }, { - "name": "league/json-reference", - "version": "1.0.0", + "name": "sabre/uri", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/thephpleague/json-reference.git", - "reference": "5d68eda332488135b5edcd22da93ce53eca5b133" + "url": "https://github.com/fruux/sabre-uri.git", + "reference": "ada354d83579565949d80b2e15593c2371225e61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/json-reference/zipball/5d68eda332488135b5edcd22da93ce53eca5b133", - "reference": "5d68eda332488135b5edcd22da93ce53eca5b133", + "url": "https://api.github.com/repos/fruux/sabre-uri/zipball/ada354d83579565949d80b2e15593c2371225e61", + "reference": "ada354d83579565949d80b2e15593c2371225e61", "shasum": "" }, "require": { - "php": ">=5.6.0", - "psr/simple-cache": "^1.0", - "sabre/uri": "^1.2.1" + "php": ">=5.4.7" }, "require-dev": { - "cache/array-adapter": "^0.4.2", - "cache/predis-adapter": "^0.4.0", - "cache/simple-cache-bridge": "^0.1.0", - "ext-curl": "*", - "phpbench/phpbench": "^0.13.0", - "phpunit/phpunit": "^5.7", - "scrutinizer/ocular": "~1.1", - "squizlabs/php_codesniffer": "~2.3" + "phpunit/phpunit": ">=4.0,<6.0", + "sabre/cs": "~1.0.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { - "psr-4": { - "League\\JsonReference\\": "src" - }, "files": [ - "src/functions.php" - ] + "lib/functions.php" + ], + "psr-4": { + "Sabre\\Uri\\": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Matthew Allan", - "email": "matthew.james.allan@gmail.com", - "homepage": "https://mattallan.org", + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", "role": "Developer" } ], - "description": "A library for working with JSON References", + "description": "Functions for making sense out of URIs.", + "homepage": "http://sabre.io/uri/", "keywords": [ - "Reference", - "json", - "json-reference" + "rfc3986", + "uri", + "url" ], - "time": "2017-04-29 23:08:31" + "time": "2017-02-20T19:59:28+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.6.1", + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } ], - "time": "2017-04-12 18:52:22" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "1.0", + "name": "sebastian/comparator", + "version": "1.2.4", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "comparator", + "compare", + "equality" ], - "time": "2015-12-27 11:43:31" + "time": "2017-01-29T09:50:25+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "3.2.2", + "name": "sebastian/diff", + "version": "1.4.3", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.3.0", - "webmozart/assert": "^1.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-08 06:39:58" + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "0.3.0", + "name": "sebastian/environment", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "time": "2017-06-03 08:32:36" + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26T07:53:53+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.7.0", + "name": "sebastian/exporter", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1|^2.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" }, { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "export", + "exporter" ], - "time": "2017-03-02 20:05:34" + "time": "2016-11-19T08:54:04+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "name": "sebastian/global-state", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": ">=5.3.3" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "~4.2" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-uopz": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1146,40 +1951,41 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "coverage", - "testing", - "xunit" + "global state" ], - "time": "2017-04-02 07:44:40" + "time": "2015-10-12T03:26:01+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "name": "sebastian/object-enumerator", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1194,36 +2000,39 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2016-10-03 07:40:28" + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "sebastian/recursion-context", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1234,43 +2043,44 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21 13:50:34" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19T07:33:16+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "sebastian/resource-operations", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "php": ">=5.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -1285,42 +2095,34 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" + "email": "sebastian@phpunit.de" + } ], - "time": "2017-02-26 11:10:40" + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.4.11", + "name": "sebastian/version", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" + "php": ">=5.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1335,184 +2137,223 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-02-27 10:12:30" + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" }, { - "name": "phpunit/phpunit", - "version": "5.7.21", + "name": "symfony/config", + "version": "v5.4.9", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db" + "url": "https://github.com/symfony/config.git", + "reference": "8f551fe22672ac7ab2c95fe46d899f960ed4d979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b91adfb64264ddec5a2dee9851f354aa66327db", - "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db", + "url": "https://api.github.com/repos/symfony/config/zipball/8f551fe22672ac7ab2c95fe46d899f960ed4d979", + "reference": "8f551fe22672ac7ab2c95fe46d899f960ed4d979", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "symfony/finder": "<4.4" }, "require-dev": { - "ext-pdo": "*" + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" }, "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "symfony/yaml": "To use the yaml reference dumper" }, - "bin": [ - "phpunit" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v5.4.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2017-06-21 08:11:54" + "time": "2022-05-17T10:39:36+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "name": "symfony/console", + "version": "v5.4.9", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "url": "https://github.com/symfony/console.git", + "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb", + "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" }, "conflict": { - "phpunit/phpunit": "<5.4.0" + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { - "ext-soap": "*" + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", "keywords": [ - "mock", - "xunit" + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2017-06-30 09:13:00" + "time": "2022-05-18T06:17:34+00:00" }, { - "name": "psr/container", - "version": "1.0.0", + "name": "symfony/deprecation-contracts", + "version": "v2.5.1", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } + "files": [ + "function.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1520,48 +2361,63 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2017-02-14 16:28:37" + "time": "2022-01-02T09:53:40+00:00" }, { - "name": "psr/simple-cache", - "version": "1.0.0", + "name": "symfony/filesystem", + "version": "v5.4.9", "source": { "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24" + "url": "https://github.com/symfony/filesystem.git", + "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/753fa598e8f3b9966c886fe13f370baa45ef0e24", - "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/36a017fa4cce1eff1b8e8129ff53513abcef05ba", + "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "Psr\\SimpleCache\\": "src/" - } + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1569,583 +2425,887 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2017-01-02 13:31:39" + "time": "2022-05-20T13:55:35+00:00" }, { - "name": "sabre/uri", - "version": "1.2.1", + "name": "symfony/polyfill-ctype", + "version": "v1.26.0", "source": { "type": "git", - "url": "https://github.com/fruux/sabre-uri.git", - "reference": "ada354d83579565949d80b2e15593c2371225e61" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fruux/sabre-uri/zipball/ada354d83579565949d80b2e15593c2371225e61", - "reference": "ada354d83579565949d80b2e15593c2371225e61", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", "shasum": "" }, "require": { - "php": ">=5.4.7" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": ">=4.0,<6.0", - "sabre/cs": "~1.0.0" + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { "files": [ - "lib/functions.php" + "bootstrap.php" ], "psr-4": { - "Sabre\\Uri\\": "lib/" + "Symfony\\Polyfill\\Ctype\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Evert Pot", - "email": "me@evertpot.com", - "homepage": "http://evertpot.com/", - "role": "Developer" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Functions for making sense out of URIs.", - "homepage": "http://sabre.io/uri/", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", "keywords": [ - "rfc3986", - "uri", - "url" + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2017-02-20 19:59:28" + "time": "2022-05-24T11:49:31+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.26.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "433d05519ce6990bf3530fba6957499d327395c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", + "reference": "433d05519ce6990bf3530fba6957499d327395c2", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "suggest": { + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04 06:30:41" + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-24T11:49:31+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.4", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.26.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "suggest": { + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Volker Dusch", - "email": "github@wallbash.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" + "url": "https://github.com/fabpot", + "type": "github" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29 09:50:25" + "time": "2022-05-24T11:49:31+00:00" }, { - "name": "sebastian/diff", - "version": "1.4.3", + "name": "symfony/polyfill-mbstring", + "version": "v1.26.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", "keywords": [ - "diff" + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2017-05-22 07:24:03" + "time": "2022-05-24T11:49:31+00:00" }, { - "name": "sebastian/environment", - "version": "2.0.0", + "name": "symfony/polyfill-php73", + "version": "v1.26.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2016-11-26 07:53:53" + "time": "2022-05-24T11:49:31+00:00" }, { - "name": "sebastian/exporter", - "version": "2.0.0", + "name": "symfony/polyfill-php80", + "version": "v1.26.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" }, { - "name": "Volker Dusch", - "email": "github@wallbash.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "url": "https://github.com/fabpot", + "type": "github" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-11-19 08:54:04" + "time": "2022-05-10T07:21:04+00:00" }, { - "name": "sebastian/global-state", - "version": "1.1.1", + "name": "symfony/polyfill-php81", + "version": "v1.26.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "global state" + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2015-10-12 03:26:01" + "time": "2022-05-24T11:49:31+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "2.0.1", + "name": "symfony/service-contracts", + "version": "v2.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": ">=7.2.5", + "psr/container": "^1.0" }, - "require-dev": { - "phpunit/phpunit": "~5" + "suggest": { + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18 15:18:39" + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/master" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" }, { - "name": "sebastian/recursion-context", - "version": "2.0.0", + "name": "symfony/stopwatch", + "version": "v5.4.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", + "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v5.4.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19 07:33:16" + "time": "2022-02-18T16:06:09+00:00" }, { - "name": "sebastian/resource-operations", - "version": "1.0.0", + "name": "symfony/string", + "version": "v5.4.9", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "url": "https://github.com/symfony/string.git", + "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", + "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, + "type": "library", "autoload": { - "classmap": [ - "src/" + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-19T10:40:37+00:00" }, { - "name": "sebastian/version", - "version": "2.0.1", + "name": "symfony/yaml", + "version": "v3.3.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "url": "https://github.com/symfony/yaml.git", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.3-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-07-23T12:43:26+00:00" }, { "name": "webmozart/assert", @@ -2195,7 +3355,7 @@ "check", "validate" ], - "time": "2016-11-23 20:04:58" + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], @@ -2204,7 +3364,9 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.4.0" + "php": ">=5.6.0", + "ext-json": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.3.0" } diff --git a/src/JSONSchemaGenerator/Mappers/Exceptions/UnmappableException.php b/src/JSONSchemaGenerator/Mappers/Exceptions/UnmappableException.php index fff9a49..2946dbf 100644 --- a/src/JSONSchemaGenerator/Mappers/Exceptions/UnmappableException.php +++ b/src/JSONSchemaGenerator/Mappers/Exceptions/UnmappableException.php @@ -1,8 +1,8 @@ property = $property; } @@ -78,9 +79,9 @@ public static function map($property) case 'array': if (array_values($property) !== $property) { // hash values return PropertyTypeMapper::OBJECT_TYPE; - } else { - return PropertyTypeMapper::ARRAY_TYPE; } + + return PropertyTypeMapper::ARRAY_TYPE; case 'NULL': return PropertyTypeMapper::NULL_TYPE; case 'object': @@ -100,7 +101,7 @@ public function setProperty($property) public function getProperty() { - return $this->property(); + return $this->property; } public function getPropertyType() diff --git a/src/JSONSchemaGenerator/Parsers/Exceptions/InvalidParamException.php b/src/JSONSchemaGenerator/Parsers/Exceptions/InvalidParamException.php index 697c190..e758a9c 100644 --- a/src/JSONSchemaGenerator/Parsers/Exceptions/InvalidParamException.php +++ b/src/JSONSchemaGenerator/Parsers/Exceptions/InvalidParamException.php @@ -5,7 +5,7 @@ * @package JSONSchemaGenerator\Parsers\Exceptions * @author steven */ -class InvalidParameterException extends \RuntimeException +class InvalidParamException extends \RuntimeException { public function __construct($message = "The provided parameter is not of valid type.", $code = null, $previous = null) { diff --git a/src/JSONSchemaGenerator/Structure/Definition.php b/src/JSONSchemaGenerator/Structure/Definition.php index ab8dae7..be96076 100644 --- a/src/JSONSchemaGenerator/Structure/Definition.php +++ b/src/JSONSchemaGenerator/Structure/Definition.php @@ -524,8 +524,9 @@ protected function sortJsonArray(&$arr) */ function __toString() { - return json_encode($this); + if (!is_string($res = json_encode($this))) { + return 'null'; + } + return $res; } - - } From 894176ace0b0d8a8eb373ef4cfbcfa4bd7b4e2d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Va=C3=AFsse?= Date: Fri, 24 Jun 2022 11:39:50 +0200 Subject: [PATCH 28/28] Update PropertyTypeMapper.php --- src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php b/src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php index ae691b3..29d3231 100644 --- a/src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php +++ b/src/JSONSchemaGenerator/Mappers/PropertyTypeMapper.php @@ -82,7 +82,7 @@ public static function map($property) } return PropertyTypeMapper::ARRAY_TYPE; - case 'NULL': + case 'null': return PropertyTypeMapper::NULL_TYPE; case 'object': return PropertyTypeMapper::OBJECT_TYPE;