From 92e93758b7102fda23864a4d3a242e3708e0f889 Mon Sep 17 00:00:00 2001 From: Cody Cook Date: Mon, 6 May 2024 22:51:13 -0700 Subject: [PATCH] Remove vendor file --- vendor/autoload.php | 25 - vendor/composer/ClassLoader.php | 579 ------- vendor/composer/InstalledVersions.php | 359 ---- vendor/composer/LICENSE | 21 - vendor/composer/autoload_classmap.php | 10 - vendor/composer/autoload_namespaces.php | 9 - vendor/composer/autoload_psr4.php | 11 - vendor/composer/autoload_real.php | 38 - vendor/composer/autoload_static.php | 41 - vendor/composer/installed.json | 122 -- vendor/composer/installed.php | 41 - vendor/composer/platform_check.php | 26 - vendor/yosymfony/parser-utils/.gitignore | 4 - vendor/yosymfony/parser-utils/.travis.yml | 15 - vendor/yosymfony/parser-utils/CHANGELOG.md | 12 - vendor/yosymfony/parser-utils/LICENSE | 19 - vendor/yosymfony/parser-utils/README.md | 145 -- vendor/yosymfony/parser-utils/composer.json | 32 - .../yosymfony/parser-utils/phpunit.xml.dist | 22 - .../parser-utils/src/AbstractParser.php | 53 - .../yosymfony/parser-utils/src/BasicLexer.php | 175 -- .../parser-utils/src/LexerInterface.php | 25 - .../parser-utils/src/SyntaxErrorException.php | 50 - vendor/yosymfony/parser-utils/src/Token.php | 71 - .../parser-utils/src/TokenStream.php | 163 -- .../parser-utils/src/TokenStreamInterface.php | 89 - .../parser-utils/tests/AbstractParserTest.php | 62 - .../parser-utils/tests/BasicLexerTest.php | 127 -- .../parser-utils/tests/TokenStreamTest.php | 261 --- .../parser-utils/tests/TokenTest.php | 26 - vendor/yosymfony/toml/.gitignore | 3 - vendor/yosymfony/toml/.travis.yml | 15 - vendor/yosymfony/toml/CHANGELOG.md | 81 - vendor/yosymfony/toml/LICENSE | 19 - vendor/yosymfony/toml/README.md | 185 --- vendor/yosymfony/toml/composer.json | 33 - vendor/yosymfony/toml/composer.lock | 1476 ----------------- vendor/yosymfony/toml/phpunit.xml.dist | 26 - .../toml/src/Exception/DumpException.php | 22 - .../toml/src/Exception/ParseException.php | 142 -- vendor/yosymfony/toml/src/KeyStore.php | 197 --- vendor/yosymfony/toml/src/Lexer.php | 69 - vendor/yosymfony/toml/src/Parser.php | 593 ------- vendor/yosymfony/toml/src/Toml.php | 116 -- vendor/yosymfony/toml/src/TomlArray.php | 131 -- vendor/yosymfony/toml/src/TomlBuilder.php | 425 ----- vendor/yosymfony/toml/tests/KeyStoreTest.php | 96 -- vendor/yosymfony/toml/tests/LexerTest.php | 299 ---- .../toml/tests/ParserInvalidTest.php | 575 ------- vendor/yosymfony/toml/tests/ParserTest.php | 936 ----------- vendor/yosymfony/toml/tests/TomlArrayTest.php | 71 - .../toml/tests/TomlBuilderInvalidTest.php | 174 -- .../yosymfony/toml/tests/TomlBuilderTest.php | 208 --- vendor/yosymfony/toml/tests/TomlTest.php | 75 - .../yosymfony/toml/tests/fixtures/simple.toml | 1 - 55 files changed, 8601 deletions(-) delete mode 100644 vendor/autoload.php delete mode 100644 vendor/composer/ClassLoader.php delete mode 100644 vendor/composer/InstalledVersions.php delete mode 100644 vendor/composer/LICENSE delete mode 100644 vendor/composer/autoload_classmap.php delete mode 100644 vendor/composer/autoload_namespaces.php delete mode 100644 vendor/composer/autoload_psr4.php delete mode 100644 vendor/composer/autoload_real.php delete mode 100644 vendor/composer/autoload_static.php delete mode 100644 vendor/composer/installed.json delete mode 100644 vendor/composer/installed.php delete mode 100644 vendor/composer/platform_check.php delete mode 100644 vendor/yosymfony/parser-utils/.gitignore delete mode 100644 vendor/yosymfony/parser-utils/.travis.yml delete mode 100644 vendor/yosymfony/parser-utils/CHANGELOG.md delete mode 100644 vendor/yosymfony/parser-utils/LICENSE delete mode 100644 vendor/yosymfony/parser-utils/README.md delete mode 100644 vendor/yosymfony/parser-utils/composer.json delete mode 100644 vendor/yosymfony/parser-utils/phpunit.xml.dist delete mode 100644 vendor/yosymfony/parser-utils/src/AbstractParser.php delete mode 100644 vendor/yosymfony/parser-utils/src/BasicLexer.php delete mode 100644 vendor/yosymfony/parser-utils/src/LexerInterface.php delete mode 100644 vendor/yosymfony/parser-utils/src/SyntaxErrorException.php delete mode 100644 vendor/yosymfony/parser-utils/src/Token.php delete mode 100644 vendor/yosymfony/parser-utils/src/TokenStream.php delete mode 100644 vendor/yosymfony/parser-utils/src/TokenStreamInterface.php delete mode 100644 vendor/yosymfony/parser-utils/tests/AbstractParserTest.php delete mode 100644 vendor/yosymfony/parser-utils/tests/BasicLexerTest.php delete mode 100644 vendor/yosymfony/parser-utils/tests/TokenStreamTest.php delete mode 100644 vendor/yosymfony/parser-utils/tests/TokenTest.php delete mode 100644 vendor/yosymfony/toml/.gitignore delete mode 100644 vendor/yosymfony/toml/.travis.yml delete mode 100644 vendor/yosymfony/toml/CHANGELOG.md delete mode 100644 vendor/yosymfony/toml/LICENSE delete mode 100644 vendor/yosymfony/toml/README.md delete mode 100644 vendor/yosymfony/toml/composer.json delete mode 100644 vendor/yosymfony/toml/composer.lock delete mode 100644 vendor/yosymfony/toml/phpunit.xml.dist delete mode 100644 vendor/yosymfony/toml/src/Exception/DumpException.php delete mode 100644 vendor/yosymfony/toml/src/Exception/ParseException.php delete mode 100644 vendor/yosymfony/toml/src/KeyStore.php delete mode 100644 vendor/yosymfony/toml/src/Lexer.php delete mode 100644 vendor/yosymfony/toml/src/Parser.php delete mode 100644 vendor/yosymfony/toml/src/Toml.php delete mode 100644 vendor/yosymfony/toml/src/TomlArray.php delete mode 100644 vendor/yosymfony/toml/src/TomlBuilder.php delete mode 100644 vendor/yosymfony/toml/tests/KeyStoreTest.php delete mode 100644 vendor/yosymfony/toml/tests/LexerTest.php delete mode 100644 vendor/yosymfony/toml/tests/ParserInvalidTest.php delete mode 100644 vendor/yosymfony/toml/tests/ParserTest.php delete mode 100644 vendor/yosymfony/toml/tests/TomlArrayTest.php delete mode 100644 vendor/yosymfony/toml/tests/TomlBuilderInvalidTest.php delete mode 100644 vendor/yosymfony/toml/tests/TomlBuilderTest.php delete mode 100644 vendor/yosymfony/toml/tests/TomlTest.php delete mode 100644 vendor/yosymfony/toml/tests/fixtures/simple.toml diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 002c886..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,25 +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, PSR-4 and classmap class loader. - * - * $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 - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var \Closure(string):void */ - private static $includeFile; - - /** @var string|null */ - private $vendorDir; - - // PSR-4 - /** - * @var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var list - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * List of PSR-0 prefixes - * - * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) - * - * @var array>> - */ - private $prefixesPsr0 = array(); - /** - * @var list - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var array - */ - private $missingClasses = array(); - - /** @var string|null */ - private $apcuPrefix; - - /** - * @var array - */ - private static $registeredLoaders = array(); - - /** - * @param string|null $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); - } - - /** - * @return array> - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return list - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return list - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return array Array of classname => path - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - 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; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); - - return true; - } - - return null; - } - - /** - * 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) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders keyed by their corresponding vendor directories. - * - * @return array - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } - - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } -} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php deleted file mode 100644 index 51e734a..0000000 --- a/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,359 +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; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints((string) $constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir.'/composer/installed.php'; - $installed[] = self::$installedByVendor[$vendorDir] = $required; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require __DIR__ . '/installed.php'; - self::$installed = $required; - } else { - self::$installed = array(); - } - } - - if (self::$installed !== array()) { - $installed[] = self::$installed; - } - - return $installed; - } -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 0fb0a2c..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,10 +0,0 @@ - $vendorDir . '/composer/InstalledVersions.php', -); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 15a2ff3..0000000 --- a/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/yosymfony/toml/src'), - 'Yosymfony\\ParserUtils\\' => array($vendorDir . '/yosymfony/parser-utils/src'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index 5e21831..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,38 +0,0 @@ -register(true); - - return $loader; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index a28074f..0000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,41 +0,0 @@ - - array ( - 'Yosymfony\\Toml\\' => 15, - 'Yosymfony\\ParserUtils\\' => 22, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Yosymfony\\Toml\\' => - array ( - 0 => __DIR__ . '/..' . '/yosymfony/toml/src', - ), - 'Yosymfony\\ParserUtils\\' => - array ( - 0 => __DIR__ . '/..' . '/yosymfony/parser-utils/src', - ), - ); - - public static $classMap = array ( - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit6bb46fd04ba59751dbe13daf4711c4e1::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit6bb46fd04ba59751dbe13daf4711c4e1::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit6bb46fd04ba59751dbe13daf4711c4e1::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index bb2f17e..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "packages": [ - { - "name": "yosymfony/parser-utils", - "version": "v2.0.0", - "version_normalized": "2.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/yosymfony/parser-utils.git", - "reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yosymfony/parser-utils/zipball/00bec9a12722b21f2baf7f9db35f127e90c162c9", - "reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^6" - }, - "time": "2018-06-29T15:31:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Yosymfony\\ParserUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Victor Puertas", - "email": "vpgugr@gmail.com", - "homepage": "http://yosymfony.com" - } - ], - "description": "Parser utilities", - "homepage": "http://github.com/yosymfony/toml", - "keywords": [ - "lexer", - "parser" - ], - "support": { - "issues": "https://github.com/yosymfony/parser-utils/issues", - "source": "https://github.com/yosymfony/parser-utils/tree/master" - }, - "install-path": "../yosymfony/parser-utils" - }, - { - "name": "yosymfony/toml", - "version": "v1.0.4", - "version_normalized": "1.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/yosymfony/toml.git", - "reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yosymfony/toml/zipball/bdab92ad920d0e36810a3a3e4a998d23f3498f8e", - "reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "yosymfony/parser-utils": "^2.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "time": "2018-08-08T15:08:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Yosymfony\\Toml\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Victor Puertas", - "email": "vpgugr@gmail.com", - "homepage": "http://yosymfony.com" - } - ], - "description": "A PHP parser for TOML compatible with specification 0.4.0", - "homepage": "http://github.com/yosymfony/toml", - "keywords": [ - "mojombo", - "parser", - "toml" - ], - "support": { - "issues": "https://github.com/yosymfony/toml/issues", - "source": "https://github.com/yosymfony/toml/tree/master" - }, - "install-path": "../yosymfony/toml" - } - ], - "dev": true, - "dev-package-names": [] -} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php deleted file mode 100644 index 7106d00..0000000 --- a/vendor/composer/installed.php +++ /dev/null @@ -1,41 +0,0 @@ - array( - 'name' => 'utahsdjs/utahsdjs2025', - 'pretty_version' => '0.0.1', - 'version' => '0.0.1.0', - 'reference' => null, - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => true, - ), - 'versions' => array( - 'utahsdjs/utahsdjs2025' => array( - 'pretty_version' => '0.0.1', - 'version' => '0.0.1.0', - 'reference' => null, - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'yosymfony/parser-utils' => array( - 'pretty_version' => 'v2.0.0', - 'version' => '2.0.0.0', - 'reference' => '00bec9a12722b21f2baf7f9db35f127e90c162c9', - 'type' => 'library', - 'install_path' => __DIR__ . '/../yosymfony/parser-utils', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'yosymfony/toml' => array( - 'pretty_version' => 'v1.0.4', - 'version' => '1.0.4.0', - 'reference' => 'bdab92ad920d0e36810a3a3e4a998d23f3498f8e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../yosymfony/toml', - 'aliases' => array(), - 'dev_requirement' => false, - ), - ), -); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php deleted file mode 100644 index d32d90c..0000000 --- a/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 80200)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/vendor/yosymfony/parser-utils/.gitignore b/vendor/yosymfony/parser-utils/.gitignore deleted file mode 100644 index 9c81509..0000000 --- a/vendor/yosymfony/parser-utils/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor/ -phpunit.xml -.php_cs.cache -composer.lock diff --git a/vendor/yosymfony/parser-utils/.travis.yml b/vendor/yosymfony/parser-utils/.travis.yml deleted file mode 100644 index 5f2b6e8..0000000 --- a/vendor/yosymfony/parser-utils/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - nightly - -before_script: - - composer self-update - - composer install --no-interaction --no-dev - -matrix: - allow_failures: - - php: nightly - fast_finish: true diff --git a/vendor/yosymfony/parser-utils/CHANGELOG.md b/vendor/yosymfony/parser-utils/CHANGELOG.md deleted file mode 100644 index 09aff2a..0000000 --- a/vendor/yosymfony/parser-utils/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -CHANGELOG -========= -2.0.0 (2018/06/29) ------------------- -* [New] The class `TokenStream` implements `TokenStreamInterface`. -* [New] Added PHPUnit as dev-requirement -* [Fixed] Fixed a typo with the method `parseImplementation` from the class `AbstractParser`. -The previous name was `parseImplentation`. - -1.0.0 (2017/11/18) ------------------- -* Initial version. diff --git a/vendor/yosymfony/parser-utils/LICENSE b/vendor/yosymfony/parser-utils/LICENSE deleted file mode 100644 index 1fa26dd..0000000 --- a/vendor/yosymfony/parser-utils/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2017-2018 Víctor Puertas - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/yosymfony/parser-utils/README.md b/vendor/yosymfony/parser-utils/README.md deleted file mode 100644 index e454c5b..0000000 --- a/vendor/yosymfony/parser-utils/README.md +++ /dev/null @@ -1,145 +0,0 @@ -A library for writing [recursive descent parsers](https://en.wikipedia.org/wiki/Recursive_descent_parser) -in PHP. - -[![Build Status](https://travis-ci.org/yosymfony/parser-utils.svg?branch=master)](https://travis-ci.org/yosymfony/parser-utils) - -## requires - -* PHP >= 7.1 - -## Installation - -The preferred installation method is [composer](https://getcomposer.org): - -```bash -composer require yosymfony/parser-utils -``` - -## An example - -First, you need to create a lexer. This one will recognize tokens - -```php -use Yosymfony\ParserUtils\BasicLexer; - -$lexer = new BasicLexer([ - '/^([0-9]+)/x' => 'T_NUMBER', - '/^(\+)/x' => 'T_PLUS', - '/^(-)/x' => 'T_MINUS', - '/^\s+/' => 'T_SPACE', // We do not surround it with parentheses because - // this is not meaningful for us in this case -]); -``` - -Second, you need a parser for consuming the tokens provided by the lexer. -The `AbstractParser` class contains an abstract method called `parseImplementation` -that receives a `TokenStream` as an argument. - -```php -use Yosymfony\ParserUtils\AbstractParser; - -class Parser extends AbstractParser -{ - protected function parseImplementation(TokenStream $stream) - { - $result = $stream->matchNext('T_NUMBER'); - - while ($stream->isNextAny(['T_PLUS', 'T_MINUS'])) { - switch ($stream->moveNext()->getName()) { - case 'T_PLUS': - $result += $stream->matchNext('T_NUMBER'); - break; - case 'T_MINUS': - $result -= $stream->matchNext('T_NUMBER'); - break; - default: - throw new SyntaxErrorException("Something went wrong"); - break; - } - } - - return $result; - } -} -``` - -Now, you can see the results: - -```php -$parser = new Parser($lexer); -$parser->parse('1 + 1'); // 2 -``` - -### The BasicLexer class - -The lexer has the responsibility of recognizing tokens. This one works line by -line. If you want to generate an special `T_NEWLINE` token for each line -of the input, call `$lexer->generateNewlineTokens()` before tokenizing. You can set the -name of this special token using the method `setNewlineTokenName`. - -```php -$lexer = new BasicLexer([...]); -$lexer->generateNewlineTokens() - ->setNewlineTokenName('T_NL'); - -$lexer->tokenize('...'); -``` - -Additionally, there is another special token `T_EOS` that determines the end of the input -string. To enable this feature call `$lexer->generateEosToken()` before tokenizing. -You can set the name of this special token using the method `setEosTokenName`. - -```php -$lexer = new BasicLexer([...]); -$lexer->generateEosToken() - ->setEosTokenName('T_MY_EOS'); - -$lexer->tokenize('...'); -``` - -### The TokenStream class - -This class let you treat with the list of tokens returned by the lexer. - -* **moveNext**: Moves the pointer one token forward. Returns a `Token` object or -`null` if there are not more tokens. e.g: `$ts->moveNext()`. -* **matchNext**: Matches the next token and returns its value. This method moves -the pointer one token forward. It will throw an `SyntaxErrorException` exception -if the next token does not match. e.g: `$number = $ts->matchNext('T_NUMBER')`. -* **isNext**: Checks if the next token matches with the token name passed as argument. -e.g: `$ts->isNext('T_PLUS') // true or false`. -* **skipWhile**: Skips tokens while they match with the token name passed -as argument. This method moves the pointer "n" tokens forward until the -last one that match with the token name. e.g: `$ts->skipWhile('T_PLUS')` -* **skipWhileAny**: Skips tokens while they match with one of the token -names passed as argument. This method moves the pointer "n" tokens -forward until the last one that match with one of the token names -e.g: `$ts->skipWhileAny(['T_PLUS', 'T_MINUS'])` - -* **isNextSequence**: Checks if the following tokens in the stream match with -the sequence of tokens. e.g: `$ts->isNextSequence(['T_NUMBER', 'T_PLUS', 'T_NUMBER']) // true or false`. -* **isNextAny**: Checks if one of the tokens passed as argument is the next token. -e.g: `$fs->isNextAny(['T_PLUS', 'T_SUB']) // true or false` -* **hasPendingTokens**: Has pending tokens? e.g: `$fs->hasPendingTokens() // true or false`. -* **reset**: Resets the stream to the beginning. - -### Tokens - -Tokens are instances of `Token` class, a class than contains the following methods: - -* **getName**: returns the name of the toke. e.g: `T_SUM`. -* **getValue**: returns the value of the token. -* **getLine**: returns the line in where the token is found. - -## Unit tests - -You can run the unit tests with the following command: - -```bash -$ cd parser-utils -$ composer test -``` - -## License - -This library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/vendor/yosymfony/parser-utils/composer.json b/vendor/yosymfony/parser-utils/composer.json deleted file mode 100644 index c789b5d..0000000 --- a/vendor/yosymfony/parser-utils/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "yosymfony/parser-utils", - "description": "Parser utilities", - "type": "library", - "keywords": ["parser", "lexer"], - "homepage": "http://github.com/yosymfony/toml", - "license": "MIT", - "authors": [ - { - "name": "Victor Puertas", - "email": "vpgugr@gmail.com", - "homepage": "http://yosymfony.com" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Yosymfony\\ParserUtils\\": "src/" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "require-dev": { - "phpunit/phpunit": "^6" - }, - "scripts": { - "test": "vendor/bin/phpunit" - } -} diff --git a/vendor/yosymfony/parser-utils/phpunit.xml.dist b/vendor/yosymfony/parser-utils/phpunit.xml.dist deleted file mode 100644 index 5894a5a..0000000 --- a/vendor/yosymfony/parser-utils/phpunit.xml.dist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ./tests/ - - - - - - ./ - - ./vendor - ./tests - - - - diff --git a/vendor/yosymfony/parser-utils/src/AbstractParser.php b/vendor/yosymfony/parser-utils/src/AbstractParser.php deleted file mode 100644 index 1099aa4..0000000 --- a/vendor/yosymfony/parser-utils/src/AbstractParser.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Yosymfony\ParserUtils; - -abstract class AbstractParser -{ - protected $lexer; - - /** - * Constructor - * - * @param LexerInterface $lexer The lexer - */ - public function __construct(LexerInterface $lexer) - { - $this->lexer = $lexer; - } - - /** - * Parse a given input - * - * @param string $input - * - * @return mixed - */ - public function parse(string $input) - { - $ts = $this->lexer->tokenize($input); - $parseResult = $this->parseImplementation($ts); - - if ($ts->hasPendingTokens()) { - throw new SyntaxErrorException('There are tokens not processed.'); - } - - return $parseResult; - } - - /** - * Do the real parsing - * - * @param TokenStream $stream The token stream returned by the lexer - * - * @return mixed - */ - abstract protected function parseImplementation(TokenStream $stream); -} diff --git a/vendor/yosymfony/parser-utils/src/BasicLexer.php b/vendor/yosymfony/parser-utils/src/BasicLexer.php deleted file mode 100644 index 9db7458..0000000 --- a/vendor/yosymfony/parser-utils/src/BasicLexer.php +++ /dev/null @@ -1,175 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Yosymfony\ParserUtils; - -class BasicLexer implements LexerInterface -{ - protected $newlineTokenName = 'T_NEWLINE'; - protected $eosTokenName = 'T_EOS'; - protected $activateNewlineToken = false; - protected $activateEOSToken = false; - protected $terminals = []; - - /** - * Constructor - * - * @param array $terminal List of terminals - * e.g: - * [ - * "/^([)/" => "T_BRAKET_BEGIN" - * ] - */ - public function __construct(array $terminals) - { - $this->terminals = $terminals; - } - - /** - * Generates an special "T_NEWLINE" for each line of the input - * - * @return BasicLexer The BasicLexer itself - */ - public function generateNewlineTokens() : BasicLexer - { - $this->activateNewlineToken = true; - - return $this; - } - - /** - * Generates an special "T_EOS" at the end of the input string - * - * @return BasicLexer The BasicLexer itself - */ - public function generateEosToken() : BasicLexer - { - $this->activateEOSToken = true; - - return $this; - } - - /** - * Sets the name of the newline token - * - * @param string $name The name of the token - * - * @return BasicLexer The BasicLexer itself - * - * @throws InvalidArgumentException If the name is empty - */ - public function setNewlineTokenName(string $name) : BasicLexer - { - if (strlen($name) == 0) { - throw new \InvalidArgumentException('The name of the newline token must be not empty.'); - } - - $this->newlineTokenName = $name; - - return $this; - } - - /** - * Sets the name of the end-of-string token - * - * @param string $name The name of the token - * - * @return BasicLexer The BasicLexer itself - * - * @throws InvalidArgumentException If the name is empty - */ - public function setEosTokenName(string $name) : BasicLexer - { - if (strlen($name) == 0) { - throw new \InvalidArgumentException('The name of the EOS token must be not empty.'); - } - - $this->eosTokenName = $name; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function tokenize(string $input) : TokenStream - { - $counter = 0; - $tokens = []; - $lines = explode("\n", $input); - $totalLines = count($lines); - - foreach ($lines as $number => $line) { - $offset = 0; - $lineNumber = $number + 1; - - while ($offset < strlen($line)) { - list($name, $matches) = $this->match($line, $lineNumber, $offset); - - if (isset($matches[1])) { - $token = new Token($matches[1], $name, $lineNumber); - $this->processToken($token, $matches); - $tokens[] = $token; - } - - $offset += strlen($matches[0]); - } - - if ($this->activateNewlineToken && ++$counter < $totalLines) { - $tokens[] = new Token("\n", $this->newlineTokenName, $lineNumber); - } - } - - if ($this->activateEOSToken) { - $tokens[] = new Token('', $this->eosTokenName, $lineNumber); - } - - return new TokenStream($tokens); - } - - /** - * Returns the first match with the list of terminals - * - * @return array An array with the following keys: - * [0] (string): name of the token - * [1] (array): matches of the regular expression - * - * @throws SyntaxErrorException If the line does not contain any token - */ - protected function match(string $line, int $lineNumber, int $offset) : array - { - $restLine = substr($line, $offset); - - foreach ($this->terminals as $pattern => $name) { - if (preg_match($pattern, $restLine, $matches)) { - return [ - $name, - $matches, - ]; - } - } - - throw new SyntaxErrorException(sprintf('Lexer error: unable to parse "%s" at line %s.', $line, $lineNumber)); - } - - /** - * Applies additional actions over a token. - * - * Implement this method if you need to do changes after a token was found. - * This method is invoked for each token found - * - * @param Token $token The token - * @param string[] $matches Set of matches from the regular expression - * - * @return void - */ - protected function processToken(Token $token, array $matches) : void - { - } -} diff --git a/vendor/yosymfony/parser-utils/src/LexerInterface.php b/vendor/yosymfony/parser-utils/src/LexerInterface.php deleted file mode 100644 index db12fc1..0000000 --- a/vendor/yosymfony/parser-utils/src/LexerInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Yosymfony\ParserUtils; - -/** - * Interface for a lexer - */ -interface LexerInterface -{ - /** - * Returns the tokens found - * - * @param string $input The input to be tokenized - * - * @return TokenStream The stream of tokens - */ - public function tokenize(string $input) : TokenStream; -} diff --git a/vendor/yosymfony/parser-utils/src/SyntaxErrorException.php b/vendor/yosymfony/parser-utils/src/SyntaxErrorException.php deleted file mode 100644 index 0b4e48f..0000000 --- a/vendor/yosymfony/parser-utils/src/SyntaxErrorException.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Yosymfony\ParserUtils; - -/** - * Exception thrown when an error occurs during parsing or tokenizing - */ -class SyntaxErrorException extends \RuntimeException -{ - protected $token; - - /** - * Constructor - * - * @param string $message The error messsage - * @param Token|null $token The token - * @param \Exception|null $previous The previous exceptio - */ - public function __construct(string $message, Token $token = null, \Exception $previous = null) - { - parent::__construct($message, 0, $previous); - } - - /** - * Sets the token associated to the exception - * - * @param Token $token The token - */ - public function setToken(Token $token) : void - { - $this->token = $token; - } - - /** - * Returns the token associated to the exception - * - * @return Token|null - */ - public function getToken() : ?Token - { - return $this->token; - } -} diff --git a/vendor/yosymfony/parser-utils/src/Token.php b/vendor/yosymfony/parser-utils/src/Token.php deleted file mode 100644 index 6432a3d..0000000 --- a/vendor/yosymfony/parser-utils/src/Token.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Yosymfony\ParserUtils; - -class Token -{ - protected $value; - protected $name; - protected $line; - - /** - * Constructor. - * - * @param string $value The value of the token - * @param string $name The name of the token. e.g: T_BRAKET_BEGIN - * @param int $line Line of the code in where the token is found - */ - public function __construct(string $value, string $name, int $line) - { - $this->value = $value; - $this->name = $name; - $this->line = $line; - } - - /** - * Returns the value (the match term) - * - * @return string - */ - public function getValue() : string - { - return $this->value; - } - - /** - * Returns the name of the token - * - * @return string - */ - public function getName() : string - { - return $this->name; - } - - /** - * Returns the line of the code in where the token is found - * - * @return int - */ - public function getLine() : int - { - return $this->line; - } - - public function __toString() : string - { - return sprintf( - "[\n name: %s\n value:%s\n line: %s\n]", - $this->name, - $this->value, - $this->line - ); - } -} diff --git a/vendor/yosymfony/parser-utils/src/TokenStream.php b/vendor/yosymfony/parser-utils/src/TokenStream.php deleted file mode 100644 index 8070c98..0000000 --- a/vendor/yosymfony/parser-utils/src/TokenStream.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Yosymfony\ParserUtils; - -class TokenStream implements TokenStreamInterface -{ - protected $tokens; - protected $index = -1; - - /** - * Constructor - * - * @param Token[] List of tokens - */ - public function __construct(array $tokens) - { - $this->tokens = $tokens; - } - - /** - * {@inheritdoc} - */ - public function moveNext() : ?Token - { - return $this->tokens[++$this->index] ?? null; - } - - /** - * {@inheritdoc} - */ - public function matchNext(string $tokenName) : string - { - $token = $this->moveNext(); - --$this->index; - - if ($token->getName() == $tokenName) { - return $this->moveNext()->getValue(); - } - - throw new SyntaxErrorException(sprintf( - 'Syntax error: expected token with name "%s" instead of "%s" at line %s.', - $tokenName, - $token->getName(), - $token->getLine() - )); - } - - /** - * {@inheritdoc} - */ - public function skipWhile(string $tokenName) : void - { - $this->skipWhileAny([$tokenName]); - } - - /** - * {@inheritdoc} - */ - public function skipWhileAny(array $tokenNames) : void - { - while ($this->isNextAny($tokenNames)) { - $this->moveNext(); - } - } - - /** - * {@inheritdoc} - */ - public function isNext(string $tokenName) : bool - { - $token = $this->moveNext(); - --$this->index; - - if ($token === null) { - return false; - } - - return $token->getName() == $tokenName; - } - - /** - * {@inheritdoc} - */ - public function isNextSequence(array $tokenNames) : bool - { - $result = true; - $currentIndex = $this->index; - - foreach ($tokenNames as $tokenName) { - $token = $this->moveNext(); - - if ($token === null || $token->getName() != $tokenName) { - $result = false; - - break; - } - } - - $this->index = $currentIndex; - - return $result; - } - - /** - * {@inheritdoc} - */ - public function isNextAny(array $tokenNames) : bool - { - $token = $this->moveNext(); - --$this->index; - - if ($token === null) { - return false; - } - - foreach ($tokenNames as $tokenName) { - if ($tokenName === $token->getName()) { - return true; - } - } - - return false; - } - - /** - * Returns all tokens - * - * @return token[] List of tokens - */ - public function getAll() : array - { - return $this->tokens; - } - - /** - * {@inheritdoc} - */ - public function hasPendingTokens() :bool - { - $tokenCount = count($this->tokens); - - if ($tokenCount == 0) { - return false; - } - - return $this->index < ($tokenCount - 1); - } - - /** - * {@inheritdoc} - */ - public function reset() : void - { - $this->index = -1; - } -} diff --git a/vendor/yosymfony/parser-utils/src/TokenStreamInterface.php b/vendor/yosymfony/parser-utils/src/TokenStreamInterface.php deleted file mode 100644 index 0e26a2d..0000000 --- a/vendor/yosymfony/parser-utils/src/TokenStreamInterface.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Yosymfony\ParserUtils; - -interface TokenStreamInterface -{ - /** - * Moves the pointer one token forward - * - * @return Token|null The token or null if there are not more tokens - */ - public function moveNext() : ?Token; - - /** - * Matches the next token. This method moves the pointer one token forward - * if an error does not occur - * - * @param string $tokenName The name of the token - * - * @return string The value of the token - * - * @throws SyntaxErrorException If the next token does not match - */ - public function matchNext(string $tokenName) : string; - - /** - * Skips tokens while they match with the token name passed as argument. - * This method moves the pointer "n" tokens forward until the last one - * that match with the token name - * - * @param string $tokenName The name of the token - */ - public function skipWhile(string $tokenName) : void; - - /** - * Skips tokens while they match with one of the token names passed as - * argument. This method moves the pointer "n" tokens forward until the - * last one that match with one of the token names - * - * @param string[] $tokenNames List of token names - */ - public function skipWhileAny(array $tokenNames) : void; - - /** - * Checks if the next token matches with the token name passed as argument - * - * @param string $tokenName The name of the token - * - * @return bool - */ - public function isNext(string $tokenName) : bool; - - /** - * Checks if the following tokens in the stream match with the sequence of tokens - * - * @param string[] $tokenNames Sequence of token names - * - * @return bool - */ - public function isNextSequence(array $tokenNames) : bool; - - /** - * Checks if one of the tokens passed as argument is the next token - * - * @param string[] $tokenNames List of token names. e.g: 'T_PLUS', 'T_SUB' - * - * @return bool - */ - public function isNextAny(array $tokenNames) : bool; - - /** - * Has pending tokens? - * - * @return bool - */ - public function hasPendingTokens() :bool; - - /** - * Resets the stream to the beginning - */ - public function reset() : void; -} diff --git a/vendor/yosymfony/parser-utils/tests/AbstractParserTest.php b/vendor/yosymfony/parser-utils/tests/AbstractParserTest.php deleted file mode 100644 index 19273b8..0000000 --- a/vendor/yosymfony/parser-utils/tests/AbstractParserTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\ParserUtils\Test; - -use PHPUnit\Framework\TestCase; -use Yosymfony\ParserUtils\AbstractParser; -use Yosymfony\ParserUtils\BasicLexer; -use Yosymfony\ParserUtils\SyntaxErrorException; -use Yosymfony\ParserUtils\TokenStream; - -class AbstractParserTest extends TestCase -{ - private $parser; - - public function setup() - { - $lexer = new BasicLexer([ - '/^([0-9]+)/x' => 'T_NUMBER', - '/^(\+)/x' => 'T_PLUS', - '/^(-)/x' => 'T_MINUS', - '/^\s+/' => 'T_SPACE', - ]); - - $this->parser = $this->getMockBuilder(AbstractParser::class) - ->setConstructorArgs([$lexer]) - ->getMockForAbstractClass(); - $this->parser->expects($this->any()) - ->method('parseImplementation') - ->will($this->returnCallback(function (TokenStream $stream) { - $result = $stream->matchNext('T_NUMBER'); - - while ($stream->isNextAny(['T_PLUS', 'T_MINUS'])) { - switch ($stream->moveNext()->getName()) { - case 'T_PLUS': - $result += $stream->matchNext('T_NUMBER'); - break; - case 'T_MINUS': - $result -= $stream->matchNext('T_NUMBER'); - break; - default: - throw new SyntaxErrorException("Something went wrong"); - break; - } - } - - return $result; - })); - } - - public function testParseMustReturnTheResultOfTheSum() - { - $this->assertEquals(2, $this->parser->parse('1 + 1')); - } -} diff --git a/vendor/yosymfony/parser-utils/tests/BasicLexerTest.php b/vendor/yosymfony/parser-utils/tests/BasicLexerTest.php deleted file mode 100644 index 57a2c09..0000000 --- a/vendor/yosymfony/parser-utils/tests/BasicLexerTest.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\ParserUtils\Test; - -use PHPUnit\Framework\TestCase; -use Yosymfony\ParserUtils\BasicLexer; -use Yosymfony\ParserUtils\Token; - -class BasicLexerTest extends TestCase -{ - public function testTokenizeMustReturnsTheListOfTokens() - { - $lexer = new BasicLexer([ - '/^([0-9]+)/x' => 'T_NUMBER', - '/^(\+)/x' => 'T_PLUS', - '/^(-)/x' => 'T_MINUS', - ]); - $tokens = $lexer->tokenize('1+2')->getAll(); - - $this->assertEquals([ - new Token('1', 'T_NUMBER', 1), - new Token('+', 'T_PLUS', 1), - new Token('2', 'T_NUMBER', 1), - ], $tokens); - } - - public function testTokenizeMustReturnsTheListOfTokensWithoutThoseDoNotHaveParenthesizedSupatternInTerminalSymbols() - { - $lexer = new BasicLexer([ - '/^([0-9]+)/' => 'T_NUMBER', - '/^(\+)/' => 'T_PLUS', - '/^(-)/' => 'T_MINUS', - '/^\s+/' => 'T_SPACE', - ]); - - $tokens = $lexer->tokenize('1 + 2')->getAll(); - - $this->assertEquals([ - new Token('1', 'T_NUMBER', 1), - new Token('+', 'T_PLUS', 1), - new Token('2', 'T_NUMBER', 1), - ], $tokens, 'T_SPACE is not surround with (). e.g: ^(\s+)'); - } - - public function testTokenizeWithEmptyStringMustReturnsZeroTokens() - { - $lexer = new BasicLexer([ - '/^([0-9]+)/' => 'T_NUMBER', - '/^(\+)/' => 'T_PLUS', - '/^(-)/' => 'T_MINUS', - ]); - - $tokens = $lexer->tokenize('')->getAll(); - - $this->assertCount(0, $tokens); - } - - public function testTokenizeMustReturnsNewLineTokensWhenGenerateNewlineTokensIsEnabled() - { - $lexer = new BasicLexer([ - '/^([0-9]+)/' => 'T_NUMBER', - ]); - $lexer->generateNewlineTokens(); - - $ts = $lexer->tokenize("0\n"); - $ts->moveNext(); - $token = $ts->moveNext(); - - $this->assertEquals('T_NEWLINE', $token->getName()); - $this->assertFalse($ts->hasPendingTokens()); - } - - public function testTokenizeMustReturnsCustomNewLineTokensWhenThereIsCustomNameAndGenerateNewlineTokensIsEnabled() - { - $lexer = new BasicLexer([ - '/^([0-9]+)/' => 'T_NUMBER', - ]); - $lexer->setNewlineTokenName('T_MY_NEWLINE') - ->generateNewlineTokens(); - - $ts = $lexer->tokenize("0\n"); - $ts->moveNext(); - $token = $ts->moveNext(); - - $this->assertEquals('T_MY_NEWLINE', $token->getName()); - $this->assertFalse($ts->hasPendingTokens()); - } - - public function testTokenizeMustReturnsEosTokenWhenGenerateEosTokenIsEnabled() - { - $lexer = new BasicLexer([ - '/^([0-9]+)/' => 'T_NUMBER', - ]); - $lexer->generateEosToken(); - - $ts = $lexer->tokenize("0"); - $ts->moveNext(); - $token = $ts->moveNext(); - - $this->assertEquals('T_EOS', $token->getName()); - $this->assertFalse($ts->hasPendingTokens()); - } - - public function testTokenizeMustReturnsCustomNameEosTokenWhenThereIsCustomNameAndGenerateEosTokenIsEnabled() - { - $lexer = new BasicLexer([ - '/^([0-9]+)/' => 'T_NUMBER', - ]); - $lexer->setEosTokenName('T_MY_EOS') - ->generateEosToken(); - - $ts = $lexer->tokenize("0"); - $ts->moveNext(); - $token = $ts->moveNext(); - - $this->assertEquals('T_MY_EOS', $token->getName()); - $this->assertFalse($ts->hasPendingTokens()); - } -} diff --git a/vendor/yosymfony/parser-utils/tests/TokenStreamTest.php b/vendor/yosymfony/parser-utils/tests/TokenStreamTest.php deleted file mode 100644 index 18d2783..0000000 --- a/vendor/yosymfony/parser-utils/tests/TokenStreamTest.php +++ /dev/null @@ -1,261 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\ParserUtils\Test; - -use PHPUnit\Framework\TestCase; -use Yosymfony\ParserUtils\SyntaxErrorException; -use Yosymfony\ParserUtils\Token; -use Yosymfony\ParserUtils\TokenStream; - -class TokenStreamTest extends TestCase -{ - public function testGetAllMustReturnsAllTokens() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $this->assertCount(2, $ts->getAll()); - } - - public function testMoveNextMustReturnsTheFirstTokenTheFirstTime() - { - $token = new Token('+', 'T_PLUS', 1); - $ts = new TokenStream([ - $token, - ]); - - $this->assertEquals($token, $ts->moveNext()); - } - - public function testMoveNextMustReturnsTheSecondTokenTheSecondTime() - { - $token = new Token('1', 'T_NUMBER', 1); - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - $token, - ]); - $ts->moveNext(); - - $this->assertEquals($token, $ts->moveNext()); - } - - public function testMoveNextMustReturnsWhenThereAreNotMoreTokens() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - ]); - $ts->moveNext(); - - $this->assertNull($ts->moveNext()); - } - - public function testMoveNextMustReturnsTheFirstTokenAfterAReset() - { - $token = new Token('1', 'T_NUMBER', 1); - $ts = new TokenStream([ - $token, - new Token('+', 'T_PLUS', 1), - ]); - $ts->moveNext(); - $ts->moveNext(); - - $ts->reset(); - - $this->assertEquals($token, $ts->moveNext()); - } - - public function testMatchNextMustReturnMatchValueWhenTheNameOfNextTokenMatchWithTheNamePassed() - { - $token = new Token('1', 'T_NUMBER', 1); - $ts = new TokenStream([ - $token, - ]); - - $this->assertEquals('1', $ts->matchNext('T_NUMBER')); - } - - public function testMatchNextMustThrowExceptionWhenTheNameOfNextTokenDoesNotMatchWithTheNamePassed() - { - $this->expectException(SyntaxErrorException::class); - $this->expectExceptionMessage('Syntax error: expected token with name "T_PLUS" instead of "T_NUMBER" at line 1.'); - - $token = new Token('1', 'T_NUMBER', 1); - $ts = new TokenStream([ - $token, - ]); - - $ts->matchNext('T_PLUS'); - } - - public function testIsNextMustReturnsTrueWhenTheNameOfNextTokenMatchWithTheNamePassed() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $ts->moveNext(); - - $this->assertTrue($ts->isNext('T_NUMBER')); - } - - public function testIsNextMustReturnsTrueWhenTheNameOfNextTokenMatchWithTheNamePassedAtTheBeginning() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $this->assertTrue($ts->isNext('T_PLUS')); - } - - public function testIsNextMustReturnsFalseWhenTheNameOfNextTokenDoesNotMatchWithTheNamePassed() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $this->assertFalse($ts->isNext('T_NUMBER')); - } - - public function testIsNextMustNotAlterTheTokenStream() - { - $token = new Token('+', 'T_PLUS', 1); - $ts = new TokenStream([ - $token, - new Token('1', 'T_NUMBER', 1), - ]); - $ts->isNext('T_PLUS'); - - $this->assertEquals($token, $ts->moveNext(), 'The next token must be T_PLUS'); - } - - public function testIsNextSequenceMustReturnTrueWhenTheFollowingTokensInTheStreamMatchWithSequence() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $this->assertTrue($ts->isNextSequence(['T_PLUS', 'T_NUMBER'])); - } - - public function testIsNextSequenceMustReturnFalseWhenTheFollowingTokensInTheStreamDoesNotMatchWithSequence() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $this->assertFalse($ts->isNextSequence(['T_NUMBER', 'T_PLUS'])); - } - - public function testIsNextSequenceMustNotAlterTheTokenStream() - { - $token = new Token('+', 'T_PLUS', 1); - $ts = new TokenStream([ - $token, - new Token('1', 'T_NUMBER', 1), - ]); - $ts->isNextSequence(['T_NUMBER', 'T_PLUS']); - - $this->assertEquals($token, $ts->moveNext(), 'The next token must be T_PLUS'); - } - - public function testIsNextAnyMustReturnTrueWhenNameOfNextTokenMatchWithOneOfTheList() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $this->assertTrue($ts->isNextAny(['T_MINUS', 'T_PLUS'])); - } - - public function testIsNextAnyMustReturnFalseWhenNameOfNextTokenDoesNotMatchWithOneOfTheList() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $this->assertFalse($ts->isNextAny(['T_DIV', 'T_MINUS'])); - } - - public function testIsNextAnyMustNotAlterTheTokenStream() - { - $token = new Token('+', 'T_PLUS', 1); - $ts = new TokenStream([ - $token, - new Token('1', 'T_NUMBER', 1), - ]); - $ts->isNextAny(['T_MINUS', 'T_PLUS']); - - $this->assertEquals($token, $ts->moveNext(), 'The next token must be T_PLUS'); - } - - public function testHasPendingTokensMustReturnTrueWhenThereArePendingTokens() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - ]); - - $this->assertTrue($ts->hasPendingTokens()); - } - - public function testHasPendingTokensMustReturnFalseWhenTokenStreamIsEmpty() - { - $ts = new TokenStream([]); - - $this->assertFalse($ts->hasPendingTokens()); - } - - public function testHasPendingTokensMustReturnFalseAfterPointingToTheLastToken() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - ]); - - $ts->moveNext(); - - $this->assertFalse($ts->hasPendingTokens()); - } - - public function testSkipWhileMustMovesPointerNTokensForwardUtilLastOneInstanceOfToken() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('+', 'T_PLUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $ts->skipWhile('T_PLUS'); - - $this->assertTrue($ts->isNext('T_NUMBER')); - } - - public function testSkipWhileAnyMustMovesPointerNTokensForwardUtilLastOneInstanceOfOneOfAnyTokens() - { - $ts = new TokenStream([ - new Token('+', 'T_PLUS', 1), - new Token('+', 'T_PLUS', 1), - new Token('+', 'T_MINUS', 1), - new Token('1', 'T_NUMBER', 1), - ]); - - $ts->skipWhileAny(['T_PLUS', 'T_MINUS']); - - $this->assertTrue($ts->isNext('T_NUMBER')); - } -} diff --git a/vendor/yosymfony/parser-utils/tests/TokenTest.php b/vendor/yosymfony/parser-utils/tests/TokenTest.php deleted file mode 100644 index 4b556d2..0000000 --- a/vendor/yosymfony/parser-utils/tests/TokenTest.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\ParserUtils\Test; - -use PHPUnit\Framework\TestCase; -use Yosymfony\ParserUtils\Token; - -class TokenTest extends TestCase -{ - public function testConstructorMustSetMatchAndNameAndLine() - { - $token = new Token('+', 'T_PLUS', 1); - - $this->assertEquals('+', $token->getValue()); - $this->assertEquals('T_PLUS', $token->getName()); - $this->assertEquals(1, $token->getLine()); - } -} diff --git a/vendor/yosymfony/toml/.gitignore b/vendor/yosymfony/toml/.gitignore deleted file mode 100644 index 9ca13d6..0000000 --- a/vendor/yosymfony/toml/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -phpunit.xml -.php_cs.cache diff --git a/vendor/yosymfony/toml/.travis.yml b/vendor/yosymfony/toml/.travis.yml deleted file mode 100644 index 07d91ae..0000000 --- a/vendor/yosymfony/toml/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - nightly - -before_script: - - composer self-update - - composer install --no-interaction --no-dev - -matrix: - allow_failures: - - php: nightly - fast_finish: true diff --git a/vendor/yosymfony/toml/CHANGELOG.md b/vendor/yosymfony/toml/CHANGELOG.md deleted file mode 100644 index 67b2637..0000000 --- a/vendor/yosymfony/toml/CHANGELOG.md +++ /dev/null @@ -1,81 +0,0 @@ -CHANGELOG -========= -1.0.4 (2018-08-08) ------------------- -* Several corrections and refactorings in `TomBuilder` class. The problem described in the PR #25 "fixed a bug when used the function 'in_array'" has been solved. -* The test file `TomlBuilderTest` has been refactored for readability. Added some tests. -* The `README.md` file has been updated with the `TomlBuilder` class limitations. - -1.0.3 (2018-07-31) ------------------- -* `TomlBuilder` does not throw a `DumpException` anymore when the character "#" appears in a quoted key. -* The method `addArrayTables` from the class `TomlBuilder` has been declared as deprecated. Use the method `addArrayOfTable` instead. -* Fixed the bug #24: "Wrong array of tables implementation". -* A new class `TomlArray` has been added to handle the Toml array generation. - -1.0.2 (2018-06-29) ------------------- -* Fixed the bug #23: "Unable to parse ArrayTables that contain Tables". -* A new class `KeyStore` has been added to deal with the logic of the keys (keys, tables and array of tables). -* Package `yosymfony/parser-utils` has been updated to 2.0.0. - -1.0.1 (2018-02-05) ------------------- -* Fixed a bug related to integer keys: now, it's possible to create keys using an integer. Reported by @betrixed. -* Merged the pull request #17: "removing `is_string` check". -* Minor fixes in README file. - -1.0.0 (2017-11-18) ------------------- -* The code has been rewritten from scratch for PHP 7.1. -* The method `parse` from `Toml` class must only be applied to TOML strings. - In case of parsing a TOML filename use the new method `parseFile`. -* Methods `parse` and `parseFile` from `Toml` class accept a new argument `resultAsObject` - (optional) to return the parsed input as an object (an instance of `stdClass`). -* The method `addGroup` of `TomlBuilder` class has been deleted. -* The exceptions have been refactored, so the classes `ExceptionInterface`, - `LexerException` and `RuntimeException` have been removed. -* Added the inner exception when a `ParseException` is thrown in method `parse` of class `Toml`. -* Fixed bug #13: "Inline sub-tables don't work". -* Fixed bug #12: "Does not parse a table with an array of tables". -* Better support for dates as specified in the latest TOML spec. See PR #11. - -0.3.3 (2015-08-24) ------------------- -* Fixed bug #10: Cannot parse quote (") in table name. - -0.3.2 (2015-03-07) ------------------- -* Fixed issue #9: Only double-quoted strings work in arrays, contrary to spec. - -0.3.1 (2015-03-07) ------------------- -* Added support to literal strings in `TomlBuilder`. - -0.3.0 (2015-03-06) ------------------- -* Support for TOML 0.4.0. -* CS fixes. - -0.2.0 (2014-05-03) --------------------- -* Support for TOML 0.2.0. -* New tests for arrays of tables. -* TomlBuilder: new methods `addTabl`e -* TomlBuilder: Deprecated methods `addGroup`. -* Fixtures folder in tests renamed to fixtures. -* Fixtures reorganized. - -0.1.1 (2013-12-14) ------------------- -* Fixed bug with empty string value parse error. -* Fixed exception default timezone unset in unit tests. -* Added Travis configuration file. -* Fixed some issues in README.md. - -0.1.0 (2013-05-12) ------------------- -* Initial release. -* Support for TOML 0.1.0. -* BurntSushi test suite included. -* Included TomlBuilder to create inline TOML strings. diff --git a/vendor/yosymfony/toml/LICENSE b/vendor/yosymfony/toml/LICENSE deleted file mode 100644 index e9950e5..0000000 --- a/vendor/yosymfony/toml/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2017 Víctor Puertas - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/yosymfony/toml/README.md b/vendor/yosymfony/toml/README.md deleted file mode 100644 index ad325d5..0000000 --- a/vendor/yosymfony/toml/README.md +++ /dev/null @@ -1,185 +0,0 @@ -TOML parser for PHP -=================== - -A PHP parser for [TOML](https://github.com/toml-lang/toml) compatible with [TOML v0.4.0](https://github.com/toml-lang/toml/releases/tag/v0.4.0). - -[![Build Status](https://travis-ci.org/yosymfony/toml.png?branch=master)](https://travis-ci.org/yosymfony/toml) -[![Latest Stable Version](https://poser.pugx.org/yosymfony/toml/v/stable.png)](https://packagist.org/packages/yosymfony/toml) -[![Total Downloads](https://poser.pugx.org/yosymfony/toml/downloads.png)](https://packagist.org/packages/yosymfony/toml) - -Support: - -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/yosymfony/Toml?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - -Installation ------------- -**Requires PHP >= 7.1.** - -Use [Composer](http://getcomposer.org/) to install this package: - -```bash -composer require yosymfony/toml -``` - -Usage ------ -You can parse an inline TOML string or from a file: - -To parse an inline TOML string: - -```php -use Yosymfony\Toml\Toml; - -$array = Toml::Parse('key = [1,2,3]'); - -print_r($array); -``` - -To parse a TOML file: - -```php -$array = Toml::ParseFile('example.toml'); - -print_r($array); -``` - -Additionally, methods `parse` and `parseFile` accept a second argument called -`resultAsObject` to return the result as an object based on `stdClass`. - -```php -$object = Toml::Parse('key = [1,2,3]', true); -``` - -### TomlBuilder -You can create a TOML string with TomlBuilder. TomlBuilder uses a *fluent interface* for more readable code: - -```php - use Yosymfony\Toml\TomlBuilder; - - $tb = new TomlBuilder(); - - $result = $tb->addComment('Toml file') - ->addTable('data.string') - ->addValue('name', "Toml", 'This is your name') - ->addValue('newline', "This string has a \n new line character.") - ->addValue('winPath', "C:\\Users\\nodejs\\templates") - ->addValue('literal', '@<\i\c*\s*>') // literals starts with '@'. - ->addValue('unicode', 'unicode character: ' . json_decode('"\u03B4"')) - - ->addTable('data.bool') - ->addValue('t', true) - ->addValue('f', false) - - ->addTable('data.integer') - ->addValue('positive', 25, 'Comment inline.') - ->addValue('negative', -25) - - ->addTable('data.float') - ->addValue('positive', 25.25) - ->addValue('negative', -25.25) - - ->addTable('data.datetime') - ->addValue('datetime', new \Datetime()) - - ->addComment('Related to arrays') - - ->addTable('data.array') - ->addValue('simple', array(1,2,3)) - ->addValue('multiple', array( - array(1,2), - array('abc', 'def'), - array(1.1, 1.2), - array(true, false), - array( new \Datetime()) )) - - ->addComment('Array of tables') - - ->addArrayOfTable('fruit') // Row - ->addValue('name', 'apple') - ->addArrayOfTable('fruit.variety') - ->addValue('name', 'red delicious') - ->addArrayOfTable('fruit.variety') - ->addValue('name', 'granny smith') - ->addArrayOfTable('fruit') // Row - ->addValue('name', 'banana') - ->addArrayOfTable('fruit.variety') - ->addValue('name', 'plantain') - ->getTomlString(); // Generate the TOML string -``` -The result: - - #Toml file - - [data.string] - name = "Toml" #This is your name - newline = "This string has a \n new line character." - winPath = "C:\\Users\\nodejs\\templates" - literal = '<\i\c*\s*>' - unicode = "unicode character: δ" - - [data.bool] - t = true - f = false - - [data.integer] - positive = 25 #Comment inline. - negative = -25 - - [data.float] - positive = 25.25 - negative = -25.25 - - [data.datetime] - datetime = 2013-06-10T21:12:48Z - - #Related to arrays - - [data.array] - simple = [1, 2, 3] - multiple = [[1, 2], ["abc", "def"], [1.1, 1.2], [true, false], [2013-06-10T21:12:48Z]] - - # Array of tables - - [[fruit]] - name = "apple" - - [[fruit.variety]] - name = "red delicious" - - [[fruit.variety]] - name = "granny smith" - - [[fruit]] - name = "banana" - - [[fruit.variety]] - name = "plantain" - -#### Limitations -The `TomlBuilder` class is an utility to get Toml strings that has the following limitations: -* Only admits `basic strings` and `literal strings`. - -Deprecated method ------------------ -The following method will be eliminated in version 2.0.0 -* [TomlBuilder] **addArrayTables** - -Contributing ------------- -When Contributing code to this library, you must follow its coding standards. -Toml follows [PSR-2 coding style](https://www.php-fig.org/psr/psr-2/). To ensure -the CS, you can use the CLI tool [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer). - -Unit tests ----------- -You can run the unit tests with the following command: - -```bash -$ cd toml -$ composer test -``` - -## License - -This library is open-sourced software licensed under the -[MIT license](http://opensource.org/licenses/MIT). diff --git a/vendor/yosymfony/toml/composer.json b/vendor/yosymfony/toml/composer.json deleted file mode 100644 index da8c5e2..0000000 --- a/vendor/yosymfony/toml/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "yosymfony/toml", - "description": "A PHP parser for TOML compatible with specification 0.4.0", - "type": "library", - "keywords": ["toml", "parser", "mojombo"], - "homepage": "http://github.com/yosymfony/toml", - "license": "MIT", - "authors": [ - { - "name": "Victor Puertas", - "email": "vpgugr@gmail.com", - "homepage": "http://yosymfony.com" - } - ], - "require": { - "php": ">=7.1", - "yosymfony/parser-utils": "^2.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "autoload": { - "psr-4": { "Yosymfony\\Toml\\": "src/" } - }, - "scripts": { - "test": "vendor/bin/phpunit" - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/vendor/yosymfony/toml/composer.lock b/vendor/yosymfony/toml/composer.lock deleted file mode 100644 index f0330e7..0000000 --- a/vendor/yosymfony/toml/composer.lock +++ /dev/null @@ -1,1476 +0,0 @@ -{ - "_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#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "3a0be3632cf9cccad202592d13d58955", - "packages": [ - { - "name": "yosymfony/parser-utils", - "version": "v2.0.0", - "source": { - "type": "git", - "url": "https://github.com/yosymfony/parser-utils.git", - "reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yosymfony/parser-utils/zipball/00bec9a12722b21f2baf7f9db35f127e90c162c9", - "reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Yosymfony\\ParserUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Victor Puertas", - "email": "vpgugr@gmail.com", - "homepage": "http://yosymfony.com" - } - ], - "description": "Parser utilities", - "homepage": "http://github.com/yosymfony/toml", - "keywords": [ - "lexer", - "parser" - ], - "time": "2018-06-29T15:31:11+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.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": "2017-07-22T11:58:36+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.8.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2018-06-11T23:09:50+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^1.0.1", - "php": "^5.6 || ^7.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": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" - }, - { - "name": "phar-io/version", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "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": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.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" - } - ], - "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-11-30T07:14:17+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "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-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.7.6", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.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": "2018-04-18T13:57:24+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "6.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", - "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "suggest": { - "ext-xdebug": "^2.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.0-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 provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2018-06-01T07:51:50+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cecbc684605bb0cc288828eb5d65d93d5c676d3c", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "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": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2018-06-11T11:44:00+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": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", - "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-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": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2018-02-01T13:07:23+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-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": "2018-02-01T13:16:43+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "7.2.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "400a3836ee549ae6f665323ac3f21e27eac7155f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/400a3836ee549ae6f665323ac3f21e27eac7155f", - "reference": "400a3836ee549ae6f665323ac3f21e27eac7155f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.0", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.2-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": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2018-06-21T13:13:39+00:00" - }, - { - "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-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "591a30922f54656695e59b1f39501aec513403da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/591a30922f54656695e59b1f39501aec513403da", - "reference": "591a30922f54656695e59b1f39501aec513403da", - "shasum": "" - }, - "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-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": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2018-06-14T15:05:28+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "366541b989927187c4ca70490a35615d3fef2dce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", - "reference": "366541b989927187c4ca70490a35615d3fef2dce", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-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", - "udiff", - "unidiff", - "unified diff" - ], - "time": "2018-06-10T07:54:39+00:00" - }, - { - "name": "sebastian/environment", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.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": "2017-07-01T08:51:00+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.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": "2017-04-03T13:19:02+00:00" - }, - { - "name": "sebastian/global-state", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.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": "2017-04-27T15:39:26+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.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-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.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": "2017-03-03T06:23:57+00:00" - }, - { - "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-28T20:34:47+00:00" - }, - { - "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-03T07:35:21+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", - "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": "2018-01-29T19:49:41+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.1" - }, - "platform-dev": [] -} diff --git a/vendor/yosymfony/toml/phpunit.xml.dist b/vendor/yosymfony/toml/phpunit.xml.dist deleted file mode 100644 index 90acfe2..0000000 --- a/vendor/yosymfony/toml/phpunit.xml.dist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - ./tests/ - - - - - - ./ - - ./vendor - ./tests - - - - diff --git a/vendor/yosymfony/toml/src/Exception/DumpException.php b/vendor/yosymfony/toml/src/Exception/DumpException.php deleted file mode 100644 index 418ed2c..0000000 --- a/vendor/yosymfony/toml/src/Exception/DumpException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\Exception; - -/** - * Exception class thrown when an error occurs during dumping. - * - * @author Victor Puertas - * - */ -class DumpException extends \RuntimeException -{ -} diff --git a/vendor/yosymfony/toml/src/Exception/ParseException.php b/vendor/yosymfony/toml/src/Exception/ParseException.php deleted file mode 100644 index 72b7267..0000000 --- a/vendor/yosymfony/toml/src/Exception/ParseException.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\Exception; - -/** - * Exception class thrown when an error occurs during parsing. - * Based on ParseException of YAML component from Symfony. - * - * @author Victor Puertas - */ -class ParseException extends \RuntimeException -{ - private $parsedFile; - private $parsedLine; - private $snippet; - private $rawMessage; - - /** - * Constructor. - * - * @param string $message The error message - * @param int $parsedLine The line where the error occurred - * @param string|null $snippet The snippet of code near the problem - * @param string|null $parsedFile The file name where the error occurred - * @param Exception $previous The previous exception - */ - public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Exception $previous = null) - { - $this->parsedFile = $parsedFile; - $this->parsedLine = $parsedLine; - $this->snippet = $snippet; - $this->rawMessage = $message; - - $this->updateRepr(); - - parent::__construct($this->message, 0, $previous); - } - - /** - * Gets the snippet of code near the error. - * - * @return string The snippet of code - */ - public function getSnippet() : string - { - return $this->snippet; - } - - /** - * Sets the snippet of code near the error. - * - * @param string $snippet The code snippet - */ - public function setSnippet(string $snippet) : void - { - $this->snippet = $snippet; - - $this->updateRepr(); - } - - /** - * Gets the filename where the error occurred. - * - * This method returns null if a string is parsed. - * - * @return string The filename - */ - public function getParsedFile() : string - { - return $this->parsedFile; - } - - /** - * Sets the filename where the error occurred. - * - * @param string $parsedFile The filename - */ - public function setParsedFile(string $parsedFile) : void - { - $this->parsedFile = $parsedFile; - - $this->updateRepr(); - } - - /** - * Gets the line where the error occurred. - * - * @return int The file line - */ - public function getParsedLine() : int - { - return $this->parsedLine; - } - - /** - * Sets the line where the error occurred. - * - * @param int $parsedLine The file line - */ - public function setParsedLine(int $parsedLine) : void - { - $this->parsedLine = $parsedLine; - - $this->updateRepr(); - } - - private function updateRepr() : void - { - $this->message = $this->rawMessage; - - $dot = false; - if ('.' === substr($this->message, -1)) { - $this->message = substr($this->message, 0, -1); - $dot = true; - } - - if (null !== $this->parsedFile) { - $this->message .= sprintf(' in %s', json_encode($this->parsedFile)); - } - - if ($this->parsedLine >= 0) { - $this->message .= sprintf(' at line %d', $this->parsedLine); - } - - if ($this->snippet) { - $this->message .= sprintf(' (near "%s")', $this->snippet); - } - - if ($dot) { - $this->message .= '.'; - } - } -} diff --git a/vendor/yosymfony/toml/src/KeyStore.php b/vendor/yosymfony/toml/src/KeyStore.php deleted file mode 100644 index f7b094f..0000000 --- a/vendor/yosymfony/toml/src/KeyStore.php +++ /dev/null @@ -1,197 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml; - -/** - * Internal class for managing keys (key-values, tables and array of tables) - * - * @author Victor Puertas - */ -class KeyStore -{ - private $keys = []; - private $tables = []; - private $arrayOfTables = []; - private $implicitArrayOfTables = []; - private $currentTable = ''; - private $currentArrayOfTable = ''; - - public function addKey(string $name) : void - { - if (!$this->isValidKey($name)) { - throw new \LogicException("The key \"{$name}\" is not valid."); - } - - $this->keys[] = $this->composeKeyWithCurrentPrefix($name); - } - - public function isValidKey(string $name) : bool - { - $composedKey = $this->composeKeyWithCurrentPrefix($name); - - if (in_array($composedKey, $this->keys, true) === true) { - return false; - } - - return true; - } - - public function addTableKey(string $name) : void - { - if (!$this->isValidTableKey($name)) { - throw new \LogicException("The table key \"{$name}\" is not valid."); - } - - $this->currentTable = ''; - $this->currentArrayOfTable = $this->getArrayOfTableKeyFromTableKey($name); - $this->addkey($name); - $this->currentTable = $name; - $this->tables[] = $name; - } - - public function isValidTableKey($name) : bool - { - $currentTable = $this->currentTable; - $currentArrayOfTable = $this->currentArrayOfTable; - - $this->currentTable = ''; - $this->currentArrayOfTable = $this->getArrayOfTableKeyFromTableKey($name); - - if ($this->currentArrayOfTable == $name) { - return false; - } - - $isValid = $this->isValidKey($name); - $this->currentTable = $currentTable; - $this->currentArrayOfTable = $currentArrayOfTable; - - return $isValid; - } - - public function isValidInlineTable(string $name): bool - { - return $this->isValidTableKey($name); - } - - public function addInlineTableKey(string $name) : void - { - $this->addTableKey($name); - } - - public function addArrayTableKey(string $name) : void - { - if (!$this->isValidArrayTableKey($name)) { - throw new \LogicException("The array table key \"{$name}\" is not valid."); - } - - $this->currentTable = ''; - $this->currentArrayOfTable = ''; - - if (isset($this->arrayOfTables[$name]) === false) { - $this->addkey($name); - $this->arrayOfTables[$name] = 0; - } else { - $this->arrayOfTables[$name]++; - } - - $this->currentArrayOfTable = $name; - $this->processImplicitArrayTableNameIfNeeded($name); - } - - public function isValidArrayTableKey(string $name) : bool - { - $isInArrayOfTables = isset($this->arrayOfTables[$name]); - $isInKeys = in_array($name, $this->keys, true); - - if ((!$isInArrayOfTables && !$isInKeys) || ($isInArrayOfTables && $isInKeys)) { - return true; - } - - return false; - } - - public function isRegisteredAsTableKey(string $name) : bool - { - return in_array($name, $this->tables); - } - - public function isRegisteredAsArrayTableKey(string $name) : bool - { - return isset($this->arrayOfTables[$name]); - } - - public function isTableImplicitFromArryTable(string $name) : bool - { - $isInImplicitArrayOfTables = in_array($name, $this->implicitArrayOfTables); - $isInArrayOfTables = isset($this->arrayOfTables[$name]); - - if ($isInImplicitArrayOfTables && !$isInArrayOfTables) { - return true; - } - - return false; - } - - private function composeKeyWithCurrentPrefix(string $name) : string - { - $currentArrayOfTableIndex = ''; - - if ($this->currentArrayOfTable != '') { - $currentArrayOfTableIndex = (string) $this->arrayOfTables[$this->currentArrayOfTable]; - } - - return \trim("{$this->currentArrayOfTable}{$currentArrayOfTableIndex}.{$this->currentTable}.{$name}", '.'); - } - - private function getArrayOfTableKeyFromTableKey(string $name) : string - { - if (isset($this->arrayOfTables[$name])) { - return $name; - } - - $keyParts = explode('.', $name); - - if (count($keyParts) === 1) { - return ''; - } - - array_pop($keyParts); - - while (count($keyParts) > 0) { - $candidateKey = implode('.', $keyParts); - - if (isset($this->arrayOfTables[$candidateKey])) { - return $candidateKey; - } - - array_pop($keyParts); - } - - return ''; - } - - private function processImplicitArrayTableNameIfNeeded(string $name) : void - { - $nameParts = explode('.', $name); - - if (count($nameParts) < 2) { - return; - } - - array_pop($nameParts); - - while (count($nameParts) != 0) { - $this->implicitArrayOfTables[] = implode('.', $nameParts); - array_pop($nameParts); - } - } -} diff --git a/vendor/yosymfony/toml/src/Lexer.php b/vendor/yosymfony/toml/src/Lexer.php deleted file mode 100644 index d8667c0..0000000 --- a/vendor/yosymfony/toml/src/Lexer.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml; - -use Yosymfony\ParserUtils\BasicLexer; -use Yosymfony\ParserUtils\LexerInterface; -use Yosymfony\ParserUtils\TokenStream; - -/** - * Lexer for Toml strings. - * - * @author Victor Puertas - */ -class Lexer implements LexerInterface -{ - private $basicLexer; - - /** - * Constructor - */ - public function __construct() - { - $this->basicLexer = new BasicLexer([ - '/^(=)/' => 'T_EQUAL', - '/^(true|false)/' => 'T_BOOLEAN', - '/^(\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{6})?(Z|-\d{2}:\d{2})?)?)/' => 'T_DATE_TIME', - '/^([+-]?((((\d_?)+[\.]?(\d_?)*)[eE][+-]?(\d_?)+)|((\d_?)+[\.](\d_?)+)))/' => 'T_FLOAT', - '/^([+-]?(\d_?)+)/' => 'T_INTEGER', - '/^(""")/' => 'T_3_QUOTATION_MARK', - '/^(")/' => 'T_QUOTATION_MARK', - "/^(''')/" => 'T_3_APOSTROPHE', - "/^(')/" => 'T_APOSTROPHE', - '/^(#)/' => 'T_HASH', - '/^(\s+)/' => 'T_SPACE', - '/^(\[)/' => 'T_LEFT_SQUARE_BRAKET', - '/^(\])/' => 'T_RIGHT_SQUARE_BRAKET', - '/^(\{)/' => 'T_LEFT_CURLY_BRACE', - '/^(\})/' => 'T_RIGHT_CURLY_BRACE', - '/^(,)/' => 'T_COMMA', - '/^(\.)/' => 'T_DOT', - '/^([-A-Z_a-z0-9]+)/' => 'T_UNQUOTED_KEY', - '/^(\\\(b|t|n|f|r|"|\\\\|u[0-9AaBbCcDdEeFf]{4,4}|U[0-9AaBbCcDdEeFf]{8,8}))/' => 'T_ESCAPED_CHARACTER', - '/^(\\\)/' => 'T_ESCAPE', - '/^([\x{20}-\x{21}\x{23}-\x{26}\x{28}-\x{5A}\x{5E}-\x{10FFFF}]+)/u' => 'T_BASIC_UNESCAPED', - - ]); - - $this->basicLexer - ->generateNewlineTokens() - ->generateEosToken(); - } - - /** - * {@inheritdoc} - */ - public function tokenize(string $input) : TokenStream - { - return $this->basicLexer->tokenize($input); - } -} diff --git a/vendor/yosymfony/toml/src/Parser.php b/vendor/yosymfony/toml/src/Parser.php deleted file mode 100644 index 1b338e4..0000000 --- a/vendor/yosymfony/toml/src/Parser.php +++ /dev/null @@ -1,593 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml; - -use Yosymfony\ParserUtils\AbstractParser; -use Yosymfony\ParserUtils\Token; -use Yosymfony\ParserUtils\TokenStream; -use Yosymfony\ParserUtils\SyntaxErrorException; - -/** - * Parser for TOML strings (specification version 0.4.0). - * - * @author Victor Puertas - */ -class Parser extends AbstractParser -{ - /** @var KeyStore */ - private $keyStore; - /** @var TomlArray */ - private $tomlArray; - - private static $tokensNotAllowedInBasicStrings = [ - 'T_ESCAPE', - 'T_NEWLINE', - 'T_EOS', - ]; - - private static $tokensNotAllowedInLiteralStrings = [ - 'T_NEWLINE', - 'T_EOS', - ]; - - /** - * {@inheritdoc} - */ - public function parse(string $input) - { - if (preg_match('//u', $input) === false) { - throw new SyntaxErrorException('The TOML input does not appear to be valid UTF-8.'); - } - - $input = str_replace(["\r\n", "\r"], "\n", $input); - $input = str_replace("\t", ' ', $input); - - return parent::parse($input); - } - - /** - * {@inheritdoc} - */ - protected function parseImplementation(TokenStream $ts) : array - { - $this->keyStore = new KeyStore(); - $this->tomlArray = new TomlArray(); - - while ($ts->hasPendingTokens()) { - $this->processExpression($ts); - } - - return $this->tomlArray->getArray(); - } - - private function processExpression(TokenStream $ts) : void - { - if ($ts->isNext('T_HASH')) { - $this->parseComment($ts); - } elseif ($ts->isNextAny(['T_QUOTATION_MARK', 'T_UNQUOTED_KEY', 'T_INTEGER'])) { - $this->parseKeyValue($ts); - } elseif ($ts->isNextSequence(['T_LEFT_SQUARE_BRAKET','T_LEFT_SQUARE_BRAKET'])) { - $this->parseArrayOfTables($ts); - } elseif ($ts->isNext('T_LEFT_SQUARE_BRAKET')) { - $this->parseTable($ts); - } elseif ($ts->isNextAny(['T_SPACE','T_NEWLINE', 'T_EOS'])) { - $ts->moveNext(); - } else { - $msg = 'Expected T_HASH or T_UNQUOTED_KEY.'; - $this->unexpectedTokenError($ts->moveNext(), $msg); - } - } - - private function parseComment(TokenStream $ts) : void - { - $this->matchNext('T_HASH', $ts); - - while (!$ts->isNextAny(['T_NEWLINE', 'T_EOS'])) { - $ts->moveNext(); - } - } - - private function parseKeyValue(TokenStream $ts, bool $isFromInlineTable = false) : void - { - $keyName = $this->parseKeyName($ts); - $this->parseSpaceIfExists($ts); - $this->matchNext('T_EQUAL', $ts); - $this->parseSpaceIfExists($ts); - - $isInlineTable = $ts->isNext('T_LEFT_CURLY_BRACE'); - - if ($isInlineTable) { - if (!$this->keyStore->isValidInlineTable($keyName)) { - $this->syntaxError("The inline table key \"{$keyName}\" has already been defined previously."); - } - - $this->keyStore->addInlineTableKey($keyName); - } else { - if (!$this->keyStore->isValidKey($keyName)) { - $this->syntaxError("The key \"{$keyName}\" has already been defined previously."); - } - - $this->keyStore->addKey($keyName); - } - - if ($ts->isNext('T_LEFT_SQUARE_BRAKET')) { - $this->tomlArray->addKeyValue($keyName, $this->parseArray($ts)); - } elseif ($isInlineTable) { - $this->parseInlineTable($ts, $keyName); - } else { - $this->tomlArray->addKeyValue($keyName, $this->parseSimpleValue($ts)->value); - } - - if (!$isFromInlineTable) { - $this->parseSpaceIfExists($ts); - $this->parseCommentIfExists($ts); - $this->errorIfNextIsNotNewlineOrEOS($ts); - } - } - - private function parseKeyName(TokenStream $ts) : string - { - if ($ts->isNext('T_UNQUOTED_KEY')) { - return $this->matchNext('T_UNQUOTED_KEY', $ts); - } - - if ($ts->isNext('T_INTEGER')) { - return $this->parseInteger($ts); - } - - return $this->parseBasicString($ts); - } - - /** - * @return object An object with two public properties: value and type. - */ - private function parseSimpleValue(TokenStream $ts) - { - if ($ts->isNext('T_BOOLEAN')) { - $type = 'boolean'; - $value = $this->parseBoolean($ts); - } elseif ($ts->isNext('T_INTEGER')) { - $type = 'integer'; - $value = $this->parseInteger($ts); - } elseif ($ts->isNext('T_FLOAT')) { - $type = 'float'; - $value = $this->parseFloat($ts); - } elseif ($ts->isNext('T_QUOTATION_MARK')) { - $type = 'string'; - $value = $this->parseBasicString($ts); - } elseif ($ts->isNext('T_3_QUOTATION_MARK')) { - $type = 'string'; - $value = $this->parseMultilineBasicString($ts); - } elseif ($ts->isNext('T_APOSTROPHE')) { - $type = 'string'; - $value = $this->parseLiteralString($ts); - } elseif ($ts->isNext('T_3_APOSTROPHE')) { - $type = 'string'; - $value = $this->parseMultilineLiteralString($ts); - } elseif ($ts->isNext('T_DATE_TIME')) { - $type = 'datetime'; - $value = $this->parseDatetime($ts); - } else { - $this->unexpectedTokenError( - $ts->moveNext(), - 'Expected boolean, integer, long, string or datetime.' - ); - } - - $valueStruct = new class() { - public $value; - public $type; - }; - - $valueStruct->value = $value; - $valueStruct->type = $type; - - return $valueStruct; - } - - private function parseBoolean(TokenStream $ts) : bool - { - return $this->matchNext('T_BOOLEAN', $ts) == 'true' ? true : false; - } - - private function parseInteger(TokenStream $ts) : int - { - $token = $ts->moveNext(); - $value = $token->getValue(); - - if (preg_match('/([^\d]_[^\d])|(_$)/', $value)) { - $this->syntaxError( - 'Invalid integer number: underscore must be surrounded by at least one digit.', - $token - ); - } - - $value = str_replace('_', '', $value); - - if (preg_match('/^0\d+/', $value)) { - $this->syntaxError( - 'Invalid integer number: leading zeros are not allowed.', - $token - ); - } - - return (int) $value; - } - - private function parseFloat(TokenStream $ts): float - { - $token = $ts->moveNext(); - $value = $token->getValue(); - - if (preg_match('/([^\d]_[^\d])|_[eE]|[eE]_|(_$)/', $value)) { - $this->syntaxError( - 'Invalid float number: underscore must be surrounded by at least one digit.', - $token - ); - } - - $value = str_replace('_', '', $value); - - if (preg_match('/^0\d+/', $value)) { - $this->syntaxError( - 'Invalid float number: leading zeros are not allowed.', - $token - ); - } - - return (float) $value; - } - - private function parseBasicString(TokenStream $ts): string - { - $this->matchNext('T_QUOTATION_MARK', $ts); - - $result = ''; - - while (!$ts->isNext('T_QUOTATION_MARK')) { - if ($ts->isNextAny(self::$tokensNotAllowedInBasicStrings)) { - $this->unexpectedTokenError($ts->moveNext(), 'This character is not valid.'); - } - - $value = $ts->isNext('T_ESCAPED_CHARACTER') ? $this->parseEscapedCharacter($ts) : $ts->moveNext()->getValue(); - $result .= $value; - } - - $this->matchNext('T_QUOTATION_MARK', $ts); - - return $result; - } - - private function parseMultilineBasicString(TokenStream $ts) : string - { - $this->matchNext('T_3_QUOTATION_MARK', $ts); - - $result = ''; - - if ($ts->isNext('T_NEWLINE')) { - $ts->moveNext(); - } - - while (!$ts->isNext('T_3_QUOTATION_MARK')) { - if ($ts->isNext('T_EOS')) { - $this->unexpectedTokenError($ts->moveNext(), 'Expected token "T_3_QUOTATION_MARK".'); - } - - if ($ts->isNext('T_ESCAPE')) { - $ts->skipWhileAny(['T_ESCAPE','T_SPACE', 'T_NEWLINE']); - } - - if ($ts->isNext('T_EOS')) { - $this->unexpectedTokenError($ts->moveNext(), 'Expected token "T_3_QUOTATION_MARK".'); - } - - if (!$ts->isNext('T_3_QUOTATION_MARK')) { - $value = $ts->isNext('T_ESCAPED_CHARACTER') ? $this->parseEscapedCharacter($ts) : $ts->moveNext()->getValue(); - $result .= $value; - } - } - - $this->matchNext('T_3_QUOTATION_MARK', $ts); - - return $result; - } - - private function parseLiteralString(TokenStream $ts) : string - { - $this->matchNext('T_APOSTROPHE', $ts); - - $result = ''; - - while (!$ts->isNext('T_APOSTROPHE')) { - if ($ts->isNextAny(self::$tokensNotAllowedInLiteralStrings)) { - $this->unexpectedTokenError($ts->moveNext(), 'This character is not valid.'); - } - - $result .= $ts->moveNext()->getValue(); - } - - $this->matchNext('T_APOSTROPHE', $ts); - - return $result; - } - - private function parseMultilineLiteralString(TokenStream $ts) : string - { - $this->matchNext('T_3_APOSTROPHE', $ts); - - $result = ''; - - if ($ts->isNext('T_NEWLINE')) { - $ts->moveNext(); - } - - while (!$ts->isNext('T_3_APOSTROPHE')) { - if ($ts->isNext('T_EOS')) { - $this->unexpectedTokenError($ts->moveNext(), 'Expected token "T_3_APOSTROPHE".'); - } - - $result .= $ts->moveNext()->getValue(); - } - - $this->matchNext('T_3_APOSTROPHE', $ts); - - return $result; - } - - private function parseEscapedCharacter(TokenStream $ts) : string - { - $token = $ts->moveNext(); - $value = $token->getValue(); - - switch ($value) { - case '\b': - return "\b"; - case '\t': - return "\t"; - case '\n': - return "\n"; - case '\f': - return "\f"; - case '\r': - return "\r"; - case '\"': - return '"'; - case '\\\\': - return '\\'; - } - - if (strlen($value) === 6) { - return json_decode('"'.$value.'"'); - } - - preg_match('/\\\U([0-9a-fA-F]{4})([0-9a-fA-F]{4})/', $value, $matches); - - return json_decode('"\u'.$matches[1].'\u'.$matches[2].'"'); - } - - private function parseDatetime(TokenStream $ts) : \Datetime - { - $date = $this->matchNext('T_DATE_TIME', $ts); - - return new \Datetime($date); - } - - private function parseArray(TokenStream $ts) : array - { - $result = []; - $leaderType = ''; - - $this->matchNext('T_LEFT_SQUARE_BRAKET', $ts); - - while (!$ts->isNext('T_RIGHT_SQUARE_BRAKET')) { - $ts->skipWhileAny(['T_NEWLINE', 'T_SPACE']); - $this->parseCommentsInsideBlockIfExists($ts); - - if ($ts->isNext('T_LEFT_SQUARE_BRAKET')) { - if ($leaderType === '') { - $leaderType = 'array'; - } - - if ($leaderType !== 'array') { - $this->syntaxError(sprintf( - 'Data types cannot be mixed in an array. Value: "%s".', - $valueStruct->value - )); - } - - $result[] = $this->parseArray($ts); - } else { - $valueStruct = $this->parseSimpleValue($ts); - - if ($leaderType === '') { - $leaderType = $valueStruct->type; - } - - if ($valueStruct->type !== $leaderType) { - $this->syntaxError(sprintf( - 'Data types cannot be mixed in an array. Value: "%s".', - $valueStruct->value - )); - } - - $result[] = $valueStruct->value; - } - - $ts->skipWhileAny(['T_NEWLINE', 'T_SPACE']); - $this->parseCommentsInsideBlockIfExists($ts); - - if (!$ts->isNext('T_RIGHT_SQUARE_BRAKET')) { - $this->matchNext('T_COMMA', $ts); - } - - $ts->skipWhileAny(['T_NEWLINE', 'T_SPACE']); - $this->parseCommentsInsideBlockIfExists($ts); - } - - $this->matchNext('T_RIGHT_SQUARE_BRAKET', $ts); - - return $result; - } - - private function parseInlineTable(TokenStream $ts, string $keyName) : void - { - $this->matchNext('T_LEFT_CURLY_BRACE', $ts); - - $this->tomlArray->beginInlineTableKey($keyName); - - $this->parseSpaceIfExists($ts); - - if (!$ts->isNext('T_RIGHT_CURLY_BRACE')) { - $this->parseKeyValue($ts, true); - $this->parseSpaceIfExists($ts); - } - - while ($ts->isNext('T_COMMA')) { - $ts->moveNext(); - - $this->parseSpaceIfExists($ts); - $this->parseKeyValue($ts, true); - $this->parseSpaceIfExists($ts); - } - - $this->matchNext('T_RIGHT_CURLY_BRACE', $ts); - - $this->tomlArray->endCurrentInlineTableKey(); - } - - private function parseTable(TokenStream $ts) : void - { - $this->matchNext('T_LEFT_SQUARE_BRAKET', $ts); - - $fullTableName = $this->tomlArray->escapeKey($key = $this->parseKeyName($ts)); - - while ($ts->isNext('T_DOT')) { - $ts->moveNext(); - - $key = $this->tomlArray->escapeKey($this->parseKeyName($ts)); - $fullTableName .= ".$key"; - } - - if (!$this->keyStore->isValidTableKey($fullTableName)) { - $this->syntaxError("The key \"{$fullTableName}\" has already been defined previously."); - } - - $this->keyStore->addTableKey($fullTableName); - $this->tomlArray->addTableKey($fullTableName); - $this->matchNext('T_RIGHT_SQUARE_BRAKET', $ts); - - $this->parseSpaceIfExists($ts); - $this->parseCommentIfExists($ts); - $this->errorIfNextIsNotNewlineOrEOS($ts); - } - - private function parseArrayOfTables(TokenStream $ts) : void - { - $this->matchNext('T_LEFT_SQUARE_BRAKET', $ts); - $this->matchNext('T_LEFT_SQUARE_BRAKET', $ts); - - $fullTableName = $key = $this->tomlArray->escapeKey($this->parseKeyName($ts)); - - while ($ts->isNext('T_DOT')) { - $ts->moveNext(); - - $key = $this->tomlArray->escapeKey($this->parseKeyName($ts)); - $fullTableName .= ".$key"; - } - - if (!$this->keyStore->isValidArrayTableKey($fullTableName)) { - $this->syntaxError("The key \"{$fullTableName}\" has already been defined previously."); - } - - if ($this->keyStore->isTableImplicitFromArryTable($fullTableName)) { - $this->syntaxError("The array of tables \"{$fullTableName}\" has already been defined as previous table"); - } - - $this->keyStore->addArrayTableKey($fullTableName); - $this->tomlArray->addArrayTableKey($fullTableName); - - $this->matchNext('T_RIGHT_SQUARE_BRAKET', $ts); - $this->matchNext('T_RIGHT_SQUARE_BRAKET', $ts); - - $this->parseSpaceIfExists($ts); - $this->parseCommentIfExists($ts); - $this->errorIfNextIsNotNewlineOrEOS($ts); - } - - private function matchNext(string $tokenName, TokenStream $ts) : string - { - if (!$ts->isNext($tokenName)) { - $this->unexpectedTokenError($ts->moveNext(), "Expected \"$tokenName\"."); - } - - return $ts->moveNext()->getValue(); - } - - private function parseSpaceIfExists(TokenStream $ts) : void - { - if ($ts->isNext('T_SPACE')) { - $ts->moveNext(); - } - } - - private function parseCommentIfExists(TokenStream $ts) : void - { - if ($ts->isNext('T_HASH')) { - $this->parseComment($ts); - } - } - - private function parseCommentsInsideBlockIfExists(TokenStream $ts) : void - { - $this->parseCommentIfExists($ts); - - while ($ts->isNext('T_NEWLINE')) { - $ts->moveNext(); - $ts->skipWhile('T_SPACE'); - $this->parseCommentIfExists($ts); - } - } - - private function errorIfNextIsNotNewlineOrEOS(TokenStream $ts) : void - { - if (!$ts->isNextAny(['T_NEWLINE', 'T_EOS'])) { - $this->unexpectedTokenError($ts->moveNext(), 'Expected T_NEWLINE or T_EOS.'); - } - } - - private function unexpectedTokenError(Token $token, string $expectedMsg) : void - { - $name = $token->getName(); - $line = $token->getLine(); - $value = $token->getValue(); - $msg = sprintf('Syntax error: unexpected token "%s" at line %s with value "%s".', $name, $line, $value); - - if (!empty($expectedMsg)) { - $msg = $msg.' '.$expectedMsg; - } - - throw new SyntaxErrorException($msg); - } - - private function syntaxError($msg, Token $token = null) : void - { - if ($token !== null) { - $name = $token->getName(); - $line = $token->getLine(); - $value = $token->getValue(); - $tokenMsg = sprintf('Token: "%s" line: %s value "%s".', $name, $line, $value); - $msg .= ' '.$tokenMsg; - } - - throw new SyntaxErrorException($msg); - } -} diff --git a/vendor/yosymfony/toml/src/Toml.php b/vendor/yosymfony/toml/src/Toml.php deleted file mode 100644 index e6f26d1..0000000 --- a/vendor/yosymfony/toml/src/Toml.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml; - -use Yosymfony\ParserUtils\SyntaxErrorException; -use Yosymfony\Toml\Exception\ParseException; - -/** - * Parser for TOML format. - * - * @author Victor Puertas - */ -class Toml -{ - /** - * Parses TOML into a PHP array. - * - * Usage: - * - * $array = Toml::parse('key = "[1,2,3]"'); - * print_r($array); - * - * - * @param string $input A string containing TOML - * @param bool $resultAsObject (optional) Returns the result as an object - * - * @return mixed The TOML converted to a PHP value - * - * @throws ParseException If the TOML is not valid - */ - public static function parse(string $input, bool $resultAsObject = false) - { - try { - $data = self::doParse($input, $resultAsObject); - } catch (SyntaxErrorException $e) { - $exception = new ParseException($e->getMessage(), -1, null, null, $e); - - if ($token = $e->getToken()) { - $exception->setParsedLine($token->getLine()); - } - - throw $exception; - } - - return $data; - } - - /** - * Parses a TOML file into a PHP array. - * - * Usage: - * - * $array = Toml::parseFile('config.toml'); - * print_r($array); - * - * - * @param string $input A string containing TOML - * @param bool $resultAsObject (optional) Returns the result as an object - * - * @return mixed The TOML converted to a PHP value - * - * @throws ParseException If the TOML file is not valid - */ - public static function parseFile(string $filename, bool $resultAsObject = false) - { - if (!is_file($filename)) { - throw new ParseException(sprintf('File "%s" does not exist.', $filename)); - } - - if (!is_readable($filename)) { - throw new ParseException(sprintf('File "%s" cannot be read.', $filename)); - } - - try { - $data = self::doParse(file_get_contents($filename), $resultAsObject); - } catch (SyntaxErrorException $e) { - $exception = new ParseException($e->getMessage()); - $exception->setParsedFile($filename); - - if ($token = $e->getToken()) { - $exception->setParsedLine($token->getLine()); - } - - throw $exception; - } - - return $data; - } - - private static function doParse(string $input, bool $resultAsObject = false) - { - $parser = new Parser(new Lexer()); - $values = $parser->parse($input); - - if ($resultAsObject) { - $object = new \stdClass(); - - foreach ($values as $key => $value) { - $object->$key = $value; - } - - return $object; - } - - return empty($values) ? null : $values; - } -} diff --git a/vendor/yosymfony/toml/src/TomlArray.php b/vendor/yosymfony/toml/src/TomlArray.php deleted file mode 100644 index 8999145..0000000 --- a/vendor/yosymfony/toml/src/TomlArray.php +++ /dev/null @@ -1,131 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml; - -/** - * Internal class for managing a Toml array - * - * @author Victor Puertas - */ -class TomlArray -{ - private const DOT_ESCAPED = '%*%'; - - private $result = []; - private $currentPointer; - private $originInlineTableCurrentPointer; - private $ArrayTableKeys = []; - private $inlineTablePointers = []; - - public function __construct() - { - $this->resetCurrentPointer(); - } - - public function addKeyValue(string $name, $value) : Void - { - $this->currentPointer[$name] = $value; - } - - public function addTableKey(string $name) : Void - { - $this->resetCurrentPointer(); - $this->goToKey($name); - } - - public function beginInlineTableKey(string $name) : Void - { - $this->inlineTablePointers[] = &$this->currentPointer; - $this->goToKey($name); - } - - public function endCurrentInlineTableKey() : Void - { - $indexLastElement = $this->getKeyLastElementOfArray($this->inlineTablePointers); - $this->currentPointer = &$this->inlineTablePointers[$indexLastElement]; - unset($this->inlineTablePointers[$indexLastElement]); - } - - public function addArrayTableKey(string $name) : Void - { - $this->resetCurrentPointer(); - $this->goToKey($name); - $this->currentPointer[] = []; - $this->setCurrentPointerToLastElement(); - - if (!$this->existsInArrayTableKey($name)) { - $this->ArrayTableKeys[] = $name; - } - } - - public function escapeKey(string $name) : string - { - return \str_replace('.', self::DOT_ESCAPED, $name); - } - - public function getArray() : array - { - return $this->result; - } - - private function unescapeKey(string $name) : string - { - return \str_replace(self::DOT_ESCAPED, '.', $name); - } - - private function goToKey(string $name) : Void - { - $keyParts = explode('.', $name); - $accumulatedKey = ''; - $countParts = count($keyParts); - - foreach ($keyParts as $index => $keyPart) { - $keyPart = $this->unescapeKey($keyPart); - $isLastKeyPart = $index == $countParts -1; - $accumulatedKey .= $accumulatedKey == '' ? $keyPart : '.'.$keyPart; - - if (\array_key_exists($keyPart, $this->currentPointer) === false) { - $this->currentPointer[$keyPart] = []; - } - - $this->currentPointer = &$this->currentPointer[$keyPart]; - - if ($this->existsInArrayTableKey($accumulatedKey) && !$isLastKeyPart) { - $this->setCurrentPointerToLastElement(); - continue; - } - } - } - - private function setCurrentPointerToLastElement() : void - { - $indexLastElement = $this->getKeyLastElementOfArray($this->currentPointer); - $this->currentPointer = &$this->currentPointer[$indexLastElement]; - } - - private function resetCurrentPointer() : Void - { - $this->currentPointer = &$this->result; - } - - private function existsInArrayTableKey($name) : bool - { - return \in_array($this->unescapeKey($name), $this->ArrayTableKeys); - } - - private function getKeyLastElementOfArray(array &$arr) - { - end($arr); - - return key($arr); - } -} diff --git a/vendor/yosymfony/toml/src/TomlBuilder.php b/vendor/yosymfony/toml/src/TomlBuilder.php deleted file mode 100644 index 17560a4..0000000 --- a/vendor/yosymfony/toml/src/TomlBuilder.php +++ /dev/null @@ -1,425 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml; - -use Yosymfony\Toml\Exception\DumpException; - -/** - * Create inline TOML strings. - * - * @author Victor Puertas - * - * Usage: - * - * $tomlString = new TomlBuilder() - * ->addTable('server.mail') - * ->addValue('ip', '192.168.0.1', 'Internal IP') - * ->addValue('port', 25) - * ->getTomlString(); - * - */ -class TomlBuilder -{ - protected $prefix = ''; - protected $output = ''; - protected $currentKey; - /** @var KeyStore */ - protected $keyStore; - private $currentLine = 0; - /** @var array */ - private static $specialCharacters; - /** @var array */ - private static $escapedSpecialCharacters; - private static $specialCharactersMapping = [ - '\\' => '\\\\', - "\b" => '\\b', - "\t" => '\\t', - "\n" => '\\n', - "\f" => '\\f', - "\r" => '\\r', - '"' => '\\"', - ]; - - /** - * Constructor. - * - * @param int $indent The amount of spaces to use for indentation of nested nodes - */ - public function __construct(int $indent = 4) - { - $this->keyStore = new KeyStore(); - $this->prefix = $indent ? str_repeat(' ', $indent) : ''; - } - - /** - * Adds a key value pair - * - * @param string $key The key name - * @param string|int|bool|float|array|Datetime $val The value - * @param string $comment Comment (optional argument). - * - * @return TomlBuilder The TomlBuilder itself - */ - public function addValue(string $key, $val, string $comment = '') : TomlBuilder - { - $this->currentKey = $key; - $this->exceptionIfKeyEmpty($key); - $this->addKey($key); - - if (!$this->isUnquotedKey($key)) { - $key = '"'.$key.'"'; - } - - $line = "{$key} = {$this->dumpValue($val)}"; - - if (!empty($comment)) { - $line .= ' '.$this->dumpComment($comment); - } - - $this->append($line, true); - - return $this; - } - - /** - * Adds a table. - * - * @param string $key Table name. Dot character have a special mean. e.g: "fruit.type" - * - * @return TomlBuilder The TomlBuilder itself - */ - public function addTable(string $key) : TomlBuilder - { - $this->exceptionIfKeyEmpty($key); - $addPreNewline = $this->currentLine > 0 ? true : false; - $keyParts = explode('.', $key); - - foreach ($keyParts as $keyPart) { - $this->exceptionIfKeyEmpty($keyPart, "Table: \"{$key}\"."); - $this->exceptionIfKeyIsNotUnquotedKey($keyPart); - } - - $line = "[{$key}]"; - $this->addTableKey($key); - $this->append($line, true, false, $addPreNewline); - - return $this; - } - - /** - * This method has been marked as deprecated and will be deleted in version 2.0.0 - * @deprecated 2.0.0 Use the method "addArrayOfTable" instead - */ - public function addArrayTables(string $key) : TomlBuilder - { - return $this->addArrayOfTable($key); - } - - /** - * Adds an array of tables element - * - * @param string $key The name of the array of tables - * - * @return TomlBuilder The TomlBuilder itself - */ - public function addArrayOfTable(string $key) : TomlBuilder - { - $this->exceptionIfKeyEmpty($key); - $addPreNewline = $this->currentLine > 0 ? true : false; - $keyParts = explode('.', $key); - - foreach ($keyParts as $keyPart) { - $this->exceptionIfKeyEmpty($keyPart, "Array of table: \"{$key}\"."); - $this->exceptionIfKeyIsNotUnquotedKey($keyPart); - } - - $line = "[[{$key}]]"; - $this->addArrayOfTableKey($key); - $this->append($line, true, false, $addPreNewline); - - return $this; - } - - /** - * Adds a comment line - * - * @param string $comment The comment - * - * @return TomlBuilder The TomlBuilder itself - */ - public function addComment(string $comment) : TomlBuilder - { - $this->append($this->dumpComment($comment), true); - - return $this; - } - - /** - * Gets the TOML string - * - * @return string - */ - public function getTomlString() : string - { - return $this->output; - } - - /** - * Returns the escaped characters for basic strings - */ - protected function getEscapedCharacters() : array - { - if (self::$escapedSpecialCharacters !== null) { - return self::$escapedSpecialCharacters; - } - - return self::$escapedSpecialCharacters = \array_values(self::$specialCharactersMapping); - } - - /** - * Returns the special characters for basic strings - */ - protected function getSpecialCharacters() : array - { - if (self::$specialCharacters !== null) { - return self::$specialCharacters; - } - - return self::$specialCharacters = \array_keys(self::$specialCharactersMapping); - } - - /** - * Adds a key to the store - * - * @param string $key The key name - * - * @return void - */ - protected function addKey(string $key) : void - { - if (!$this->keyStore->isValidKey($key)) { - throw new DumpException("The key \"{$key}\" has already been defined previously."); - } - - $this->keyStore->addKey($key); - } - - /** - * Adds a table key to the store - * - * @param string $key The table key name - * - * @return void - */ - protected function addTableKey(string $key) : void - { - if (!$this->keyStore->isValidTableKey($key)) { - throw new DumpException("The table key \"{$key}\" has already been defined previously."); - } - - if ($this->keyStore->isRegisteredAsArrayTableKey($key)) { - throw new DumpException("The table \"{$key}\" has already been defined as previous array of tables."); - } - - $this->keyStore->addTableKey($key); - } - - /** - * Adds an array of table key to the store - * - * @param string $key The key name - * - * @return void - */ - protected function addArrayOfTableKey(string $key) : void - { - if (!$this->keyStore->isValidArrayTableKey($key)) { - throw new DumpException("The array of table key \"{$key}\" has already been defined previously."); - } - - if ($this->keyStore->isTableImplicitFromArryTable($key)) { - throw new DumpException("The key \"{$key}\" has been defined as a implicit table from a previous array of tables."); - } - - $this->keyStore->addArrayTableKey($key); - } - - /** - * Dumps a value - * - * @param string|int|bool|float|array|Datetime $val The value - * - * @return string - */ - protected function dumpValue($val) : string - { - switch (true) { - case is_string($val): - return $this->dumpString($val); - case is_array($val): - return $this->dumpArray($val); - case is_int($val): - return $this->dumpInteger($val); - case is_float($val): - return $this->dumpFloat($val); - case is_bool($val): - return $this->dumpBool($val); - case $val instanceof \Datetime: - return $this->dumpDatetime($val); - default: - throw new DumpException("Data type not supporter at the key: \"{$this->currentKey}\"."); - } - } - - /** - * Adds content to the output - * - * @param string $val - * @param bool $addPostNewline Indicates if add a newline after the value - * @param bool $addIndentation Indicates if add indentation to the line - * @param bool $addPreNewline Indicates if add a new line before the value - * - * @return void - */ - protected function append(string $val, bool $addPostNewline = false, bool $addIndentation = false, bool $addPreNewline = false) : void - { - if ($addPreNewline) { - $this->output .= "\n"; - ++$this->currentLine; - } - - if ($addIndentation) { - $val = $this->prefix.$val; - } - - $this->output .= $val; - - if ($addPostNewline) { - $this->output .= "\n"; - ++$this->currentLine; - } - } - - private function dumpString(string $val) : string - { - if ($this->isLiteralString($val)) { - return "'".preg_replace('/@/', '', $val, 1)."'"; - } - - $normalized = $this->normalizeString($val); - - if (!$this->isStringValid($normalized)) { - throw new DumpException("The string has an invalid charters at the key \"{$this->currentKey}\"."); - } - - return '"'.$normalized.'"'; - } - - private function isLiteralString(string $val) : bool - { - return strpos($val, '@') === 0; - } - - private function dumpBool(bool $val) : string - { - return $val ? 'true' : 'false'; - } - - private function dumpArray(array $val) : string - { - $result = ''; - $first = true; - $dataType = null; - $lastType = null; - - foreach ($val as $item) { - $lastType = gettype($item); - $dataType = $dataType == null ? $lastType : $dataType; - - if ($lastType != $dataType) { - throw new DumpException("Data types cannot be mixed in an array. Key: \"{$this->currentKey}\"."); - } - - $result .= $first ? $this->dumpValue($item) : ', '.$this->dumpValue($item); - $first = false; - } - - return '['.$result.']'; - } - - private function dumpComment(string $val) : string - { - return '#'.$val; - } - - private function dumpDatetime(\Datetime $val) : string - { - return $val->format('Y-m-d\TH:i:s\Z'); // ZULU form - } - - private function dumpInteger(int $val) : string - { - return strval($val); - } - - private function dumpFloat(float $val) : string - { - return strval($val); - } - - private function isStringValid(string $val) : bool - { - $noSpecialCharacter = \str_replace($this->getEscapedCharacters(), '', $val); - $noSpecialCharacter = \preg_replace('/\\\\u([0-9a-fA-F]{4})/', '', $noSpecialCharacter); - $noSpecialCharacter = \preg_replace('/\\\\u([0-9a-fA-F]{8})/', '', $noSpecialCharacter); - - $pos = strpos($noSpecialCharacter, '\\'); - - if ($pos !== false) { - return false; - } - - return true; - } - - private function normalizeString(string $val) : string - { - $normalized = \str_replace($this->getSpecialCharacters(), $this->getEscapedCharacters(), $val); - - return $normalized; - } - - private function exceptionIfKeyEmpty(string $key, string $additionalMessage = '') : void - { - $message = 'A key, table name or array of table name cannot be empty or null.'; - - if ($additionalMessage != '') { - $message .= " {$additionalMessage}"; - } - - if (empty(trim($key))) { - throw new DumpException($message); - } - } - - private function exceptionIfKeyIsNotUnquotedKey($key) : void - { - if (!$this->isUnquotedKey($key)) { - throw new DumpException("Only unquoted keys are allowed in this implementation. Key: \"{$key}\"."); - } - } - - private function isUnquotedKey(string $key) : bool - { - return \preg_match('/^([-A-Z_a-z0-9]+)$/', $key) === 1; - } -} diff --git a/vendor/yosymfony/toml/tests/KeyStoreTest.php b/vendor/yosymfony/toml/tests/KeyStoreTest.php deleted file mode 100644 index f52e63f..0000000 --- a/vendor/yosymfony/toml/tests/KeyStoreTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\tests; - -use PHPUnit\Framework\TestCase; -use Yosymfony\Toml\KeyStore; - -class KeyStoreTest extends TestCase -{ - private $keyStore; - - public function setUp() - { - $this->keyStore = new KeyStore(); - } - - public function testIsValidKeyMustReturnTrueWhenTheKeyDoesNotExist() - { - $this->assertTrue($this->keyStore->isValidKey('a')); - } - - public function testIsValidKeyMustReturnFalseWhenDuplicateKeys() - { - $this->keyStore->addKey('a'); - - $this->assertFalse($this->keyStore->isValidKey('a')); - } - - public function testIsValidTableKeyMustReturnTrueWhenTheTableKeyDoesNotExist() - { - $this->assertTrue($this->keyStore->isValidTableKey('a')); - } - - public function testIsValidTableKeyMustReturnTrueWhenSuperTableIsNotDireclyDefined() - { - $this->keyStore->addTableKey('a.b'); - $this->keyStore->addKey('c'); - - $this->assertTrue($this->keyStore->isValidTableKey('a')); - } - - public function testIsValidTableKeyMustReturnFalseWhenDuplicateTableKeys() - { - $this->keyStore->addTableKey('a'); - - $this->assertFalse($this->keyStore->isValidTableKey('a')); - } - - public function testIsValidTableKeyMustReturnFalseWhenThereIsAKeyWithTheSameName() - { - $this->keyStore->addTableKey('a'); - $this->keyStore->addKey('b'); - - $this->assertFalse($this->keyStore->isValidTableKey('a.b')); - } - - public function testIsValidArrayTableKeyMustReturnFalseWhenThereIsAPreviousKeyWithTheSameName() - { - $this->keyStore->addKey('a'); - - $this->assertFalse($this->keyStore->isValidArrayTableKey('a')); - } - - public function testIsValidArrayTableKeyMustReturnFalseWhenThereIsAPreviousTableWithTheSameName() - { - $this->keyStore->addTableKey('a'); - - $this->assertFalse($this->keyStore->isValidArrayTableKey('a')); - } - - public function testIsValidTableKeyMustReturnFalseWhenAttemptingToDefineATableKeyEqualToPreviousDefinedArrayTable() - { - $this->keyStore->addArrayTableKey('a'); - $this->keyStore->addArrayTableKey('a.b'); - - $this->assertFalse($this->keyStore->isValidTableKey('a.b')); - } - - public function testIsValidTableKeyMustReturnTrueWithTablesInsideArrayOfTables() - { - $this->keyStore->addArrayTableKey('a'); - $this->keyStore->addTableKey('a.b'); - $this->keyStore->addArrayTableKey('a'); - - $this->assertTrue($this->keyStore->isValidTableKey('a.b')); - } -} diff --git a/vendor/yosymfony/toml/tests/LexerTest.php b/vendor/yosymfony/toml/tests/LexerTest.php deleted file mode 100644 index 4875d7e..0000000 --- a/vendor/yosymfony/toml/tests/LexerTest.php +++ /dev/null @@ -1,299 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\tests; - -use PHPUnit\Framework\TestCase; -use Yosymfony\Toml\Lexer; - -class LexerTest extends TestCase -{ - private $lexer; - - public function setUp() - { - $this->lexer = new Lexer(); - } - - public function testTokenizeMustRecognizeEqualToken() - { - $ts = $this->lexer->tokenize('='); - - $this->assertTrue($ts->isNext('T_EQUAL')); - } - - public function testTokenizeMustRecognizeBooleanTokenWhenThereIsATrueValue() - { - $ts = $this->lexer->tokenize('true'); - - $this->assertTrue($ts->isNext('T_BOOLEAN')); - } - - public function testTokenizeMustRecognizeBooleanTokenWhenThereIsAFalseValue() - { - $ts = $this->lexer->tokenize('false'); - - $this->assertTrue($ts->isNext('T_BOOLEAN')); - } - - public function testTokenizeMustRecognizeUnquotedKeyToken() - { - $ts = $this->lexer->tokenize('title'); - - $this->assertTrue($ts->isNext('T_UNQUOTED_KEY')); - } - - public function testTokenizeMustRecognizeIntegerTokenWhenThereIsAPositiveNumber() - { - $ts = $this->lexer->tokenize('25'); - - $this->assertTrue($ts->isNext('T_INTEGER')); - } - - public function testTokenizeMustRecognizeIntegerTokenWhenThereIsANegativeNumber() - { - $ts = $this->lexer->tokenize('-25'); - - $this->assertTrue($ts->isNext('T_INTEGER')); - } - - public function testTokenizeMustRecognizeIntegerTokenWhenThereIsNumberWithUnderscoreSeparator() - { - $ts = $this->lexer->tokenize('2_5'); - - $this->assertTrue($ts->isNext('T_INTEGER')); - } - - public function testTokenizeMustRecognizeFloatTokenWhenThereIsAFloatNumber() - { - $ts = $this->lexer->tokenize('2.5'); - - $this->assertTrue($ts->isNext('T_FLOAT')); - } - - public function testTokenizeMustRecognizeFloatTokenWhenThereIsAFloatNumberWithUnderscoreSeparator() - { - $ts = $this->lexer->tokenize('9_224_617.445_991_228_313'); - - $this->assertTrue($ts->isNext('T_FLOAT')); - } - - public function testTokenizeMustRecognizeFloatTokenWhenThereIsANegativeFloatNumber() - { - $ts = $this->lexer->tokenize('-2.5'); - - $this->assertTrue($ts->isNext('T_FLOAT')); - } - - public function testTokenizeMustRecognizeFloatTokenWhenThereIsANumberWithExponent() - { - $ts = $this->lexer->tokenize('5e+22'); - - $this->assertTrue($ts->isNext('T_FLOAT')); - } - - public function testTokenizeMustRecognizeFloatTokenWhenThereIsANumberWithExponentAndUnderscoreSeparator() - { - $ts = $this->lexer->tokenize('1e1_000'); - - $this->assertTrue($ts->isNext('T_FLOAT')); - } - - public function testTokenizeMustRecognizeFloatTokenWhenThereIsAFloatNumberWithExponent() - { - $ts = $this->lexer->tokenize('6.626e-34'); - - $this->assertTrue($ts->isNext('T_FLOAT')); - } - - public function testTokenizeMustRecognizeDataTimeTokenWhenThereIsRfc3339Datetime() - { - $ts = $this->lexer->tokenize('1979-05-27T07:32:00Z'); - - $this->assertTrue($ts->isNext('T_DATE_TIME')); - } - - public function testTokenizeMustRecognizeDataTimeTokenWhenThereIsRfc3339DatetimeWithOffset() - { - $ts = $this->lexer->tokenize('1979-05-27T00:32:00-07:00'); - - $this->assertTrue($ts->isNext('T_DATE_TIME')); - } - - public function testTokenizeMustRecognizeDataTimeTokenWhenThereIsRfc3339DatetimeWithOffsetSecondFraction() - { - $ts = $this->lexer->tokenize('1979-05-27T00:32:00.999999-07:00'); - - $this->assertTrue($ts->isNext('T_DATE_TIME')); - } - - public function testTokenizeMustRecognizeQuotationMark() - { - $ts = $this->lexer->tokenize('"'); - - $this->assertTrue($ts->isNext('T_QUOTATION_MARK')); - } - - public function testTokenizeMustRecognize3QuotationMark() - { - $ts = $this->lexer->tokenize('"""'); - - $this->assertTrue($ts->isNextSequence(['T_3_QUOTATION_MARK', 'T_EOS'])); - } - - public function testTokenizeMustRecognizeApostrophe() - { - $ts = $this->lexer->tokenize("'"); - - $this->assertTrue($ts->isNext('T_APOSTROPHE')); - } - - public function testTokenizeMustRecognize3Apostrophe() - { - $ts = $this->lexer->tokenize("'''"); - - $this->assertTrue($ts->isNext('T_3_APOSTROPHE')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsBackspace() - { - $ts = $this->lexer->tokenize('\b'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsTab() - { - $ts = $this->lexer->tokenize('\t'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsLinefeed() - { - $ts = $this->lexer->tokenize('\n'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsFormfeed() - { - $ts = $this->lexer->tokenize('\f'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsCarriageReturn() - { - $ts = $this->lexer->tokenize('\r'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsQuote() - { - $ts = $this->lexer->tokenize('\"'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsBackslash() - { - $ts = $this->lexer->tokenize('\\\\'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsUnicodeUsingFourCharacters() - { - $ts = $this->lexer->tokenize('\u00E9'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeEscapedCharacterWhenThereIsUnicodeUsingEightCharacters() - { - $ts = $this->lexer->tokenize('\U00E90000'); - - $this->assertTrue($ts->isNext('T_ESCAPED_CHARACTER')); - } - - public function testTokenizeMustRecognizeBasicUnescapedString() - { - $ts = $this->lexer->tokenize('@text'); - - $this->assertTrue($ts->isNextSequence([ - 'T_BASIC_UNESCAPED', - 'T_EOS' - ])); - } - - public function testTokenizeMustRecognizeHash() - { - $ts = $this->lexer->tokenize('#'); - - $this->assertTrue($ts->isNext('T_HASH')); - } - - public function testTokenizeMustRecognizeEscape() - { - $ts = $this->lexer->tokenize('\\'); - - $this->assertTrue($ts->isNextSequence(['T_ESCAPE', 'T_EOS'])); - } - - public function testTokenizeMustRecognizeEscapeAndEscapedCharacter() - { - $ts = $this->lexer->tokenize('\\ \b'); - - $this->assertTrue($ts->isNextSequence([ - 'T_ESCAPE', - 'T_SPACE', - 'T_ESCAPED_CHARACTER', - 'T_EOS' - ])); - } - - public function testTokenizeMustRecognizeLeftSquareBraket() - { - $ts = $this->lexer->tokenize('['); - - $this->assertTrue($ts->isNext('T_LEFT_SQUARE_BRAKET')); - } - - public function testTokenizeMustRecognizeRightSquareBraket() - { - $ts = $this->lexer->tokenize(']'); - - $this->assertTrue($ts->isNext('T_RIGHT_SQUARE_BRAKET')); - } - - public function testTokenizeMustRecognizeDot() - { - $ts = $this->lexer->tokenize('.'); - - $this->assertTrue($ts->isNext('T_DOT')); - } - - public function testTokenizeMustRecognizeLeftCurlyBrace() - { - $ts = $this->lexer->tokenize('{'); - - $this->assertTrue($ts->isNext('T_LEFT_CURLY_BRACE')); - } - - public function testTokenizeMustRecognizeRightCurlyBrace() - { - $ts = $this->lexer->tokenize('}'); - - $this->assertTrue($ts->isNext('T_RIGHT_CURLY_BRACE')); - } -} diff --git a/vendor/yosymfony/toml/tests/ParserInvalidTest.php b/vendor/yosymfony/toml/tests/ParserInvalidTest.php deleted file mode 100644 index 60e7a50..0000000 --- a/vendor/yosymfony/toml/tests/ParserInvalidTest.php +++ /dev/null @@ -1,575 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\tests; - -use PHPUnit\Framework\TestCase; -use Yosymfony\Toml\Parser; -use Yosymfony\Toml\Lexer; - -class ParserInvalidTest extends TestCase -{ - private $parser; - - public function setUp() - { - $this->parser = new Parser(new Lexer()); - } - - public function tearDown() - { - $this->parser = null; - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_EQUAL" at line 1 with value "=". - */ - public function testKeyEmpty() - { - $this->parser->parse('= 1'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_HASH" at line 1 with value "#". - */ - public function testParseMustFailWhenKeyHash() - { - $this->parser->parse('a# = 1'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_NEWLINE" at line 1 - */ - public function testParseMustFailWhenKeyNewline() - { - $this->parser->parse("a\n= 1"); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage The key "dupe" has already been defined previously. - */ - public function testDuplicateKeys() - { - $toml = <<<'toml' - dupe = false - dupe = true -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_SPACE" at line 1 - */ - public function testParseMustFailWhenKeyOpenBracket() - { - $this->parser->parse('[abc = 1'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_EOS" at line 1 - */ - public function testParseMustFailWhenKeySingleOpenBracket() - { - $this->parser->parse('['); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "b". - */ - public function testParseMustFailWhenKeySpace() - { - $this->parser->parse('a b = 1'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_SPACE" at line 2 with value " ". - */ - public function testParseMustFailWhenKeyStartBracket() - { - $this->parser->parse("[a]\n[xyz = 5\n[b]"); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_EQUAL" at line 1 with value "=". - */ - public function testParseMustFailWhenKeyTwoEquals() - { - $this->parser->parse('key= = 1'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "the". - */ - public function testParseMustFailWhenTextAfterInteger() - { - $this->parser->parse('answer = 42 the ultimate answer?'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Invalid integer number: leading zeros are not allowed. Token: "T_INTEGER" line: 1 value "042". - */ - public function testParseMustFailWhenIntegerLeadingZeros() - { - $this->parser->parse('answer = 042'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "_42". - */ - public function testParseMustFailWhenIntegerLeadingUnderscore() - { - $this->parser->parse('answer = _42'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Invalid integer number: underscore must be surrounded by at least one digit. - */ - public function testParseMustFailWhenIntegerFinalUnderscore() - { - $this->parser->parse('answer = 42_'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Invalid integer number: leading zeros are not allowed. Token: "T_INTEGER" line: 1 value "0_42". - */ - public function testParseMustFailWhenIntegerLeadingZerosWithUnderscore() - { - $this->parser->parse('answer = 0_42'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_DOT" at line 1 with value ".". - */ - public function testParseMustFailWhenFloatNoLeadingZero() - { - $toml = <<<'toml' - answer = .12345 - neganswer = -.12345 -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_DOT" at line 1 with value ".". - */ - public function testParseMustFailWhenFloatNoTrailingDigits() - { - $toml = <<<'toml' - answer = 1. - neganswer = -1. -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "_1". - */ - public function testParseMustFailWhenFloatLeadingUnderscore() - { - $this->parser->parse('number = _1.01'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Invalid float number: underscore must be surrounded by at least one digit. - */ - public function testParseMustFailWhenFloatFinalUnderscore() - { - $this->parser->parse('number = 1.01_'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Invalid float number: underscore must be surrounded by at least one digit. - */ - public function testParseMustFailWhenFloatUnderscorePrefixE() - { - $this->parser->parse('number = 1_e6'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "e_6". - */ - public function testParseMustFailWhenFloatUnderscoreSufixE() - { - $this->parser->parse('number = 1e_6'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_INTEGER" at line 1 with value "-7". - */ - public function testParseMustFailWhenDatetimeMalformedNoLeads() - { - $this->parser->parse('no-leads = 1987-7-05T17:45:00Z'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "T17". - */ - public function testParseMustFailWhenDatetimeMalformedNoSecs() - { - $this->parser->parse('no-secs = 1987-07-05T17:45Z'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_INTEGER" at line 1 with value "17". - */ - public function testParseMustFailWhenDatetimeMalformedNoT() - { - $this->parser->parse('no-t = 1987-07-0517:45:00Z'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_INTEGER" at line 1 with value "-07". - */ - public function testParseMustFailWhenDatetimeMalformedWithMilli() - { - $this->parser->parse('with-milli = 1987-07-5T17:45:00.12Z'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_ESCAPE" at line 1 with value "\". This character is not valid. - */ - public function testParseMustFailWhenBasicStringHasBadByteEscape() - { - $this->parser->parse('naughty = "\xAg"'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_ESCAPE" at line 1 with value "\". This character is not valid. - */ - public function testParseMustFailWhenBasicStringHasBadEscape() - { - $this->parser->parse('invalid-escape = "This string has a bad \a escape character."'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_ESCAPE" at line 1 with value "\". This character is not valid. - */ - public function testParseMustFailWhenBasicStringHasByteEscapes() - { - $this->parser->parse('answer = "\x33"'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_EOS" at line 1 with value "". This character is not valid. - */ - public function testParseMustFailWhenBasicStringIsNotClose() - { - $this->parser->parse('no-ending-quote = "One time, at band camp'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "No". Expected T_NEWLINE or T_EOS. - */ - public function testParseMustFailWhenThereIsTextAfterBasicString() - { - $this->parser->parse('string = "Is there life after strings?" No.'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Data types cannot be mixed in an array. Value: "1". - */ - public function testParseMustFailWhenThereIsAnArrayWithMixedTypesArraysAndInts() - { - $this->parser->parse('arrays-and-ints = [1, ["Arrays are not integers."]]'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Data types cannot be mixed in an array. Value: "1.1". - */ - public function testParseMustFailWhenThereIsAnArrayWithMixedTypesIntsAndFloats() - { - $this->parser->parse('ints-and-floats = [1, 1.1]'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Data types cannot be mixed in an array. Value: "42". - */ - public function testParseMustFailWhenThereIsAnArrayWithMixedTypesStringsAndInts() - { - $this->parser->parse('strings-and-ints = ["hi", 42]'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 2 with value "No". - */ - public function testParseMustFailWhenAppearsTextAfterArrayEntries() - { - $toml = <<<'toml' - array = [ - "Is there life after an array separator?", No - "Entry" - ] -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 2 with value "No". - */ - public function testParseMustFailWhenAppearsTextBeforeArraySeparator() - { - $toml = <<<'toml' - array = [ - "Is there life before an array separator?" No, - "Entry" - ] -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 3 with value "I". - */ - public function testParseMustFailWhenAppearsTextInArray() - { - $toml = <<<'toml' - array = [ - "Entry 1", - I don't belong, - "Entry 2", - ] -toml; - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage The key "fruit.type" has already been defined previously. - */ - public function testParseMustFailWhenDuplicateKeyTable() - { - $toml = <<<'toml' - [fruit] - type = "apple" - - [fruit.type] - apple = "yes" -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage The key "a" has already been defined previously. - */ - public function testParseMustFailWhenDuplicateTable() - { - $toml = <<<'toml' - [a] - [a] -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_RIGHT_SQUARE_BRAKET" at line 1 with value "]". - */ - public function testParseMustFailWhenTableEmpty() - { - $this->parser->parse('[]'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_SPACE" at line 1 with value " ". - */ - public function testParseMustFailWhenTableWhitespace() - { - $this->parser->parse('[invalid key]'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_DOT" at line 1 with value ".". - */ - public function testParseMustFailWhenEmptyImplicitTable() - { - $this->parser->parse('[naughty..naughty]'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_HASH" at line 1 with value "#". - */ - public function testParseMustFailWhenTableWithPound() - { - $this->parser->parse("[key#group]\nanswer = 42"); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "this". - */ - public function testParseMustFailWhenTextAfterTable() - { - $this->parser->parse('[error] this shouldn\'t be here'); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_LEFT_SQUARE_BRAKET" at line 1 with value "[". - */ - public function testParseMustFailWhenTableNestedBracketsOpen() - { - $toml = <<<'toml' - [a[b] - zyx = 42 -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_UNQUOTED_KEY" at line 1 with value "b". - */ - public function testParseMustFailWhenTableNestedBracketsClose() - { - $toml = <<<'toml' - [a]b] - zyx = 42 -toml; - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_NEWLINE" at line 1 - */ - public function testParseMustFailWhenInlineTableWithNewline() - { - $toml = <<<'toml' - name = { first = "Tom", - last = "Preston-Werner" - } -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage The key "fruit.variety" has already been defined previously. - */ - public function testParseMustFailWhenTableArrayWithSomeNameOfTable() - { - $toml = <<<'toml' - [[fruit]] - name = "apple" - - [[fruit.variety]] - name = "red delicious" - - # This table conflicts with the previous table - [fruit.variety] - name = "granny smith" -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_RIGHT_SQUARE_BRAKET" at line 1 with value "]". - */ - public function testParseMustFailWhenTableArrayMalformedEmpty() - { - $toml = <<<'toml' - [[]] - name = "Born to Run" -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage Syntax error: unexpected token "T_NEWLINE" at line 1 - */ - public function testParseMustFailWhenTableArrayMalformedBracket() - { - $toml = <<<'toml' - [[albums] - name = "Born to Run" -toml; - - $this->parser->parse($toml); - } - - /** - * @expectedException Yosymfony\ParserUtils\SyntaxErrorException - * @expectedExceptionMessage The array of tables "albums" has already been defined as previous table - */ - public function testParseMustFailWhenTableArrayImplicit() - { - $toml = <<<'toml' - # This test is a bit tricky. It should fail because the first use of - # `[[albums.songs]]` without first declaring `albums` implies that `albums` - # must be a table. The alternative would be quite weird. Namely, it wouldn't - # comply with the TOML spec: "Each double-bracketed sub-table will belong to - # the most *recently* defined table element *above* it." - # - # This is in contrast to the *valid* test, table-array-implicit where - # `[[albums.songs]]` works by itself, so long as `[[albums]]` isn't declared - # later. (Although, `[albums]` could be.) - [[albums.songs]] - name = "Glory Days" - - [[albums]] - name = "Born in the USA" -toml; - - $this->parser->parse($toml); - } -} diff --git a/vendor/yosymfony/toml/tests/ParserTest.php b/vendor/yosymfony/toml/tests/ParserTest.php deleted file mode 100644 index 5557667..0000000 --- a/vendor/yosymfony/toml/tests/ParserTest.php +++ /dev/null @@ -1,936 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\tests; - -use PHPUnit\Framework\TestCase; -use Yosymfony\Toml\Parser; -use Yosymfony\Toml\Lexer; - -class ParserTest extends TestCase -{ - private $parser; - - public function setUp() - { - $this->parser = new Parser(new Lexer()); - } - - public function tearDown() - { - $this->parser = null; - } - - public function testParseMustReturnAnEmptyArrayWhenEmptyInput() - { - $array = $this->parser->parse(''); - - $this->assertEquals([], $array); - } - - public function testParseMustParseBooleans() - { - $toml = <<<'toml' - t = true - f = false -toml; - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 't' => true, - 'f' => false, - ], $array); - } - - public function testParseMustParseIntegers() - { - $toml = <<<'toml' - answer = 42 - neganswer = -42 - positive = +90 - underscore = 1_2_3_4_5 -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'answer' => 42, - 'neganswer' => -42, - 'positive' => 90, - 'underscore' => 12345, - ], $array); - } - - public function testParseMustParseLongIntegers() - { - $toml = <<<'toml' - answer = 9223372036854775807 - neganswer = -9223372036854775808 -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'answer' => 9223372036854775807, - 'neganswer' => -9223372036854775808, - ], $array); - } - - public function testParseMustParseFloats() - { - $toml = <<<'toml' - pi = 3.14 - negpi = -3.14 - positive = +1.01 - exponent1 = 5e+22 - exponent2 = 1e6 - exponent3 = -2E-2 - exponent4 = 6.626e-34 - underscore = 6.6_26e-3_4 -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'pi' => 3.14, - 'negpi' => -3.14, - 'positive' => 1.01, - 'exponent1' => 4.9999999999999996E+22, - 'exponent2' => 1000000.0, - 'exponent3' => -0.02, - 'exponent4' => 6.6259999999999998E-34, - 'underscore' => 6.6259999999999998E-34, - ], $array); - } - - public function testParseMustParseLongFloats() - { - $toml = <<<'toml' - longpi = 3.141592653589793 - neglongpi = -3.141592653589793 -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'longpi' => 3.141592653589793, - 'neglongpi' => -3.141592653589793 - ], $array); - } - - public function testParseMustParseBasicStringsWithASimpleString() - { - $array = $this->parser->parse('answer = "You are not drinking enough whisky."'); - - $this->assertEquals([ - 'answer' => 'You are not drinking enough whisky.', - ], $array); - } - - public function testParseMustParseAnEmptyString() - { - $array = $this->parser->parse('answer = ""'); - - $this->assertEquals([ - 'answer' => '', - ], $array); - } - - public function testParseMustParseStringsWithEscapedCharacters() : void - { - $toml = <<<'toml' - backspace = "This string has a \b backspace character." - tab = "This string has a \t tab character." - newline = "This string has a \n new line character." - formfeed = "This string has a \f form feed character." - carriage = "This string has a \r carriage return character." - quote = "This string has a \" quote character." - backslash = "This string has a \\ backslash character." - notunicode1 = "This string does not have a unicode \\u escape." - notunicode2 = "This string does not have a unicode \\u0075 escape." -toml; - - $array = $this->parser->parse($toml); - $this->assertEquals([ - 'backspace' => "This string has a \b backspace character.", - 'tab' => "This string has a \t tab character.", - 'newline' => "This string has a \n new line character.", - 'formfeed' => "This string has a \f form feed character.", - 'carriage' => "This string has a \r carriage return character.", - 'quote' => 'This string has a " quote character.', - 'backslash' => 'This string has a \\ backslash character.', - 'notunicode1' => 'This string does not have a unicode \\u escape.', - 'notunicode2' => 'This string does not have a unicode \\u0075 escape.', - ], $array); - } - - public function testParseMustParseStringsWithPound() - { - $toml = <<<'toml' - pound = "We see no # comments here." - poundcomment = "But there are # some comments here." # Did I # mess you up? -toml; - - $array = $this->parser->parse($toml); - $this->assertEquals([ - 'pound' => 'We see no # comments here.', - 'poundcomment' => 'But there are # some comments here.' - ], $array); - } - - public function testParseMustParseWithUnicodeCharacterEscaped() - { - $toml = <<<'toml' - answer4 = "\u03B4" - answer8 = "\U000003B4" -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'answer4' => json_decode('"\u03B4"'), - 'answer8' => json_decode('"\u0000\u03B4"'), - ], $array); - } - - public function testParseMustParseStringWithALiteralUnicodeCharacter() - { - $array = $this->parser->parse('answer = "δ"'); - - $this->assertEquals([ - 'answer' => 'δ', - ], $array); - } - - public function testParseMustParseMultilineStrings() - { - $toml = <<<'toml' - multiline_empty_one = """""" - multiline_empty_two = """ -""" - multiline_empty_three = """\ - """ - multiline_empty_four = """\ - \ - \ - """ - - equivalent_one = "The quick brown fox jumps over the lazy dog." - equivalent_two = """ -The quick brown \ - - - fox jumps over \ - the lazy dog.""" - - equivalent_three = """\ - The quick brown \ - fox jumps over \ - the lazy dog.\ - """ -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'multiline_empty_one' => '', - 'multiline_empty_two' => '', - 'multiline_empty_three' => '', - 'multiline_empty_four' => '', - 'equivalent_one' => 'The quick brown fox jumps over the lazy dog.', - 'equivalent_two' => 'The quick brown fox jumps over the lazy dog.', - 'equivalent_three' => 'The quick brown fox jumps over the lazy dog.', - ], $array); - } - - public function testParseMustParseLiteralStrings() - { - $toml = <<<'toml' - backspace = 'This string has a \b backspace character.' - tab = 'This string has a \t tab character.' - newline = 'This string has a \n new line character.' - formfeed = 'This string has a \f form feed character.' - carriage = 'This string has a \r carriage return character.' - slash = 'This string has a \/ slash character.' - backslash = 'This string has a \\ backslash character.' -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'backspace' => 'This string has a \b backspace character.', - 'tab' => 'This string has a \t tab character.', - 'newline' => 'This string has a \n new line character.', - 'formfeed' => 'This string has a \f form feed character.', - 'carriage' => 'This string has a \r carriage return character.', - 'slash' => 'This string has a \/ slash character.', - 'backslash' => 'This string has a \\\\ backslash character.', - ], $array); - } - - public function testParseMustParseMultilineLiteralStrings() - { - $toml = <<<'toml' - oneline = '''This string has a ' quote character.''' - firstnl = ''' -This string has a ' quote character.''' -multiline = ''' -This string -has ' a quote character -and more than -one newline -in it.''' -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'oneline' => "This string has a ' quote character.", - 'firstnl' => "This string has a ' quote character.", - 'multiline' => "This string\nhas ' a quote character\nand more than\none newline\nin it.", - ], $array); - } - - public function testDatetime() - { - $toml = <<<'toml' - bestdayever = 1987-07-05T17:45:00Z - bestdayever2 = 1979-05-27T00:32:00-07:00 - bestdayever3 = 1979-05-27T00:32:00.999999-07:00 - bestdayever4 = 1979-05-27T07:32:00 - bestdayever5 = 1979-05-27T00:32:00.999999 - bestdayever6 = 1979-05-27 - -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'bestdayever' => new \Datetime('1987-07-05T17:45:00Z'), - 'bestdayever2' => new \Datetime('1979-05-27T00:32:00-07:00'), - 'bestdayever3' => new \Datetime('1979-05-27T00:32:00.999999-07:00'), - 'bestdayever4' => new \Datetime('1979-05-27T07:32:00'), - 'bestdayever5' => new \Datetime('1979-05-27T00:32:00.999999'), - 'bestdayever6' => new \Datetime('1979-05-27'), - ], $array); - } - - public function testParseMustParseArraysWithNoSpaces() - { - $array = $this->parser->parse('ints = [1,2,3]'); - - $this->assertEquals([ - 'ints' => [1,2,3], - ], $array); - } - - public function testParseMustParseHeterogeneousArrays() - { - $array = $this->parser->parse('mixed = [[1, 2], ["a", "b"], [1.1, 2.1]]'); - - $this->assertEquals([ - 'mixed' => [ - [1,2], - ['a', 'b'], - [1.1, 2.1], - ], - ], $array); - } - - public function testParseMustParseArraysNested() - { - $array = $this->parser->parse('nest = [["a"], ["b"]]'); - - $this->assertEquals([ - 'nest' => [ - ['a'], - ['b'] - ], - ], $array); - } - - public function testArrayEmpty() - { - $array = $this->parser->parse('thevoid = [[[[[]]]]]'); - - $this->assertEquals([ - 'thevoid' => [ - [ - [ - [ - [], - ], - ], - ], - ], - ], $array); - } - - public function testParseMustParseArrays() - { - $toml = <<<'toml' - ints = [1, 2, 3] - floats = [1.1, 2.1, 3.1] - strings = ["a", "b", "c"] - allStrings = ["all", 'strings', """are the same""", '''type'''] - MultilineBasicString = ["all", """ -Roses are red -Violets are blue""",] - dates = [ - 1987-07-05T17:45:00Z, - 1979-05-27T07:32:00Z, - 2006-06-01T11:00:00Z, - ] -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'ints' => [1, 2, 3], - 'floats' => [1.1, 2.1, 3.1], - 'strings' => ['a', 'b', 'c'], - 'allStrings' => ['all', 'strings', 'are the same', 'type'], - 'MultilineBasicString' => [ - 'all', - "Roses are red\nViolets are blue", - ], - 'dates' => [ - new \DateTime('1987-07-05T17:45:00Z'), - new \DateTime('1979-05-27T07:32:00Z'), - new \DateTime('2006-06-01T11:00:00Z'), - ], - ], $array); - } - - public function testParseMustParseAKeyWithoutNameSpacesAroundEqualSign() - { - $array = $this->parser->parse('answer=42'); - - $this->assertEquals([ - 'answer' => 42, - ], $array); - } - - public function testParseMustParseKeyWithSpace() - { - $array = $this->parser->parse('"a b" = 1'); - - $this->assertNotNull($array); - - $this->assertEquals([ - 'a b' => 1, - ], $array); - } - - public function testParseMustParseKeyWithSpecialCharacters() - { - $array = $this->parser->parse('"~!@$^&*()_+-`1234567890[]|/?><.,;:\'" = 1'); - - $this->assertEquals([ - '~!@$^&*()_+-`1234567890[]|/?><.,;:\'' => 1, - ], $array); - } - - public function testParseMustParseBareIntegerKeys() - { - $toml = <<<'toml' - [sequence] - -1 = 'detect person' - 0 = 'say hello' - 1 = 'chat' - 10 = 'say bye' -toml; - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'sequence' => [ - '-1' => 'detect person', - '0' => 'say hello', - '1' => 'chat', - '10' => 'say bye' - ] - ], $array); - } - - public function testParseMustParseAnEmptyTable() - { - $array = $this->parser->parse('[a]'); - - $this->assertEquals([ - 'a' => [], - ], $array); - } - - public function testParseMustParseATableWithAWhiteSpaceInTheName() - { - $array = $this->parser->parse('["valid key"]'); - - $this->assertEquals([ - 'valid key' => [], - ], $array); - } - - public function testParseMustParseATableAQuotedName() - { - $toml = <<<'toml' - [dog."tater.man"] - type = "pug" -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'dog' => [ - 'tater.man' => [ - 'type' => 'pug', - ], - ], - ], $array); - } - - public function testParseMustParseATableWithAPoundInTheName() - { - $toml = <<<'toml' - ["key#group"] - answer = 42 -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'key#group' => [ - 'answer' => 42, - ], - ], $array); - } - - public function testParseMustParseATableAndASubtableEmpties() - { - $toml = <<<'toml' - [a] - [a.b] -toml; - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'a' => [ - 'b' => [], - ], - ], $array); - } - - public function testParseMustParseATableWithImplicitGroups() - { - $toml = <<<'toml' - [a.b.c] - answer = 42 -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'a' => [ - 'b' => [ - 'c' => [ - 'answer' => 42, - ], - ], - ], - ], $array); - } - - public function testParseMustParseAImplicitAndExplicitAfterTable() - { - $toml = <<<'toml' - [a.b.c] - answer = 42 - - [a] - better = 43 -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'a' => [ - 'better' => 43, - 'b' => [ - 'c' => [ - 'answer' => 42, - ], - ], - ], - ], $array); - } - - public function testParseMustParseImplicitAndExplicitTableBefore() - { - $toml = <<<'toml' - [a] - better = 43 - - [a.b.c] - answer = 42 -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'a' => [ - 'better' => 43, - 'b' => [ - 'c' => [ - 'answer' => 42, - ], - ], - ], - ], $array); - } - - public function testParseMustParseInlineTableEmpty() - { - $array = $this->parser->parse('name = {}'); - - $this->assertEquals([ - 'name' => [], - ], $array); - } - - public function testParseMustParseInlineTableOneElement() - { - $array = $this->parser->parse('name = { first = "Tom" }'); - - $this->assertEquals([ - 'name' => [ - 'first' => 'Tom' - ], - ], $array); - } - - public function testParseMustParseAnInlineTableDefinedInATable() - { - $toml = <<<'toml' - [tab1] - key1 = {name='Donald Duck'} -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'tab1' => [ - 'key1' => [ - 'name' => 'Donald Duck' - ], - ], - ], $array); - } - - public function testParseMustParseInlineTableExamples() - { - $toml = <<<'toml' -name = { first = "Tom", last = "Preston-Werner" } -point = { x = 1, y = 2 } -strings = { key1 = """ -Roses are red -Violets are blue""", key2 = """ -The quick brown \ - - - fox jumps over \ - the lazy dog.""" } -inline = { x = 1, y = { a = 2, "b.deep" = 'my value' } } -another = {number = 1} -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'name' => [ - 'first' => 'Tom', - 'last' => 'Preston-Werner', - ], - 'point' => [ - 'x' => 1, - 'y' => 2, - ], - 'strings' => [ - 'key1' => "Roses are red\nViolets are blue", - 'key2' => 'The quick brown fox jumps over the lazy dog.', - ], - 'inline' => [ - 'x' => 1, - 'y' => [ - 'a' => 2, - 'b.deep' => 'my value', - ], - ], - 'another' => [ - 'number' => 1, - ], - ], $array); - } - - public function testParseMustParseTableArrayImplicit() - { - $toml = <<<'toml' - [[albums.songs]] - name = "Glory Days" -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'albums' => [ - 'songs' => [ - [ - 'name' => 'Glory Days' - ], - ], - ], - ], $array); - } - - public function testParseMustParseTableArrayOne() - { - $toml = <<<'toml' - [[people]] - first_name = "Bruce" - last_name = "Springsteen" -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'people' => [ - [ - 'first_name' => 'Bruce', - 'last_name' => 'Springsteen', - ], - ], - ], $array); - } - - public function testParseMustParseTableArrayMany() - { - $toml = <<<'toml' - [[people]] - first_name = "Bruce" - last_name = "Springsteen" - - [[people]] - first_name = "Eric" - last_name = "Clapton" - - [[people]] - first_name = "Bob" - last_name = "Seger" -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'people' => [ - [ - 'first_name' => 'Bruce', - 'last_name' => 'Springsteen', - ], - [ - 'first_name' => 'Eric', - 'last_name' => 'Clapton', - ], - [ - 'first_name' => 'Bob', - 'last_name' => 'Seger', - ], - ], - ], $array); - } - - public function testParseMustParseTableArrayNest() - { - $toml = <<<'toml' - [[albums]] - name = "Born to Run" - - [[albums.songs]] - name = "Jungleland" - - [[albums.songs]] - name = "Meeting Across the River" - - [[albums]] - name = "Born in the USA" - - [[albums.songs]] - name = "Glory Days" - - [[albums.songs]] - name = "Dancing in the Dark" -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'albums' => [ - [ - 'name' => 'Born to Run', - 'songs' => [ - ['name' => 'Jungleland'], - ['name' => 'Meeting Across the River'], - ], - ], - [ - 'name' => 'Born in the USA', - 'songs' => [ - ['name' => 'Glory Days'], - ['name' => 'Dancing in the Dark'], - ], - ], - ], - ], $array); - } - - /** - * @see https://github.com/yosymfony/toml/issues/12 - */ - public function testParseMustParseATableAndArrayOfTables() - { - $toml = <<<'toml' - [fruit] - name = "apple" - - [[fruit.variety]] - name = "red delicious" - - [[fruit.variety]] - name = "granny smith" -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'fruit' => [ - 'name' => 'apple', - 'variety' => [ - ['name' => 'red delicious'], - ['name' => 'granny smith'], - ], - ], - ], $array); - } - - /** - * @see https://github.com/yosymfony/toml/issues/23 - */ - public function testParseMustParseTablesContainedWithinArrayTables() - { - $toml = <<<'toml' - [[tls]] - entrypoints = ["https"] - [tls.certificate] - certFile = "certs/foo.crt" - keyFile = "keys/foo.key" - - [[tls]] - entrypoints = ["https"] - [tls.certificate] - certFile = "certs/bar.crt" - keyFile = "keys/bar.key" -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'tls' => [ - [ - 'entrypoints' => ['https'], - 'certificate' => [ - 'certFile' => 'certs/foo.crt', - 'keyFile' => 'keys/foo.key', - ], - - ], - [ - 'entrypoints' => ['https'], - 'certificate' => [ - 'certFile' => 'certs/bar.crt', - 'keyFile' => 'keys/bar.key', - ], - - ], - ], - ], $array); - } - - public function testParseMustParseCommentsEverywhere() - { - $toml = <<<'toml' - # Top comment. - # Top comment. - # Top comment. - - # [no-extraneous-groups-please] - - [group] # Comment - answer = 42 # Comment - # no-extraneous-keys-please = 999 - # Inbetween comment. - more = [ # Comment - # What about multiple # comments? - # Can you handle it? - # - # Evil. - # Evil. - 42, 42, # Comments within arrays are fun. - # What about multiple # comments? - # Can you handle it? - # - # Evil. - # Evil. - # ] Did I fool you? - ] # Hopefully not. -toml; - - $array = $this->parser->parse($toml); - - $this->assertNotNull($array); - - $this->assertArrayHasKey('answer', $array['group']); - $this->assertArrayHasKey('more', $array['group']); - - $this->assertEquals($array['group']['answer'], 42); - $this->assertEquals($array['group']['more'][0], 42); - $this->assertEquals($array['group']['more'][1], 42); - } - - public function testParseMustParseASimpleExample() - { - $toml = <<<'toml' - best-day-ever = 1987-07-05T17:45:00Z - emptyName = "" - - [numtheory] - boring = false - perfection = [6, 28, 496] -toml; - - $array = $this->parser->parse($toml); - - $this->assertEquals([ - 'best-day-ever' => new \DateTime('1987-07-05T17:45:00Z'), - 'emptyName' => '', - 'numtheory' => [ - 'boring' => false, - 'perfection' => [6, 28, 496], - ], - ], $array); - } -} diff --git a/vendor/yosymfony/toml/tests/TomlArrayTest.php b/vendor/yosymfony/toml/tests/TomlArrayTest.php deleted file mode 100644 index 5d27f2b..0000000 --- a/vendor/yosymfony/toml/tests/TomlArrayTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\tests; - -use PHPUnit\Framework\TestCase; -use Yosymfony\Toml\TomlArray; - -class TomlArrayTest extends TestCase -{ - /** @var TomlArray */ - private $tomlArray; - - public function setUp() - { - $this->tomlArray = new TomlArray(); - } - - public function tearDown() - { - $this->tomlArray = null; - } - - public function testGetArrayMustReturnTheKeyValueAdded() : void - { - $this->tomlArray->addKeyValue('company', 'acme'); - - $this->assertEquals([ - 'company' => 'acme' - ], $this->tomlArray->getArray()); - } - - public function testGetArrayMustReturnTheTableWithTheKeyValue() : void - { - $this->tomlArray->addTableKey('companyData'); - $this->tomlArray->addKeyValue('company', 'acme'); - - $this->assertEquals([ - 'companyData' => [ - 'company' => 'acme' - ], - ], $this->tomlArray->getArray()); - } - - public function testGetArrayMustReturnAnArrayOfTables() : void - { - $this->tomlArray->addArrayTableKey('companyData'); - $this->tomlArray->addKeyValue('company', 'acme1'); - $this->tomlArray->addArrayTableKey('companyData'); - $this->tomlArray->addKeyValue('company', 'acme2'); - - $this->assertEquals([ - 'companyData' => [ - [ - 'company' => 'acme1' - ], - [ - 'company' => 'acme2' - ], - ] - ], $this->tomlArray->getArray()); - } -} diff --git a/vendor/yosymfony/toml/tests/TomlBuilderInvalidTest.php b/vendor/yosymfony/toml/tests/TomlBuilderInvalidTest.php deleted file mode 100644 index 615134c..0000000 --- a/vendor/yosymfony/toml/tests/TomlBuilderInvalidTest.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\tests; - -use PHPUnit\Framework\TestCase; -use Yosymfony\Toml\TomlBuilder; - -class TomlBuilderInvalidTest extends TestCase -{ - private $builder; - - public function setUp() : void - { - $this->builder = new TomlBuilder(); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage A key, table name or array of table name cannot be empty or null. - */ - public function testAddValueMustFailWhenEmptyKey() - { - $this->builder->addValue('', 'value'); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage A key, table name or array of table name cannot be empty or null. - */ - public function testAddTableMustFailWhenEmptyKey() - { - $this->builder->addTable(''); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage A key, table name or array of table name cannot be empty or null. - */ - public function testAddArrayOfTableMustFailWhenEmptyKey() - { - $this->builder->addArrayOfTable(''); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage A key, table name or array of table name cannot be empty or null. - */ - public function testAddValueMustFailWhenKeyWithJustWhiteSpaces() - { - $whiteSpaceKey = ' '; - - $this->builder->addValue($whiteSpaceKey, 'value'); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage A key, table name or array of table name cannot be empty or null. - */ - public function testAddTableMustFailWhenKeyWithJustWhiteSpaces() - { - $whiteSpaceKey = ' '; - - $this->builder->addTable($whiteSpaceKey); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage A key, table name or array of table name cannot be empty or null. - */ - public function testAddArrayOfTableMustFailWhenKeyWithJustWhiteSpaces() - { - $whiteSpaceKey = ' '; - - $this->builder->addArrayOfTable($whiteSpaceKey); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage Data types cannot be mixed in an array. Key: "strings-and-ints". - */ - public function testAddValueMustFailWhenMixedTypes() - { - $this->builder->addValue('strings-and-ints', ["uno", 1]); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage The table key "a" has already been defined previously. - */ - public function testAddTableMustFailWhenDuplicateTables() - { - $this->builder->addTable('a') - ->addTable('a'); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage The table key "fruit.type" has already been defined previously. - */ - public function testAddTableMustFailWhenDuplicateKeyTable() - { - $this->builder->addTable('fruit') - ->addValue('type', 'apple') - ->addTable('fruit.type'); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage The key "dupe" has already been defined previously. - */ - public function testAddValueMustFailWhenDuplicateKeys() - { - $this->builder->addValue('dupe', false) - ->addValue('dupe', true); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage A key, table name or array of table name cannot be empty or null. Table: "naughty..naughty". - */ - public function testEmptyImplicitKeyGroup() - { - $this->builder->addTable('naughty..naughty'); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage Data type not supporter at the key: "theNull". - */ - public function testAddValueMustFailWithNullValue() - { - $this->builder->addValue('theNull', null); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage Data type not supporter at the key: "theNewClass". - */ - public function testAddValueMustFailWithUnsuportedValueType() - { - $this->builder->addValue('theNewClass', new class { - }); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage The key "albums" has been defined as a implicit table from a previous array of tables. - */ - public function testaddArrayOfTableMustFailWhenThereIsATableArrayImplicit() - { - $this->builder->addArrayOfTable('albums.songs') - ->addValue('name', 'Glory Days') - ->addArrayOfTable('albums') - ->addValue('name', 'Born in the USA'); - } - - /** - * @expectedException Yosymfony\Toml\Exception\DumpException - * @expectedExceptionMessage Only unquoted keys are allowed in this implementation. Key: "valid key". - */ - public function testAddTableMustFailWithNoUnquotedKeys() - { - $this->builder->addTable('valid key'); - } -} diff --git a/vendor/yosymfony/toml/tests/TomlBuilderTest.php b/vendor/yosymfony/toml/tests/TomlBuilderTest.php deleted file mode 100644 index 1aed828..0000000 --- a/vendor/yosymfony/toml/tests/TomlBuilderTest.php +++ /dev/null @@ -1,208 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\tests; - -use PHPUnit\Framework\TestCase; -use Yosymfony\Toml\TomlBuilder; -use Yosymfony\Toml\Toml; - -class TomlBuilderTest extends TestCase -{ - public function testExample() - { - $tb = new TomlBuilder(); - - $result = $tb->addComment('Toml file') - ->addTable('data.string') - ->addValue('name', 'Toml', 'This is your name') - ->addValue('newline', "This string has a \n new line character.") - ->addValue('winPath', 'C:\\Users\\nodejs\\templates') - ->addValue('unicode', 'unicode character: '.json_decode('"\u03B4"')) - ->addTable('data.bool') - ->addValue('t', true) - ->addValue('f', false) - ->addTable('data.integer') - ->addValue('positive', 25, 'Comment inline.') - ->addValue('negative', -25) - ->addTable('data.float') - ->addValue('positive', 25.25) - ->addValue('negative', -25.25) - ->addTable('data.datetime') - ->addValue('datetime', new \Datetime()) - ->addComment('Related to arrays') - ->addTable('data.array') - ->addValue('simple', array(1, 2, 3)) - ->addValue('multiple', array(array(1, 2), array('abc', 'def'), array(1.1, 1.2), array(true, false), array(new \Datetime()))) - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testArrayEmpty() - { - $tb = new TomlBuilder(); - - $result = $tb->addComment('Toml file') - ->addValue('thevoid', array()) - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testImplicitAndExplicitAfter() - { - $tb = new TomlBuilder(); - - $result = $tb->addTable('a.b.c') - ->addValue('answer', 42) - ->addTable('a') - ->addValue('better', 43) - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testImplicitAndExplicitBefore() - { - $tb = new TomlBuilder(); - - $result = $tb->addTable('a') - ->addValue('better', 43) - ->addTable('a.b.c') - ->addValue('answer', 42) - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testTableEmpty() - { - $tb = new TomlBuilder(); - - $result = $tb->addTable('a') - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testTableSubEmpty() - { - $tb = new TomlBuilder(); - - $result = $tb->addTable('a') - ->addTable('a.b') - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testKeyWhitespace() - { - $tb = new TomlBuilder(); - - $result = $tb->addValue('valid key', 2) - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testStringEscapesDoubleQuote() - { - $tb = new TomlBuilder(); - - $result = $tb->addValue('backspace', "This string has a \b backspace character.") - ->addValue('tab', "This string has a \t tab character.") - ->addValue('newline', "This string has a \n new line character.") - ->addValue('formfeed', "This string has a \f form feed character.") - ->addValue('carriage', "This string has a \r carriage return character.") - ->addValue('quote', 'This string has a " quote character.') - ->addValue('slash', "This string has a / slash character.") - ->addValue('backslash', 'This string has a \\ backslash character.') - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testKeyLiteralString() - { - $tb = new TomlBuilder(); - - $result = $tb->addValue('regex', "@<\i\c*\s*>") - ->getTomlString(); - - $array = Toml::Parse($result); - - $this->assertNotNull($array); - - $this->assertEquals('<\i\c*\s*>', $array['regex']); - } - - public function testKeyLiteralStringEscapingAt() - { - $tb = new TomlBuilder(); - - $result = $tb->addValue('regex', "@@<\i\c*\s*>") - ->getTomlString(); - - $array = Toml::Parse($result); - - $this->assertNotNull($array); - - $this->assertEquals('@<\i\c*\s*>', $array['regex']); - } - - public function testKeySpecialChars() - { - $tb = new TomlBuilder(); - - $result = $tb->addValue('~!@$^&*()_+-`1234567890[]|/?><.,;:\'', 1) - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testStringEscapesSingleQuote() - { - $tb = new TomlBuilder(); - - $result = $tb->addValue('backspace', 'This string has a \b backspace character.') - ->addValue('tab', 'This string has a \t tab character.') - ->addValue('newline', 'This string has a \n new line character.') - ->addValue('formfeed', 'This string has a \f form feed character.') - ->addValue('carriage', 'This string has a \r carriage return character.') - ->addValue('quote', 'This string has a \" quote character.') - ->addValue('slash', 'This string has a \/ slash character.') - ->addValue('backslash', 'This string has a \\ backslash character.') - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } - - public function testArrayOfTables() - { - $tb = new TomlBuilder(); - - $result = $tb->addArrayOfTable('fruit') - ->addValue('name', 'apple') - ->addArrayOfTable('fruit.variety') - ->addValue('name', 'red delicious') - ->addArrayOfTable('fruit.variety') - ->addValue('name', 'granny smith') - ->addArrayOfTable('fruit') - ->addValue('name', 'banana') - ->addArrayOfTable('fruit.variety') - ->addValue('name', 'plantain') - ->getTomlString(); - - $this->assertNotNull(Toml::Parse($result)); - } -} diff --git a/vendor/yosymfony/toml/tests/TomlTest.php b/vendor/yosymfony/toml/tests/TomlTest.php deleted file mode 100644 index 3fc0bee..0000000 --- a/vendor/yosymfony/toml/tests/TomlTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Yosymfony\Toml\tests; - -use PHPUnit\Framework\TestCase; -use Yosymfony\Toml\Toml; - -class TomlTest extends TestCase -{ - public function testParseMustParseAString() - { - $array = Toml::parse('data = "question"'); - - $this->assertEquals([ - 'data' => 'question', - ], $array); - } - - public function testParseMustReturnEmptyArrayWhenStringEmpty() - { - $array = Toml::parse(''); - - $this->assertNull($array); - } - - public function testParseFileMustParseFile() - { - $filename = __DIR__.'/fixtures/simple.toml'; - - $array = Toml::parseFile($filename); - - $this->assertEquals([ - 'name' => 'Víctor', - ], $array); - } - - public function testParseMustReturnAnObjectWhenArgumentResultAsObjectIsTrue() - { - $actual = Toml::parse('name = "Víctor"', true); - $expected = new \stdClass(); - $expected->name = 'Víctor'; - - $this->assertEquals($expected, $actual); - } - - public function testParseFileMustReturnAnObjectWhenArgumentResultAsObjectIsTrue() - { - $filename = __DIR__.'/fixtures/simple.toml'; - - $actual = Toml::parseFile($filename, true); - $expected = new \stdClass(); - $expected->name = 'Víctor'; - - $this->assertEquals($expected, $actual); - } - - /** - * @expectedException Yosymfony\Toml\Exception\ParseException - */ - public function testParseFileMustFailWhenFilenameDoesNotExists() - { - $filename = __DIR__.'/fixtures/does-not-exists.toml'; - - Toml::parseFile($filename); - } -} diff --git a/vendor/yosymfony/toml/tests/fixtures/simple.toml b/vendor/yosymfony/toml/tests/fixtures/simple.toml deleted file mode 100644 index fd0eec0..0000000 --- a/vendor/yosymfony/toml/tests/fixtures/simple.toml +++ /dev/null @@ -1 +0,0 @@ -name = "Víctor"