diff --git a/composer.json b/composer.json index 9a3a129..18fb0e1 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "fpdf vendor for use with symfony2, based on toooni/fpdf", "keywords": [], "homepage": "http://github.com/royopa", - "license": "BSD-3", + "license": "MIT", "authors": [ { "name": "Rodrigo Prado de Jesus", @@ -13,8 +13,8 @@ ], "require": { "php": ">=5.3.3", - "setasign/fpdi-fpdf": "1.6.1", - "setasign/fpdi": "1.6.1" + "setasign/fpdi-fpdf": "~1.6", + "setasign/fpdi": "~1.6" }, "require-dev": { "phpunit/phpunit": "4.0.*" diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..687b00c --- /dev/null +++ b/composer.lock @@ -0,0 +1,780 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "47acff595e300159528f53fd1a41a234", + "packages": [ + { + "name": "setasign/fpdf", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/Setasign/FPDF.git", + "reference": "2c68c9e6c034ac3187d25968790139a73184cdb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Setasign/FPDF/zipball/2c68c9e6c034ac3187d25968790139a73184cdb1", + "reference": "2c68c9e6c034ac3187d25968790139a73184cdb1", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "fpdf.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "no usage restriction" + ], + "authors": [ + { + "name": "Olivier Plathey", + "email": "oliver@fpdf.org", + "homepage": "http://fpdf.org/" + } + ], + "description": "FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.", + "homepage": "http://www.fpdf.org", + "keywords": [ + "fpdf", + "pdf" + ], + "time": "2016-01-01T17:47:15+00:00" + }, + { + "name": "setasign/fpdi", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/Setasign/FPDI.git", + "reference": "a6ad58897a6d97cc2d2cd2adaeda343b25a368ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/a6ad58897a6d97cc2d2cd2adaeda343b25a368ea", + "reference": "a6ad58897a6d97cc2d2cd2adaeda343b25a368ea", + "shasum": "" + }, + "suggest": { + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use \"tecnickcom/tcpdf\" as an alternative there's no fixed dependency configured.", + "setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.", + "setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF." + }, + "type": "library", + "autoload": { + "classmap": [ + "filters/", + "fpdi.php", + "fpdf_tpl.php", + "fpdi_pdf_parser.php", + "pdf_context.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" + } + ], + "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", + "homepage": "https://www.setasign.com/fpdi", + "keywords": [ + "fpdf", + "fpdi", + "pdf" + ], + "time": "2017-05-11T14:25:49+00:00" + }, + { + "name": "setasign/fpdi-fpdf", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/Setasign/FPDI-FPDF.git", + "reference": "a5dda72b78253c0e9e4d644e6e3af4b94662e27e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Setasign/FPDI-FPDF/zipball/a5dda72b78253c0e9e4d644e6e3af4b94662e27e", + "reference": "a5dda72b78253c0e9e4d644e6e3af4b94662e27e", + "shasum": "" + }, + "require": { + "setasign/fpdf": "1.8.1", + "setasign/fpdi": "1.6.2" + }, + "type": "library", + "autoload": { + "classmap": [ + "fpdi_bridge.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" + } + ], + "description": "Kind of metadata package for dependencies of the latest versions of FPDI and FPDF.", + "homepage": "https://www.setasign.com/fpdi", + "keywords": [ + "fpdf", + "fpdi", + "pdf" + ], + "time": "2017-05-11T14:57:54+00:00" + } + ], + "packages-dev": [ + { + "name": "phpunit/php-code-coverage", + "version": "2.0.17", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c4e8e7725e351184a76544634855b8a9c405a6e3", + "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "~1.0", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "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": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-05-25T05:11:59+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "File/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2013-10-10T15:34:57+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.0.20", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "de121ce8708b7ac7f628603d7682d0d57f528345" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de121ce8708b7ac7f628603d7682d0d57f528345", + "reference": "de121ce8708b7ac7f628603d7682d0d57f528345", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": ">=2.0.0,<2.1.0", + "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0.2", + "phpunit/phpunit-mock-objects": ">=2.0.0,<2.1.0", + "sebastian/diff": "~1.1", + "sebastian/environment": "~1.0", + "sebastian/exporter": "~1.0.1", + "sebastian/version": "~1.0.3", + "symfony/yaml": "~2.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-05-02T07:19:37+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "e60bb929c50ae4237aaf680a4f6773f4ee17f0a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/e60bb929c50ae4237aaf680a4f6773f4ee17f0a2", + "reference": "e60bb929c50ae4237aaf680a4f6773f4ee17f0a2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": ">=4.0.0,<4.1.0" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2014-06-12T07:19:48+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.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": "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": "2014-09-10T00:51:36+00:00" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21T13:59:46+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.34", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "be720fcfae4614df204190d57795351059946a77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/be720fcfae4614df204190d57795351059946a77", + "reference": "be720fcfae4614df204190d57795351059946a77", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-01-03T07:36:31+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.3" + }, + "platform-dev": [] +} diff --git a/vendor/autoload.php b/vendor/autoload.php index dba86e4..9a9d5e0 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,6 @@ // autoload.php @generated by Composer -require_once __DIR__ . '/composer' . '/autoload_real.php'; +require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit057c8c646741cb54ad45bf25b7f621c2::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index ff6ecfb..dc02dfb 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -53,8 +53,9 @@ class ClassLoader private $useIncludePath = false; private $classMap = array(); - private $classMapAuthoritative = false; + private $missingClasses = array(); + private $apcuPrefix; public function getPrefixes() { @@ -271,6 +272,26 @@ 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 + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $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. * @@ -313,29 +334,34 @@ public function loadClass($class) */ public function findFile($class) { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } - if ($this->classMapAuthoritative) { + 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 ($file === null && defined('HHVM_VERSION')) { + if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } - if ($file === null) { + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { // Remember that this class does not exist. - return $this->classMap[$class] = false; + $this->missingClasses[$class] = true; } return $file; @@ -348,10 +374,14 @@ private function findFileWithExtension($class, $ext) $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + $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; } } @@ -399,6 +429,8 @@ private function findFileWithExtension($class, $ext) if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } + + return false; } } diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index 1a28124..f27399a 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,5 +1,5 @@ -Copyright (c) 2016 Nils Adermann, Jordi Boggiano +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 diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 4b76426..acc5ac6 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -349,6 +349,7 @@ 'PHP_Token_NEW' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_NS_C' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_NS_SEPARATOR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_NULLSAFE_OBJECT_OPERATOR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_NUM_STRING' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_OBJECT_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_OBJECT_OPERATOR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', @@ -386,6 +387,7 @@ 'PHP_Token_STRING' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_STRING_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_STRING_VARNAME' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SUPER' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_SWITCH' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_Stream' => $vendorDir . '/phpunit/php-token-stream/src/Token/Stream.php', 'PHP_Token_Stream_CachingFactory' => $vendorDir . '/phpunit/php-token-stream/src/Token/Stream/CachingFactory.php', @@ -400,6 +402,7 @@ 'PHP_Token_UNSET' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_UNSET_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_USE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_USE_FUNCTION' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_VAR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_VARIABLE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_WHERE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index c740445..36b1f94 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -24,10 +24,10 @@ public static function getLoader() spl_autoload_unregister(array('ComposerAutoloaderInit057c8c646741cb54ad45bf25b7f621c2', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; - array_push($includePaths, get_include_path()); - set_include_path(join(PATH_SEPARATOR, $includePaths)); + $includePaths[] = get_include_path(); + set_include_path(implode(PATH_SEPARATOR, $includePaths)); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 32d53a1..b448f03 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -374,6 +374,7 @@ class ComposerStaticInit057c8c646741cb54ad45bf25b7f621c2 'PHP_Token_NEW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_NS_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_NS_SEPARATOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_NULLSAFE_OBJECT_OPERATOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_NUM_STRING' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_OBJECT_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_OBJECT_OPERATOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', @@ -411,6 +412,7 @@ class ComposerStaticInit057c8c646741cb54ad45bf25b7f621c2 'PHP_Token_STRING' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_STRING_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_STRING_VARNAME' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SUPER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_SWITCH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_Stream' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token/Stream.php', 'PHP_Token_Stream_CachingFactory' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token/Stream/CachingFactory.php', @@ -425,6 +427,7 @@ class ComposerStaticInit057c8c646741cb54ad45bf25b7f621c2 'PHP_Token_UNSET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_UNSET_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_USE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_USE_FUNCTION' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_VAR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_VARIABLE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', 'PHP_Token_WHERE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', diff --git a/vendor/composer/include_paths.php b/vendor/composer/include_paths.php index 4fd2332..c76513e 100644 --- a/vendor/composer/include_paths.php +++ b/vendor/composer/include_paths.php @@ -6,8 +6,8 @@ $baseDir = dirname($vendorDir); return array( - $vendorDir . '/phpunit/phpunit-mock-objects', $vendorDir . '/phpunit/php-file-iterator', $vendorDir . '/phpunit/phpunit', $vendorDir . '/symfony/yaml', + $vendorDir . '/phpunit/phpunit-mock-objects', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 787e000..d18e869 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,210 +1,186 @@ [ { - "name": "setasign/fpdi", - "version": "1.6.1", - "version_normalized": "1.6.1.0", + "name": "phpunit/php-code-coverage", + "version": "2.0.17", + "version_normalized": "2.0.17.0", "source": { "type": "git", - "url": "https://github.com/Setasign/FPDI.git", - "reference": "5b899b2b41463bf261aa69840fd30b50950a500c" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDI/zipball/5b899b2b41463bf261aa69840fd30b50950a500c", - "reference": "5b899b2b41463bf261aa69840fd30b50950a500c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c4e8e7725e351184a76544634855b8a9c405a6e3", + "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3", "shasum": "" }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "~1.0", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, "suggest": { - "setasign/fpdf": "FPDI will extend this class but as it is also possible to use \"tecnickcom/tcpdf\" as an alternative there's no fixed dependency configured.", - "setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.", - "setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF." + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" }, - "time": "2015-11-30 10:53:14", + "time": "2015-05-25T05:11:59+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "installation-source": "dist", "autoload": { "classmap": [ - "filters/", - "fpdi.php", - "fpdf_tpl.php", - "fpdi_pdf_parser.php", - "pdf_context.php" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jan Slabon", - "email": "jan.slabon@setasign.com", - "homepage": "https://www.setasign.com" + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], - "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", - "homepage": "https://www.setasign.com/fpdi", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "fpdf", - "fpdi", - "pdf" + "coverage", + "testing", + "xunit" ] }, { - "name": "setasign/fpdf", - "version": "1.8.1", - "version_normalized": "1.8.1.0", + "name": "phpunit/php-file-iterator", + "version": "1.3.4", + "version_normalized": "1.3.4.0", "source": { "type": "git", - "url": "https://github.com/Setasign/FPDF.git", - "reference": "2c68c9e6c034ac3187d25968790139a73184cdb1" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDF/zipball/2c68c9e6c034ac3187d25968790139a73184cdb1", - "reference": "2c68c9e6c034ac3187d25968790139a73184cdb1", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", "shasum": "" }, - "time": "2016-01-01 17:47:15", + "require": { + "php": ">=5.3.3" + }, + "time": "2013-10-10T15:34:57+00:00", "type": "library", "installation-source": "dist", "autoload": { "classmap": [ - "fpdf.php" + "File/" ] }, "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], "license": [ - "no usage restriction" + "BSD-3-Clause" ], "authors": [ { - "name": "Olivier Plathey", - "email": "oliver@fpdf.org", - "homepage": "http://fpdf.org/" + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], - "description": "FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.", - "homepage": "http://www.fpdf.org", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "fpdf", - "pdf" + "filesystem", + "iterator" ] }, { - "name": "setasign/fpdi-fpdf", - "version": "1.6.1", - "version_normalized": "1.6.1.0", + "name": "phpunit/php-text-template", + "version": "1.2.1", + "version_normalized": "1.2.1.0", "source": { "type": "git", - "url": "https://github.com/Setasign/FPDI-FPDF.git", - "reference": "212a0d58c656b56925fd44669619a69dac85ac2c" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDI-FPDF/zipball/212a0d58c656b56925fd44669619a69dac85ac2c", - "reference": "212a0d58c656b56925fd44669619a69dac85ac2c", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { - "setasign/fpdf": "1.8.*", - "setasign/fpdi": "1.6.*" + "php": ">=5.3.3" }, - "time": "2015-11-30 11:10:35", + "time": "2015-06-21T13:50:34+00:00", "type": "library", "installation-source": "dist", "autoload": { "classmap": [ - "fpdi_bridge.php" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jan Slabon", - "email": "jan.slabon@setasign.com", - "homepage": "https://www.setasign.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Kind of metadata package for dependencies of the latest versions of FPDI and FPDF.", - "homepage": "https://www.setasign.com/fpdi", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "fpdf", - "fpdi", - "pdf" + "template" ] }, { - "name": "symfony/yaml", - "version": "v2.8.9", - "version_normalized": "2.8.9.0", + "name": "phpunit/php-timer", + "version": "1.0.9", + "version_normalized": "1.0.9.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0ceab136f43ed9d3e97b3eea32a7855dc50c121d", - "reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, - "time": "2016-07-17 09:06:15", + "time": "2017-02-26T11:10:40+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "dev-master": "1.0-dev" } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "version_normalized": "1.0.6.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" }, - "time": "2015-06-21 13:59:46", - "type": "library", "installation-source": "dist", "autoload": { "classmap": [ @@ -218,39 +194,43 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version" + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ] }, { - "name": "sebastian/exporter", - "version": "1.0.2", - "version_normalized": "1.0.2.0", + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "version_normalized": "1.4.12.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", - "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "shasum": "" }, "require": { + "ext-tokenizer": "*", "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.2" }, - "time": "2014-09-10 00:51:36", + "time": "2017-12-04T08:55:13+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.4-dev" } }, "installation-source": "dist", @@ -264,60 +244,61 @@ "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", + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", "keywords": [ - "export", - "exporter" + "tokenizer" ] }, { - "name": "sebastian/environment", - "version": "1.3.7", - "version_normalized": "1.3.7.0", + "name": "phpunit/phpunit", + "version": "4.0.20", + "version_normalized": "4.0.20.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "de121ce8708b7ac7f628603d7682d0d57f528345" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de121ce8708b7ac7f628603d7682d0d57f528345", + "reference": "de121ce8708b7ac7f628603d7682d0d57f528345", "shasum": "" }, "require": { - "php": ">=5.3.3" + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": ">=2.0.0,<2.1.0", + "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0.2", + "phpunit/phpunit-mock-objects": ">=2.0.0,<2.1.0", + "sebastian/diff": "~1.1", + "sebastian/environment": "~1.0", + "sebastian/exporter": "~1.0.1", + "sebastian/version": "~1.0.3", + "symfony/yaml": "~2.0" }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "suggest": { + "phpunit/php-invoker": "~1.1" }, - "time": "2016-05-17 03:18:57", + "time": "2014-05-02T07:19:37+00:00", + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "4.0.x-dev" } }, "installation-source": "dist", @@ -327,45 +308,109 @@ ] }, "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "phpunit", + "testing", + "xunit" + ] + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.0.10", + "version_normalized": "2.0.10.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "e60bb929c50ae4237aaf680a4f6773f4ee17f0a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/e60bb929c50ae4237aaf680a4f6773f4ee17f0a2", + "reference": "e60bb929c50ae4237aaf680a4f6773f4ee17f0a2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": ">=4.0.0,<4.1.0" + }, + "suggest": { + "ext-soap": "*" + }, + "time": "2014-06-12T07:19:48+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" ] }, { "name": "sebastian/diff", - "version": "1.4.1", - "version_normalized": "1.4.1.0", + "version": "1.4.3", + "version_normalized": "1.4.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, - "time": "2015-12-08 07:14:41", + "time": "2017-05-22T07:24:03+00:00", "type": "library", "extra": { "branch-alias": { @@ -399,25 +444,33 @@ ] }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "version_normalized": "1.2.1.0", + "name": "sebastian/environment", + "version": "1.3.8", + "version_normalized": "1.3.8.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, - "time": "2015-06-21 13:50:34", + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "time": "2016-08-18T05:49:44+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, "installation-source": "dist", "autoload": { "classmap": [ @@ -431,46 +484,43 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", "keywords": [ - "template" + "Xdebug", + "environment", + "hhvm" ] }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.0.10", - "version_normalized": "2.0.10.0", + "name": "sebastian/exporter", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "e60bb929c50ae4237aaf680a4f6773f4ee17f0a2" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/e60bb929c50ae4237aaf680a4f6773f4ee17f0a2", - "reference": "e60bb929c50ae4237aaf680a4f6773f4ee17f0a2", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": ">=4.0.0,<4.1.0" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "~4.0" }, - "time": "2014-06-12 07:19:48", + "time": "2014-09-10T00:51:36+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", @@ -480,48 +530,54 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "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": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ - "mock", - "xunit" + "export", + "exporter" ] }, { - "name": "phpunit/php-timer", - "version": "1.0.8", - "version_normalized": "1.0.8.0", + "name": "sebastian/version", + "version": "1.0.6", + "version_normalized": "1.0.6.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4|~5" - }, - "time": "2016-05-12 18:03:57", + "time": "2015-06-21T13:59:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -536,251 +592,200 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ] + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version" }, { - "name": "phpunit/php-file-iterator", - "version": "1.3.4", - "version_normalized": "1.3.4.0", + "name": "setasign/fpdf", + "version": "1.8.1", + "version_normalized": "1.8.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + "url": "https://github.com/Setasign/FPDF.git", + "reference": "2c68c9e6c034ac3187d25968790139a73184cdb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "url": "https://api.github.com/repos/Setasign/FPDF/zipball/2c68c9e6c034ac3187d25968790139a73184cdb1", + "reference": "2c68c9e6c034ac3187d25968790139a73184cdb1", "shasum": "" }, - "require": { - "php": ">=5.3.3" - }, - "time": "2013-10-10 15:34:57", + "time": "2016-01-01T17:47:15+00:00", "type": "library", "installation-source": "dist", "autoload": { "classmap": [ - "File/" + "fpdf.php" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ - "BSD-3-Clause" + "no usage restriction" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Olivier Plathey", + "email": "oliver@fpdf.org", + "homepage": "http://fpdf.org/" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.", + "homepage": "http://www.fpdf.org", "keywords": [ - "filesystem", - "iterator" + "fpdf", + "pdf" ] }, { - "name": "phpunit/php-token-stream", - "version": "1.4.8", - "version_normalized": "1.4.8.0", + "name": "setasign/fpdi", + "version": "1.6.2", + "version_normalized": "1.6.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "url": "https://github.com/Setasign/FPDI.git", + "reference": "a6ad58897a6d97cc2d2cd2adaeda343b25a368ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/a6ad58897a6d97cc2d2cd2adaeda343b25a368ea", + "reference": "a6ad58897a6d97cc2d2cd2adaeda343b25a368ea", "shasum": "" }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" + "suggest": { + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use \"tecnickcom/tcpdf\" as an alternative there's no fixed dependency configured.", + "setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.", + "setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF." }, - "time": "2015-09-15 10:49:45", + "time": "2017-05-11T14:25:49+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, "installation-source": "dist", "autoload": { "classmap": [ - "src/" + "filters/", + "fpdi.php", + "fpdf_tpl.php", + "fpdi_pdf_parser.php", + "pdf_context.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", + "homepage": "https://www.setasign.com/fpdi", "keywords": [ - "tokenizer" + "fpdf", + "fpdi", + "pdf" ] }, { - "name": "phpunit/php-code-coverage", - "version": "2.0.17", - "version_normalized": "2.0.17.0", + "name": "setasign/fpdi-fpdf", + "version": "1.6.2", + "version_normalized": "1.6.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3" + "url": "https://github.com/Setasign/FPDI-FPDF.git", + "reference": "a5dda72b78253c0e9e4d644e6e3af4b94662e27e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c4e8e7725e351184a76544634855b8a9c405a6e3", - "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3", + "url": "https://api.github.com/repos/Setasign/FPDI-FPDF/zipball/a5dda72b78253c0e9e4d644e6e3af4b94662e27e", + "reference": "a5dda72b78253c0e9e4d644e6e3af4b94662e27e", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "setasign/fpdf": "1.8.1", + "setasign/fpdi": "1.6.2" }, - "time": "2015-05-25 05:11:59", + "time": "2017-05-11T14:57:54+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "installation-source": "dist", "autoload": { "classmap": [ - "src/" + "fpdi_bridge.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Kind of metadata package for dependencies of the latest versions of FPDI and FPDF.", + "homepage": "https://www.setasign.com/fpdi", "keywords": [ - "coverage", - "testing", - "xunit" + "fpdf", + "fpdi", + "pdf" ] }, { - "name": "phpunit/phpunit", - "version": "4.0.20", - "version_normalized": "4.0.20.0", + "name": "symfony/yaml", + "version": "v2.8.34", + "version_normalized": "2.8.34.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de121ce8708b7ac7f628603d7682d0d57f528345" + "url": "https://github.com/symfony/yaml.git", + "reference": "be720fcfae4614df204190d57795351059946a77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de121ce8708b7ac7f628603d7682d0d57f528345", - "reference": "de121ce8708b7ac7f628603d7682d0d57f528345", + "url": "https://api.github.com/repos/symfony/yaml/zipball/be720fcfae4614df204190d57795351059946a77", + "reference": "be720fcfae4614df204190d57795351059946a77", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": ">=2.0.0,<2.1.0", - "phpunit/php-file-iterator": "~1.3.1", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0.2", - "phpunit/phpunit-mock-objects": ">=2.0.0,<2.1.0", - "sebastian/diff": "~1.1", - "sebastian/environment": "~1.0", - "sebastian/exporter": "~1.0.1", - "sebastian/version": "~1.0.3", - "symfony/yaml": "~2.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" + "php": ">=5.3.9" }, - "time": "2014-05-02 07:19:37", - "bin": [ - "phpunit" - ], + "time": "2018-01-03T07:36:31+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "2.8-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ] + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com" } ] diff --git a/vendor/phpunit/php-timer/.gitignore b/vendor/phpunit/php-timer/.gitignore index cb465d9..c03c89b 100644 --- a/vendor/phpunit/php-timer/.gitignore +++ b/vendor/phpunit/php-timer/.gitignore @@ -1,3 +1,4 @@ +/.idea /vendor /composer.lock diff --git a/vendor/phpunit/php-timer/.travis.yml b/vendor/phpunit/php-timer/.travis.yml index fd8e850..7fc8996 100644 --- a/vendor/phpunit/php-timer/.travis.yml +++ b/vendor/phpunit/php-timer/.travis.yml @@ -1,30 +1,27 @@ language: php php: - - 5.3.3 - 5.3 - 5.4 - 5.5 - 5.6 - 7.0 - - nightly - - hhvm + - 7.0snapshot + - 7.1 + - 7.1snapshot + - master + +sudo: false before_install: - composer self-update + - composer clear-cache install: - - travis_retry composer install --no-interaction --prefer-source + - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable script: - - ./vendor/bin/phpunit --bootstrap src/Timer.php tests + - ./vendor/bin/phpunit notifications: email: false - webhooks: - urls: - - https://webhooks.gitter.im/e/6668f52f3dd4e3f81960 - on_success: always - on_failure: always - on_start: false - diff --git a/vendor/phpunit/php-timer/README.md b/vendor/phpunit/php-timer/README.md index 1c5b756..47abb57 100644 --- a/vendor/phpunit/php-timer/README.md +++ b/vendor/phpunit/php-timer/README.md @@ -6,13 +6,13 @@ Utility class for timing things, factored out of PHPUnit into a stand-alone comp ## Installation -To add this package as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-timer` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on PHP_Timer: +You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - { - "require": { - "phpunit/php-timer": "~1.0" - } - } + composer require phpunit/php-timer + +If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: + + composer require --dev phpunit/php-timer ## Usage @@ -21,8 +21,6 @@ To add this package as a local, per-project dependency to your project, simply a ```php PHP_Timer::start(); -$timer->start(); - // ... $time = PHP_Timer::stop(); diff --git a/vendor/phpunit/php-timer/composer.json b/vendor/phpunit/php-timer/composer.json index a327276..0f16164 100644 --- a/vendor/phpunit/php-timer/composer.json +++ b/vendor/phpunit/php-timer/composer.json @@ -15,19 +15,23 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "irc": "irc://irc.freenode.net/phpunit" + "issues": "https://github.com/sebastianbergmann/php-timer/issues" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "autoload": { "classmap": [ "src/" ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } } } diff --git a/vendor/phpunit/php-timer/src/Timer.php b/vendor/phpunit/php-timer/src/Timer.php index 34df0ba..7b5c432 100644 --- a/vendor/phpunit/php-timer/src/Timer.php +++ b/vendor/phpunit/php-timer/src/Timer.php @@ -10,8 +10,6 @@ /** * Utility class for timing. - * - * @since Class available since Release 1.0.0 */ class PHP_Timer { diff --git a/vendor/phpunit/php-timer/tests/TimerTest.php b/vendor/phpunit/php-timer/tests/TimerTest.php index f18c24b..34ebc50 100644 --- a/vendor/phpunit/php-timer/tests/TimerTest.php +++ b/vendor/phpunit/php-timer/tests/TimerTest.php @@ -8,12 +8,9 @@ * file that was distributed with this source code. */ -/** - * Tests for PHP_Timer. - * - * @since Class available since Release 1.0.0 - */ -class PHP_TimerTest extends PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class PHP_TimerTest extends TestCase { /** * @covers PHP_Timer::start diff --git a/vendor/phpunit/php-token-stream/.travis.yml b/vendor/phpunit/php-token-stream/.travis.yml index 11dedef..c7cefe7 100644 --- a/vendor/phpunit/php-token-stream/.travis.yml +++ b/vendor/phpunit/php-token-stream/.travis.yml @@ -1,35 +1,31 @@ language: php php: - - 5.3.3 - 5.3 - 5.4 - 5.5 - 5.6 - 7.0 - - hhvm - -matrix: - allow_failures: - - php: hhvm + - 7.0snapshot + - 7.1 + - 7.1snapshot + - master sudo: false before_install: - composer self-update + - composer clear-cache install: - - travis_retry composer install --no-interaction --prefer-source + - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable script: - - ./vendor/bin/phpunit --configuration ./build/phpunit.xml + - ./vendor/bin/phpunit --configuration ./build/phpunit.xml --coverage-clover=coverage.xml + +after_success: + - bash <(curl -s https://codecov.io/bash) notifications: email: false - webhooks: - urls: - - https://webhooks.gitter.im/e/6668f52f3dd4e3f81960 - on_success: always - on_failure: always - on_start: false diff --git a/vendor/phpunit/php-token-stream/README.md b/vendor/phpunit/php-token-stream/README.md index 31d4b24..1cee048 100644 --- a/vendor/phpunit/php-token-stream/README.md +++ b/vendor/phpunit/php-token-stream/README.md @@ -4,10 +4,11 @@ ## Installation -To add this package as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-token-stream` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on PHP_TokenStream: +You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): + + composer require phpunit/php-token-stream + +If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: + + composer require --dev phpunit/php-token-stream - { - "require": { - "phpunit/php-token-stream": "~1.2" - } - } diff --git a/vendor/phpunit/php-token-stream/src/Token.php b/vendor/phpunit/php-token-stream/src/Token.php index 85c1846..2452e1c 100644 --- a/vendor/phpunit/php-token-stream/src/Token.php +++ b/vendor/phpunit/php-token-stream/src/Token.php @@ -759,6 +759,7 @@ class PHP_Token_TRY extends PHP_Token {} class PHP_Token_UNSET extends PHP_Token {} class PHP_Token_UNSET_CAST extends PHP_Token {} class PHP_Token_USE extends PHP_Token {} +class PHP_Token_USE_FUNCTION extends PHP_Token {} class PHP_Token_VAR extends PHP_Token {} class PHP_Token_VARIABLE extends PHP_Token {} class PHP_Token_WHILE extends PHP_Token {} @@ -830,7 +831,9 @@ class PHP_Token_LAMBDA_ARROW extends PHP_Token {} class PHP_Token_LAMBDA_CP extends PHP_Token {} class PHP_Token_LAMBDA_OP extends PHP_Token {} class PHP_Token_ONUMBER extends PHP_Token {} +class PHP_Token_NULLSAFE_OBJECT_OPERATOR extends PHP_Token {} class PHP_Token_SHAPE extends PHP_Token {} +class PHP_Token_SUPER extends PHP_Token {} class PHP_Token_TYPE extends PHP_Token {} class PHP_Token_TYPELIST_GT extends PHP_Token {} class PHP_Token_TYPELIST_LT extends PHP_Token {} diff --git a/vendor/phpunit/php-token-stream/src/Token/Stream.php b/vendor/phpunit/php-token-stream/src/Token/Stream.php index 59a9c29..c536d68 100644 --- a/vendor/phpunit/php-token-stream/src/Token/Stream.php +++ b/vendor/phpunit/php-token-stream/src/Token/Stream.php @@ -157,6 +157,7 @@ public function getFilename() */ protected function scan($sourceCode) { + $id = 0; $line = 1; $tokens = token_get_all($sourceCode); $numTokens = count($tokens); @@ -165,7 +166,7 @@ protected function scan($sourceCode) for ($i = 0; $i < $numTokens; ++$i) { $token = $tokens[$i]; - unset($tokens[$i]); + $skip = 0; if (is_array($token)) { $name = substr(token_name($token[0]), 2); @@ -173,6 +174,10 @@ protected function scan($sourceCode) if ($lastNonWhitespaceTokenWasDoubleColon && $name == 'CLASS') { $name = 'CLASS_NAME_CONSTANT'; + } elseif ($name == 'USE' && isset($tokens[$i+2][0]) && $tokens[$i+2][0] == T_FUNCTION) { + $name = 'USE_FUNCTION'; + $text .= $tokens[$i+1][1] . $tokens[$i+2][1]; + $skip = 2; } $tokenClass = 'PHP_Token_' . $name; @@ -181,7 +186,7 @@ protected function scan($sourceCode) $tokenClass = self::$customTokens[$token]; } - $this->tokens[] = new $tokenClass($text, $line, $this, $i); + $this->tokens[] = new $tokenClass($text, $line, $this, $id++); $lines = substr_count($text, "\n"); $line += $lines; @@ -197,6 +202,8 @@ protected function scan($sourceCode) } elseif ($name != 'WHITESPACE') { $lastNonWhitespaceTokenWasDoubleColon = false; } + + $i += $skip; } $this->linesOfCode['loc'] = substr_count($sourceCode, "\n"); diff --git a/vendor/phpunit/php-token-stream/tests/Token/ClassTest.php b/vendor/phpunit/php-token-stream/tests/Token/ClassTest.php index 4ba0296..d1b25d8 100644 --- a/vendor/phpunit/php-token-stream/tests/Token/ClassTest.php +++ b/vendor/phpunit/php-token-stream/tests/Token/ClassTest.php @@ -109,4 +109,15 @@ public function testAnonymousClassesAreHandledCorrectly2() $this->assertEmpty($ts->getFunctions()); } + + /** + * @requires PHP 5.6 + */ + public function testImportedFunctionsAreHandledCorrectly() + { + $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'classUsesNamespacedFunction.php'); + + $this->assertEmpty($ts->getFunctions()); + $this->assertCount(1, $ts->getClasses()); + } } diff --git a/vendor/sebastian/diff/.gitignore b/vendor/sebastian/diff/.gitignore index d571f24..36a9658 100644 --- a/vendor/sebastian/diff/.gitignore +++ b/vendor/sebastian/diff/.gitignore @@ -1,10 +1,4 @@ -.idea -phpunit.xml -composer.lock -composer.phar -vendor/ -cache.properties -build/SebastianBergmann -build/LICENSE -build/README.md -build/*.tgz +/.idea +/composer.lock +/vendor +/.php_cs.cache \ No newline at end of file diff --git a/vendor/sebastian/diff/.php_cs b/vendor/sebastian/diff/.php_cs index 286a5d6..ef46bea 100644 --- a/vendor/sebastian/diff/.php_cs +++ b/vendor/sebastian/diff/.php_cs @@ -1,66 +1,79 @@ files() - ->in('src') - ->in('tests') - ->name('*.php'); +$header = <<<'EOF' +This file is part of sebastian/diff. -return Symfony\CS\Config\Config::create() - ->level(\Symfony\CS\FixerInterface::NONE_LEVEL) - ->fixers( - array( - 'align_double_arrow', - 'align_equals', - 'braces', - 'concat_with_spaces', - 'duplicate_semicolon', - 'elseif', - 'empty_return', - 'encoding', - 'eof_ending', - 'extra_empty_lines', - 'function_call_space', - 'function_declaration', - 'indentation', - 'join_function', - 'line_after_namespace', - 'linefeed', - 'list_commas', - 'lowercase_constants', - 'lowercase_keywords', - 'method_argument_space', - 'multiple_use', - 'namespace_no_leading_whitespace', - 'no_blank_lines_after_class_opening', - 'no_empty_lines_after_phpdocs', - 'parenthesis', - 'php_closing_tag', - 'phpdoc_indent', - 'phpdoc_no_access', - 'phpdoc_no_empty_return', - 'phpdoc_no_package', - 'phpdoc_params', - 'phpdoc_scalar', - 'phpdoc_separation', - 'phpdoc_to_comment', - 'phpdoc_trim', - 'phpdoc_types', - 'phpdoc_var_without_name', - 'remove_lines_between_uses', - 'return', - 'self_accessor', - 'short_tag', - 'single_line_after_imports', - 'single_quote', - 'spaces_before_semicolon', - 'spaces_cast', - 'ternary_spaces', - 'trailing_spaces', - 'trim_array_spaces', - 'unused_use', - 'visibility', - 'whitespacy_lines' - ) - ) - ->finder($finder); +(c) Sebastian Bergmann + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. +EOF; +return PhpCsFixer\Config::create() + ->setRiskyAllowed(true) + ->setRules( + [ + 'array_syntax' => ['syntax' => 'long'], + 'binary_operator_spaces' => [ + 'align_double_arrow' => true, + 'align_equals' => true + ], + 'blank_line_after_namespace' => true, + 'blank_line_before_return' => true, + 'braces' => true, + 'cast_spaces' => true, + 'concat_space' => ['spacing' => 'one'], + 'elseif' => true, + 'encoding' => true, + 'full_opening_tag' => true, + 'function_declaration' => true, + 'header_comment' => ['header' => $header, 'separate' => 'none'], + 'indentation_type' => true, + 'line_ending' => true, + 'lowercase_constants' => true, + 'lowercase_keywords' => true, + 'method_argument_space' => true, + 'native_function_invocation' => true, + 'no_alias_functions' => true, + 'no_blank_lines_after_class_opening' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_closing_tag' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_consecutive_blank_lines' => true, + 'no_leading_namespace_whitespace' => true, + 'no_singleline_whitespace_before_semicolons' => true, + 'no_spaces_after_function_name' => true, + 'no_spaces_inside_parenthesis' => true, + 'no_trailing_comma_in_list_call' => true, + 'no_trailing_whitespace' => true, + 'no_unused_imports' => true, + 'no_whitespace_in_blank_line' => true, + 'phpdoc_align' => true, + 'phpdoc_indent' => true, + 'phpdoc_no_access' => true, + 'phpdoc_no_empty_return' => true, + 'phpdoc_no_package' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_to_comment' => true, + 'phpdoc_trim' => true, + 'phpdoc_types' => true, + 'phpdoc_var_without_name' => true, + 'self_accessor' => true, + 'simplified_null_return' => true, + 'single_blank_line_at_eof' => true, + 'single_import_per_statement' => true, + 'single_line_after_imports' => true, + 'single_quote' => true, + 'ternary_operator_spaces' => true, + 'trim_array_spaces' => true, + 'visibility_required' => true, + ] + ) + ->setFinder( + PhpCsFixer\Finder::create() + ->files() + ->in(__DIR__ . '/src') + ->in(__DIR__ . '/tests') + ->name('*.php') + ); diff --git a/vendor/sebastian/diff/.travis.yml b/vendor/sebastian/diff/.travis.yml index c5ea677..fa69ad1 100644 --- a/vendor/sebastian/diff/.travis.yml +++ b/vendor/sebastian/diff/.travis.yml @@ -1,16 +1,31 @@ language: php -install: - - travis_retry composer install --no-interaction --prefer-source - php: - - 5.3.3 - 5.3 - 5.4 - 5.5 - 5.6 - - hhvm + - 7.0 + - 7.0snapshot + - 7.1 + - 7.1snapshot + - master + +sudo: false + +before_install: + - composer self-update + - composer clear-cache + +install: + - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable + +script: + - ./vendor/bin/phpunit --coverage-clover=coverage.xml + +after_success: + - bash <(curl -s https://codecov.io/bash) notifications: email: false - irc: "irc.freenode.org#phpunit" + diff --git a/vendor/sebastian/diff/LICENSE b/vendor/sebastian/diff/LICENSE index 0941c06..e1ddf13 100644 --- a/vendor/sebastian/diff/LICENSE +++ b/vendor/sebastian/diff/LICENSE @@ -1,6 +1,6 @@ -Diff +sebastian/diff -Copyright (c) 2002-2015, Sebastian Bergmann . +Copyright (c) 2002-2017, Sebastian Bergmann . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/sebastian/diff/README.md b/vendor/sebastian/diff/README.md index 921957b..956038b 100644 --- a/vendor/sebastian/diff/README.md +++ b/vendor/sebastian/diff/README.md @@ -1,16 +1,16 @@ -# Diff +# sebastian/diff Diff implementation for PHP, factored out of PHPUnit into a stand-alone component. ## Installation -To add this package as a local, per-project dependency to your project, simply add a dependency on `sebastian/diff` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Diff: +You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - { - "require": { - "sebastian/diff": "*" - } - } + composer require sebastian/diff + +If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: + + composer require --dev sebastian/diff ### Usage diff --git a/vendor/sebastian/diff/build.xml b/vendor/sebastian/diff/build.xml index 7366087..fa7b7e2 100644 --- a/vendor/sebastian/diff/build.xml +++ b/vendor/sebastian/diff/build.xml @@ -1,26 +1,22 @@ - - - - - + + - - - - - - - - - - + + + + - - - - - - - + + + + + + + + + + + + diff --git a/vendor/sebastian/diff/composer.json b/vendor/sebastian/diff/composer.json index 4b4b8d1..8f2bcf3 100644 --- a/vendor/sebastian/diff/composer.json +++ b/vendor/sebastian/diff/composer.json @@ -15,10 +15,10 @@ } ], "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "autoload": { "classmap": [ diff --git a/vendor/sebastian/diff/phpunit.xml.dist b/vendor/sebastian/diff/phpunit.xml.dist deleted file mode 100644 index 387a9b3..0000000 --- a/vendor/sebastian/diff/phpunit.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - - tests - - - - - src - - - - diff --git a/vendor/sebastian/diff/src/Chunk.php b/vendor/sebastian/diff/src/Chunk.php index eb08103..1a6ea73 100644 --- a/vendor/sebastian/diff/src/Chunk.php +++ b/vendor/sebastian/diff/src/Chunk.php @@ -1,6 +1,6 @@ * @@ -10,8 +10,6 @@ namespace SebastianBergmann\Diff; -/** - */ class Chunk { /** @@ -28,6 +26,7 @@ class Chunk * @var int */ private $end; + /** * @var int */ diff --git a/vendor/sebastian/diff/src/Diff.php b/vendor/sebastian/diff/src/Diff.php index c4a0892..d3ab3ef 100644 --- a/vendor/sebastian/diff/src/Diff.php +++ b/vendor/sebastian/diff/src/Diff.php @@ -1,6 +1,6 @@ * @@ -10,8 +10,6 @@ namespace SebastianBergmann\Diff; -/** - */ class Diff { /** diff --git a/vendor/sebastian/diff/src/Differ.php b/vendor/sebastian/diff/src/Differ.php index 4960111..116c99c 100644 --- a/vendor/sebastian/diff/src/Differ.php +++ b/vendor/sebastian/diff/src/Differ.php @@ -1,6 +1,6 @@ * @@ -31,6 +31,7 @@ class Differ /** * @param string $header + * @param bool $showNonDiffLines */ public function __construct($header = "--- Original\n+++ New\n", $showNonDiffLines = true) { @@ -49,23 +50,52 @@ public function __construct($header = "--- Original\n+++ New\n", $showNonDiffLin */ public function diff($from, $to, LongestCommonSubsequence $lcs = null) { - if (!is_array($from) && !is_string($from)) { - $from = (string) $from; + $from = $this->validateDiffInput($from); + $to = $this->validateDiffInput($to); + $diff = $this->diffToArray($from, $to, $lcs); + $old = $this->checkIfDiffInOld($diff); + $start = isset($old[0]) ? $old[0] : 0; + $end = \count($diff); + + if ($tmp = \array_search($end, $old)) { + $end = $tmp; } - if (!is_array($to) && !is_string($to)) { - $to = (string) $to; + return $this->getBuffer($diff, $old, $start, $end); + } + + /** + * Casts variable to string if it is not a string or array. + * + * @param mixed $input + * + * @return string + */ + private function validateDiffInput($input) + { + if (!\is_array($input) && !\is_string($input)) { + return (string) $input; } - $buffer = $this->header; - $diff = $this->diffToArray($from, $to, $lcs); + return $input; + } + /** + * Takes input of the diff array and returns the old array. + * Iterates through diff line by line, + * + * @param array $diff + * + * @return array + */ + private function checkIfDiffInOld(array $diff) + { $inOld = false; $i = 0; $old = array(); foreach ($diff as $line) { - if ($line[1] === 0 /* OLD */) { + if ($line[1] === 0 /* OLD */) { if ($inOld === false) { $inOld = $i; } @@ -80,46 +110,85 @@ public function diff($from, $to, LongestCommonSubsequence $lcs = null) ++$i; } - $start = isset($old[0]) ? $old[0] : 0; - $end = count($diff); + return $old; + } - if ($tmp = array_search($end, $old)) { - $end = $tmp; - } + /** + * Generates buffer in string format, returning the patch. + * + * @param array $diff + * @param array $old + * @param int $start + * @param int $end + * + * @return string + */ + private function getBuffer(array $diff, array $old, $start, $end) + { + $buffer = $this->header; - $newChunk = true; + if (!isset($old[$start])) { + $buffer = $this->getDiffBufferElementNew($diff, $buffer, $start); + ++$start; + } for ($i = $start; $i < $end; $i++) { if (isset($old[$i])) { - $buffer .= "\n"; - $newChunk = true; - $i = $old[$i]; + $i = $old[$i]; + $buffer = $this->getDiffBufferElementNew($diff, $buffer, $i); + } else { + $buffer = $this->getDiffBufferElement($diff, $buffer, $i); } + } - if ($newChunk) { - if ($this->showNonDiffLines === true) { - $buffer .= "@@ @@\n"; - } - $newChunk = false; - } + return $buffer; + } - if ($diff[$i][1] === 1 /* ADDED */) { - $buffer .= '+' . $diff[$i][0] . "\n"; - } elseif ($diff[$i][1] === 2 /* REMOVED */) { - $buffer .= '-' . $diff[$i][0] . "\n"; - } elseif ($this->showNonDiffLines === true) { - $buffer .= ' ' . $diff[$i][0] . "\n"; - } + /** + * Gets individual buffer element. + * + * @param array $diff + * @param string $buffer + * @param int $diffIndex + * + * @return string + */ + private function getDiffBufferElement(array $diff, $buffer, $diffIndex) + { + if ($diff[$diffIndex][1] === 1 /* ADDED */) { + $buffer .= '+' . $diff[$diffIndex][0] . "\n"; + } elseif ($diff[$diffIndex][1] === 2 /* REMOVED */) { + $buffer .= '-' . $diff[$diffIndex][0] . "\n"; + } elseif ($this->showNonDiffLines === true) { + $buffer .= ' ' . $diff[$diffIndex][0] . "\n"; } return $buffer; } + /** + * Gets individual buffer element with opening. + * + * @param array $diff + * @param string $buffer + * @param int $diffIndex + * + * @return string + */ + private function getDiffBufferElementNew(array $diff, $buffer, $diffIndex) + { + if ($this->showNonDiffLines === true) { + $buffer .= "@@ @@\n"; + } + + return $this->getDiffBufferElement($diff, $buffer, $diffIndex); + } + /** * Returns the diff between two arrays or strings as array. * * Each array element contains two elements: - * - [0] => string $token + * - [0] => mixed $token * - [1] => 2|1|0 * * - 2: REMOVED: $token was removed from $from @@ -134,55 +203,37 @@ public function diff($from, $to, LongestCommonSubsequence $lcs = null) */ public function diffToArray($from, $to, LongestCommonSubsequence $lcs = null) { - preg_match_all('(\r\n|\r|\n)', $from, $fromMatches); - preg_match_all('(\r\n|\r|\n)', $to, $toMatches); - - if (is_string($from)) { - $from = preg_split('(\r\n|\r|\n)', $from); + if (\is_string($from)) { + $fromMatches = $this->getNewLineMatches($from); + $from = $this->splitStringByLines($from); + } elseif (\is_array($from)) { + $fromMatches = array(); + } else { + throw new \InvalidArgumentException('"from" must be an array or string.'); } - if (is_string($to)) { - $to = preg_split('(\r\n|\r|\n)', $to); + if (\is_string($to)) { + $toMatches = $this->getNewLineMatches($to); + $to = $this->splitStringByLines($to); + } elseif (\is_array($to)) { + $toMatches = array(); + } else { + throw new \InvalidArgumentException('"to" must be an array or string.'); } - $start = array(); - $end = array(); - $fromLength = count($from); - $toLength = count($to); - $length = min($fromLength, $toLength); - - for ($i = 0; $i < $length; ++$i) { - if ($from[$i] === $to[$i]) { - $start[] = $from[$i]; - unset($from[$i], $to[$i]); - } else { - break; - } - } - - $length -= $i; - - for ($i = 1; $i < $length; ++$i) { - if ($from[$fromLength - $i] === $to[$toLength - $i]) { - array_unshift($end, $from[$fromLength - $i]); - unset($from[$fromLength - $i], $to[$toLength - $i]); - } else { - break; - } - } + list($from, $to, $start, $end) = self::getArrayDiffParted($from, $to); if ($lcs === null) { $lcs = $this->selectLcsImplementation($from, $to); } - $common = $lcs->calculate(array_values($from), array_values($to)); + $common = $lcs->calculate(\array_values($from), \array_values($to)); $diff = array(); - if (isset($fromMatches[0]) && $toMatches[0] && - count($fromMatches[0]) === count($toMatches[0]) && - $fromMatches[0] !== $toMatches[0]) { + if ($this->detectUnmatchedLineEndings($fromMatches, $toMatches)) { $diff[] = array( - '#Warning: Strings contain different line endings!', 0 + '#Warning: Strings contain different line endings!', + 0 ); } @@ -190,29 +241,29 @@ public function diffToArray($from, $to, LongestCommonSubsequence $lcs = null) $diff[] = array($token, 0 /* OLD */); } - reset($from); - reset($to); + \reset($from); + \reset($to); foreach ($common as $token) { - while ((($fromToken = reset($from)) !== $token)) { - $diff[] = array(array_shift($from), 2 /* REMOVED */); + while (($fromToken = \reset($from)) !== $token) { + $diff[] = array(\array_shift($from), 2 /* REMOVED */); } - while ((($toToken = reset($to)) !== $token)) { - $diff[] = array(array_shift($to), 1 /* ADDED */); + while (($toToken = \reset($to)) !== $token) { + $diff[] = array(\array_shift($to), 1 /* ADDED */); } $diff[] = array($token, 0 /* OLD */); - array_shift($from); - array_shift($to); + \array_shift($from); + \array_shift($to); } - while (($token = array_shift($from)) !== null) { + while (($token = \array_shift($from)) !== null) { $diff[] = array($token, 2 /* REMOVED */); } - while (($token = array_shift($to)) !== null) { + while (($token = \array_shift($to)) !== null) { $diff[] = array($token, 1 /* ADDED */); } @@ -223,6 +274,32 @@ public function diffToArray($from, $to, LongestCommonSubsequence $lcs = null) return $diff; } + /** + * Get new strings denoting new lines from a given string. + * + * @param string $string + * + * @return array + */ + private function getNewLineMatches($string) + { + \preg_match_all('(\r\n|\r|\n)', $string, $stringMatches); + + return $stringMatches; + } + + /** + * Checks if input is string, if so it will split it line-by-line. + * + * @param string $input + * + * @return array + */ + private function splitStringByLines($input) + { + return \preg_split('(\r\n|\r|\n)', $input); + } + /** * @param array $from * @param array $to @@ -250,12 +327,73 @@ private function selectLcsImplementation(array $from, array $to) * @param array $from * @param array $to * - * @return int + * @return int|float */ private function calculateEstimatedFootprint(array $from, array $to) { - $itemSize = PHP_INT_SIZE == 4 ? 76 : 144; + $itemSize = PHP_INT_SIZE === 4 ? 76 : 144; + + return $itemSize * \pow(\min(\count($from), \count($to)), 2); + } + + /** + * Returns true if line ends don't match on fromMatches and toMatches. + * + * @param array $fromMatches + * @param array $toMatches + * + * @return bool + */ + private function detectUnmatchedLineEndings(array $fromMatches, array $toMatches) + { + return isset($fromMatches[0], $toMatches[0]) && + \count($fromMatches[0]) === \count($toMatches[0]) && + $fromMatches[0] !== $toMatches[0]; + } + + /** + * @param array $from + * @param array $to + * + * @return array + */ + private static function getArrayDiffParted(array &$from, array &$to) + { + $start = array(); + $end = array(); + + \reset($to); + + foreach ($from as $k => $v) { + $toK = \key($to); + + if ($toK === $k && $v === $to[$k]) { + $start[$k] = $v; + + unset($from[$k], $to[$k]); + } else { + break; + } + } + + \end($from); + \end($to); + + do { + $fromK = \key($from); + $toK = \key($to); + + if (null === $fromK || null === $toK || \current($from) !== \current($to)) { + break; + } + + \prev($from); + \prev($to); + + $end = array($fromK => $from[$fromK]) + $end; + unset($from[$fromK], $to[$toK]); + } while (true); - return $itemSize * pow(min(count($from), count($to)), 2); + return array($from, $to, $start, $end); } } diff --git a/vendor/sebastian/diff/src/LCS/LongestCommonSubsequence.php b/vendor/sebastian/diff/src/LCS/LongestCommonSubsequence.php index 5ea9cf9..28674ab 100644 --- a/vendor/sebastian/diff/src/LCS/LongestCommonSubsequence.php +++ b/vendor/sebastian/diff/src/LCS/LongestCommonSubsequence.php @@ -1,6 +1,6 @@ * diff --git a/vendor/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php b/vendor/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php index b990dc0..c1b3121 100644 --- a/vendor/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php +++ b/vendor/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php @@ -1,6 +1,6 @@ * @@ -25,43 +25,45 @@ class MemoryEfficientImplementation implements LongestCommonSubsequence */ public function calculate(array $from, array $to) { - $cFrom = count($from); - $cTo = count($to); + $cFrom = \count($from); + $cTo = \count($to); - if ($cFrom == 0) { + if ($cFrom === 0) { return array(); - } elseif ($cFrom == 1) { - if (in_array($from[0], $to)) { + } + + if ($cFrom === 1) { + if (\in_array($from[0], $to, true)) { return array($from[0]); - } else { - return array(); } - } else { - $i = intval($cFrom / 2); - $fromStart = array_slice($from, 0, $i); - $fromEnd = array_slice($from, $i); - $llB = $this->length($fromStart, $to); - $llE = $this->length(array_reverse($fromEnd), array_reverse($to)); - $jMax = 0; - $max = 0; - for ($j = 0; $j <= $cTo; $j++) { - $m = $llB[$j] + $llE[$cTo - $j]; + return array(); + } - if ($m >= $max) { - $max = $m; - $jMax = $j; - } - } + $i = (int) ($cFrom / 2); + $fromStart = \array_slice($from, 0, $i); + $fromEnd = \array_slice($from, $i); + $llB = $this->length($fromStart, $to); + $llE = $this->length(\array_reverse($fromEnd), \array_reverse($to)); + $jMax = 0; + $max = 0; - $toStart = array_slice($to, 0, $jMax); - $toEnd = array_slice($to, $jMax); + for ($j = 0; $j <= $cTo; $j++) { + $m = $llB[$j] + $llE[$cTo - $j]; - return array_merge( - $this->calculate($fromStart, $toStart), - $this->calculate($fromEnd, $toEnd) - ); + if ($m >= $max) { + $max = $m; + $jMax = $j; + } } + + $toStart = \array_slice($to, 0, $jMax); + $toEnd = \array_slice($to, $jMax); + + return \array_merge( + $this->calculate($fromStart, $toStart), + $this->calculate($fromEnd, $toEnd) + ); } /** @@ -72,18 +74,18 @@ public function calculate(array $from, array $to) */ private function length(array $from, array $to) { - $current = array_fill(0, count($to) + 1, 0); - $cFrom = count($from); - $cTo = count($to); + $current = \array_fill(0, \count($to) + 1, 0); + $cFrom = \count($from); + $cTo = \count($to); for ($i = 0; $i < $cFrom; $i++) { $prev = $current; for ($j = 0; $j < $cTo; $j++) { - if ($from[$i] == $to[$j]) { + if ($from[$i] === $to[$j]) { $current[$j + 1] = $prev[$j] + 1; } else { - $current[$j + 1] = max($current[$j], $prev[$j + 1]); + $current[$j + 1] = \max($current[$j], $prev[$j + 1]); } } } diff --git a/vendor/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php b/vendor/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php index 4fc9d3e..f31db3e 100644 --- a/vendor/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php +++ b/vendor/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php @@ -1,6 +1,6 @@ * @@ -26,8 +26,8 @@ class TimeEfficientImplementation implements LongestCommonSubsequence public function calculate(array $from, array $to) { $common = array(); - $fromLength = count($from); - $toLength = count($to); + $fromLength = \count($from); + $toLength = \count($to); $width = $fromLength + 1; $matrix = new \SplFixedArray($width * ($toLength + 1)); @@ -42,7 +42,7 @@ public function calculate(array $from, array $to) for ($i = 1; $i <= $fromLength; ++$i) { for ($j = 1; $j <= $toLength; ++$j) { $o = ($j * $width) + $i; - $matrix[$o] = max( + $matrix[$o] = \max( $matrix[$o - 1], $matrix[$o - $width], $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0 @@ -54,12 +54,13 @@ public function calculate(array $from, array $to) $j = $toLength; while ($i > 0 && $j > 0) { - if ($from[$i-1] === $to[$j-1]) { - $common[] = $from[$i-1]; + if ($from[$i - 1] === $to[$j - 1]) { + $common[] = $from[$i - 1]; --$i; --$j; } else { $o = ($j * $width) + $i; + if ($matrix[$o - $width] > $matrix[$o - 1]) { --$j; } else { @@ -68,6 +69,6 @@ public function calculate(array $from, array $to) } } - return array_reverse($common); + return \array_reverse($common); } } diff --git a/vendor/sebastian/diff/src/Line.php b/vendor/sebastian/diff/src/Line.php index e0a96b9..89b8683 100644 --- a/vendor/sebastian/diff/src/Line.php +++ b/vendor/sebastian/diff/src/Line.php @@ -1,6 +1,6 @@ * @@ -10,8 +10,6 @@ namespace SebastianBergmann\Diff; -/** - */ class Line { const ADDED = 1; diff --git a/vendor/sebastian/diff/src/Parser.php b/vendor/sebastian/diff/src/Parser.php index b01511b..312c841 100644 --- a/vendor/sebastian/diff/src/Parser.php +++ b/vendor/sebastian/diff/src/Parser.php @@ -1,6 +1,6 @@ * @@ -22,33 +22,42 @@ class Parser */ public function parse($string) { - $lines = preg_split('(\r\n|\r|\n)', $string); - $lineCount = count($lines); + $lines = \preg_split('(\r\n|\r|\n)', $string); + + if (!empty($lines) && $lines[\count($lines) - 1] == '') { + \array_pop($lines); + } + + $lineCount = \count($lines); $diffs = array(); $diff = null; $collected = array(); for ($i = 0; $i < $lineCount; ++$i) { - if (preg_match('(^---\\s+(?P\\S+))', $lines[$i], $fromMatch) && - preg_match('(^\\+\\+\\+\\s+(?P\\S+))', $lines[$i + 1], $toMatch)) { + if (\preg_match('(^---\\s+(?P\\S+))', $lines[$i], $fromMatch) && + \preg_match('(^\\+\\+\\+\\s+(?P\\S+))', $lines[$i + 1], $toMatch)) { if ($diff !== null) { $this->parseFileDiff($diff, $collected); + $diffs[] = $diff; $collected = array(); } $diff = new Diff($fromMatch['file'], $toMatch['file']); + ++$i; } else { - if (preg_match('/^(?:diff --git |index [\da-f\.]+|[+-]{3} [ab])/', $lines[$i])) { + if (\preg_match('/^(?:diff --git |index [\da-f\.]+|[+-]{3} [ab])/', $lines[$i])) { continue; } + $collected[] = $lines[$i]; } } - if (count($collected) && ($diff !== null)) { + if ($diff !== null && \count($collected)) { $this->parseFileDiff($diff, $collected); + $diffs[] = $diff; } @@ -62,33 +71,35 @@ public function parse($string) private function parseFileDiff(Diff $diff, array $lines) { $chunks = array(); + $chunk = null; foreach ($lines as $line) { - if (preg_match('/^@@\s+-(?P\d+)(?:,\s*(?P\d+))?\s+\+(?P\d+)(?:,\s*(?P\d+))?\s+@@/', $line, $match)) { + if (\preg_match('/^@@\s+-(?P\d+)(?:,\s*(?P\d+))?\s+\+(?P\d+)(?:,\s*(?P\d+))?\s+@@/', $line, $match)) { $chunk = new Chunk( $match['start'], - isset($match['startrange']) ? max(1, $match['startrange']) : 1, + isset($match['startrange']) ? \max(1, $match['startrange']) : 1, $match['end'], - isset($match['endrange']) ? max(1, $match['endrange']) : 1 + isset($match['endrange']) ? \max(1, $match['endrange']) : 1 ); $chunks[] = $chunk; $diffLines = array(); + continue; } - if (preg_match('/^(?P[+ -])?(?P.*)/', $line, $match)) { + if (\preg_match('/^(?P[+ -])?(?P.*)/', $line, $match)) { $type = Line::UNCHANGED; - if ($match['type'] == '+') { + if ($match['type'] === '+') { $type = Line::ADDED; - } elseif ($match['type'] == '-') { + } elseif ($match['type'] === '-') { $type = Line::REMOVED; } $diffLines[] = new Line($type, $match['line']); - if (isset($chunk)) { + if (null !== $chunk) { $chunk->setLines($diffLines); } } diff --git a/vendor/sebastian/diff/tests/DifferTest.php b/vendor/sebastian/diff/tests/DifferTest.php index 12d0cfe..b9403f2 100644 Binary files a/vendor/sebastian/diff/tests/DifferTest.php and b/vendor/sebastian/diff/tests/DifferTest.php differ diff --git a/vendor/sebastian/diff/tests/LCS/TimeEfficientImplementationTest.php b/vendor/sebastian/diff/tests/LCS/TimeEfficientImplementationTest.php index 0f12d89..a3ecb57 100644 --- a/vendor/sebastian/diff/tests/LCS/TimeEfficientImplementationTest.php +++ b/vendor/sebastian/diff/tests/LCS/TimeEfficientImplementationTest.php @@ -1,6 +1,6 @@ * @@ -10,166 +10,13 @@ namespace SebastianBergmann\Diff\LCS; -use PHPUnit_Framework_TestCase; - /** - * Some of these tests are volontary stressfull, in order to give some approximative benchmark hints. + * @covers SebastianBergmann\Diff\LCS\TimeEfficientImplementation */ -class TimeEfficientImplementationTest extends PHPUnit_Framework_TestCase +class TimeEfficientImplementationTest extends LongestCommonSubsequenceTest { - private $implementation; - private $memory_limit; - private $stress_sizes = array(1, 2, 3, 100, 500, 1000, 2000); - - protected function setUp() - { - $this->memory_limit = ini_get('memory_limit'); - ini_set('memory_limit', '256M'); - - $this->implementation = new TimeEfficientImplementation; - } - - protected function tearDown() - { - ini_set('memory_limit', $this->memory_limit); - } - - public function testBothEmpty() - { - $from = array(); - $to = array(); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals(array(), $common); - } - - public function testIsStrictComparison() - { - $from = array( - false, 0, 0.0, '', null, array(), - true, 1, 1.0, 'foo', array('foo', 'bar'), array('foo' => 'bar') - ); - $to = $from; - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($from, $common); - - $to = array( - false, false, false, false, false, false, - true, true, true, true, true, true - ); - $expected = array( - false, - true, - ); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($expected, $common); - } - - public function testEqualSequences() - { - foreach ($this->stress_sizes as $size) { - $range = range(1, $size); - $from = $range; - $to = $range; - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($range, $common); - } - } - - public function testDistinctSequences() - { - $from = array('A'); - $to = array('B'); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals(array(), $common); - - $from = array('A', 'B', 'C'); - $to = array('D', 'E', 'F'); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals(array(), $common); - - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = range($size + 1, $size * 2); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals(array(), $common); - } - } - - public function testCommonSubsequence() - { - $from = array('A', 'C', 'E', 'F', 'G'); - $to = array('A', 'B', 'D', 'E', 'H'); - $expected = array('A', 'E'); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals($expected, $common); - - $from = array('A', 'C', 'E', 'F', 'G'); - $to = array('B', 'C', 'D', 'E', 'F', 'H'); - $expected = array('C', 'E', 'F'); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals($expected, $common); - - foreach ($this->stress_sizes as $size) { - $from = $size < 2 ? array(1) : range(1, $size + 1, 2); - $to = $size < 3 ? array(1) : range(1, $size + 1, 3); - $expected = $size < 6 ? array(1) : range(1, $size + 1, 6); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($expected, $common); - } - } - - public function testSingleElementSubsequenceAtStart() - { - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = array_slice($from, 0, 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($to, $common); - } - } - - public function testSingleElementSubsequenceAtMiddle() - { - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = array_slice($from, (int) $size / 2, 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($to, $common); - } - } - - public function testSingleElementSubsequenceAtEnd() + protected function createImplementation() { - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = array_slice($from, $size - 1, 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($to, $common); - } - } - - public function testReversedSequences() - { - $from = array('A', 'B'); - $to = array('B', 'A'); - $expected = array('A'); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals($expected, $common); - - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = array_reverse($from); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals(array(1), $common); - } + return new TimeEfficientImplementation; } } diff --git a/vendor/sebastian/diff/tests/ParserTest.php b/vendor/sebastian/diff/tests/ParserTest.php index 3a7b972..0963d83 100644 --- a/vendor/sebastian/diff/tests/ParserTest.php +++ b/vendor/sebastian/diff/tests/ParserTest.php @@ -1,6 +1,6 @@ * @@ -10,9 +10,16 @@ namespace SebastianBergmann\Diff; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class ParserTest extends PHPUnit_Framework_TestCase +/** + * @covers SebastianBergmann\Diff\Parser + * + * @uses SebastianBergmann\Diff\Chunk + * @uses SebastianBergmann\Diff\Diff + * @uses SebastianBergmann\Diff\Line + */ +class ParserTest extends TestCase { /** * @var Parser @@ -26,23 +33,28 @@ protected function setUp() public function testParse() { - $content = file_get_contents(__DIR__ . '/fixtures/patch.txt'); + $content = \file_get_contents(__DIR__ . '/fixtures/patch.txt'); $diffs = $this->parser->parse($content); + $this->assertInternalType('array', $diffs); + $this->assertContainsOnlyInstancesOf('SebastianBergmann\Diff\Diff', $diffs); $this->assertCount(1, $diffs); $chunks = $diffs[0]->getChunks(); + $this->assertInternalType('array', $chunks); + $this->assertContainsOnlyInstancesOf('SebastianBergmann\Diff\Chunk', $chunks); + $this->assertCount(1, $chunks); $this->assertEquals(20, $chunks[0]->getStart()); - $this->assertCount(5, $chunks[0]->getLines()); + $this->assertCount(4, $chunks[0]->getLines()); } public function testParseWithMultipleChunks() { - $content = file_get_contents(__DIR__ . '/fixtures/patch2.txt'); + $content = \file_get_contents(__DIR__ . '/fixtures/patch2.txt'); $diffs = $this->parser->parse($content); @@ -57,6 +69,83 @@ public function testParseWithMultipleChunks() $this->assertCount(5, $chunks[0]->getLines()); $this->assertCount(5, $chunks[1]->getLines()); - $this->assertCount(5, $chunks[2]->getLines()); + $this->assertCount(4, $chunks[2]->getLines()); + } + + public function testParseWithRemovedLines() + { + $content = <<parser->parse($content); + $this->assertInternalType('array', $diffs); + $this->assertContainsOnlyInstancesOf('SebastianBergmann\Diff\Diff', $diffs); + $this->assertCount(1, $diffs); + + $chunks = $diffs[0]->getChunks(); + + $this->assertInternalType('array', $chunks); + $this->assertContainsOnlyInstancesOf('SebastianBergmann\Diff\Chunk', $chunks); + $this->assertCount(1, $chunks); + + $chunk = $chunks[0]; + $this->assertSame(49, $chunk->getStart()); + $this->assertSame(49, $chunk->getEnd()); + $this->assertSame(9, $chunk->getStartRange()); + $this->assertSame(8, $chunk->getEndRange()); + + $lines = $chunk->getLines(); + $this->assertInternalType('array', $lines); + $this->assertContainsOnlyInstancesOf('SebastianBergmann\Diff\Line', $lines); + $this->assertCount(2, $lines); + + /** @var Line $line */ + $line = $lines[0]; + $this->assertSame('A', $line->getContent()); + $this->assertSame(Line::UNCHANGED, $line->getType()); + + $line = $lines[1]; + $this->assertSame('B', $line->getContent()); + $this->assertSame(Line::REMOVED, $line->getType()); + } + + public function testParseDiffForMulitpleFiles() + { + $content = <<parser->parse($content); + $this->assertCount(2, $diffs); + + /** @var Diff $diff */ + $diff = $diffs[0]; + $this->assertSame('a/Test.txt', $diff->getFrom()); + $this->assertSame('b/Test.txt', $diff->getTo()); + $this->assertCount(1, $diff->getChunks()); + + $diff = $diffs[1]; + $this->assertSame('a/Test2.txt', $diff->getFrom()); + $this->assertSame('b/Test2.txt', $diff->getTo()); + $this->assertCount(1, $diff->getChunks()); } } diff --git a/vendor/sebastian/environment/.gitignore b/vendor/sebastian/environment/.gitignore index 5794854..441848b 100644 --- a/vendor/sebastian/environment/.gitignore +++ b/vendor/sebastian/environment/.gitignore @@ -2,4 +2,3 @@ /vendor /composer.lock /composer.phar -/phpunit.xml diff --git a/vendor/sebastian/environment/composer.json b/vendor/sebastian/environment/composer.json index fd3ec7d..b6602c4 100644 --- a/vendor/sebastian/environment/composer.json +++ b/vendor/sebastian/environment/composer.json @@ -11,10 +11,10 @@ } ], "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "autoload": { "classmap": [ diff --git a/vendor/sebastian/environment/phpunit.xml.dist b/vendor/sebastian/environment/phpunit.xml.dist deleted file mode 100644 index 75148fd..0000000 --- a/vendor/sebastian/environment/phpunit.xml.dist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - tests - - - - - src - - - diff --git a/vendor/sebastian/environment/src/Runtime.php b/vendor/sebastian/environment/src/Runtime.php index c8985b1..179473b 100644 --- a/vendor/sebastian/environment/src/Runtime.php +++ b/vendor/sebastian/environment/src/Runtime.php @@ -50,7 +50,9 @@ public function getBinary() // PHP >= 5.4.0 if (self::$binary === null && defined('PHP_BINARY')) { - self::$binary = escapeshellarg(PHP_BINARY); + if (PHP_BINARY !== '') { + self::$binary = escapeshellarg(PHP_BINARY); + } } // PHP < 5.4.0 diff --git a/vendor/setasign/fpdi-fpdf/LICENSE b/vendor/setasign/fpdi-fpdf/LICENSE index 0520282..7e75850 100644 --- a/vendor/setasign/fpdi-fpdf/LICENSE +++ b/vendor/setasign/fpdi-fpdf/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Setasign - Jan Slabon, https://www.setasign.com +Copyright (c) 2017 Setasign - Jan Slabon, https://www.setasign.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/setasign/fpdi-fpdf/README.md b/vendor/setasign/fpdi-fpdf/README.md index 42920b4..4cead2f 100644 --- a/vendor/setasign/fpdi-fpdf/README.md +++ b/vendor/setasign/fpdi-fpdf/README.md @@ -4,7 +4,7 @@ A kind of metadata package for Composer with fixed dependencies for the latest v ## Installation with [Composer](https://packagist.org/packages/setasign/fpdi-fpdf) ```bash -$ composer require setasign/fpdi-fpdf:1.6.1 +$ composer require setasign/fpdi-fpdf:1.6.2 ``` or you can include the following in your composer.json file: @@ -12,7 +12,7 @@ or you can include the following in your composer.json file: ```json { "require": { - "setasign/fpdi-fpdf": "1.6.1" + "setasign/fpdi-fpdf": "1.6.2" } } ``` diff --git a/vendor/setasign/fpdi-fpdf/composer.json b/vendor/setasign/fpdi-fpdf/composer.json index 79413c5..6db2d6e 100644 --- a/vendor/setasign/fpdi-fpdf/composer.json +++ b/vendor/setasign/fpdi-fpdf/composer.json @@ -1,6 +1,6 @@ { "name": "setasign/fpdi-fpdf", - "version": "1.6.1", + "version": "1.6.2", "homepage": "https://www.setasign.com/fpdi", "description": "Kind of metadata package for dependencies of the latest versions of FPDI and FPDF.", "type": "library", @@ -19,7 +19,7 @@ ] }, "require": { - "setasign/fpdf": "1.8.*", - "setasign/fpdi": "1.6.*" + "setasign/fpdf": "1.8.1", + "setasign/fpdi": "1.6.2" } } diff --git a/vendor/setasign/fpdi-fpdf/fpdi_bridge.php b/vendor/setasign/fpdi-fpdf/fpdi_bridge.php index ab45876..f882212 100644 --- a/vendor/setasign/fpdi-fpdf/fpdi_bridge.php +++ b/vendor/setasign/fpdi-fpdf/fpdi_bridge.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (http://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ class fpdi_bridge extends FPDF { diff --git a/vendor/setasign/fpdi/LICENSE b/vendor/setasign/fpdi/LICENSE index 0520282..7e75850 100644 --- a/vendor/setasign/fpdi/LICENSE +++ b/vendor/setasign/fpdi/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Setasign - Jan Slabon, https://www.setasign.com +Copyright (c) 2017 Setasign - Jan Slabon, https://www.setasign.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/setasign/fpdi/README.md b/vendor/setasign/fpdi/README.md index 6aa8f37..ef7c261 100644 --- a/vendor/setasign/fpdi/README.md +++ b/vendor/setasign/fpdi/README.md @@ -17,7 +17,7 @@ This package comes without any dependency configuration in the composer.json fil A basic installation via Composer could be done this way: ```bash -$ composer require setasign/fpdi:1.6.1 +$ composer require setasign/fpdi:1.6.2 ``` or you can include the following in your composer.json file: @@ -25,7 +25,7 @@ or you can include the following in your composer.json file: ```json { "require": { - "setasign/fpdi": "1.6.1" + "setasign/fpdi": "1.6.2" } } ``` @@ -37,7 +37,7 @@ To load dependencies automatically we prepared kind of metadata packages. To use ```json { "require": { - "setasign/fpdi-fpdf": "1.6.1" + "setasign/fpdi-fpdf": "1.6.2" } } ``` @@ -47,7 +47,7 @@ For TCPDF use [this](https://github.com/Setasign/FPDI-TCPDF): ```json { "require": { - "setasign/fpdi-tcpdf": "1.6.1" + "setasign/fpdi-tcpdf": "1.6.2" } } ``` @@ -62,7 +62,7 @@ To use FPDI with FPDF include following in your composer.json file: { "require": { "setasign/fpdf": "1.8", - "setasign/fpdi": "1.6.1" + "setasign/fpdi": "1.6.2" } } ``` @@ -72,8 +72,8 @@ If you are using TCPDF, your have to update your composer.json respectively to: ```json { "require": { - "tecnickcom/tcpdf": "6.2.12", - "setasign/fpdi": "1.6.1" + "tecnickcom/tcpdf": "6.2.13", + "setasign/fpdi": "1.6.2" } } ``` diff --git a/vendor/setasign/fpdi/composer.json b/vendor/setasign/fpdi/composer.json index 4b8f370..e84f258 100644 --- a/vendor/setasign/fpdi/composer.json +++ b/vendor/setasign/fpdi/composer.json @@ -1,6 +1,6 @@ { "name": "setasign/fpdi", - "version": "1.6.1", + "version": "1.6.2", "homepage": "https://www.setasign.com/fpdi", "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", "type": "library", diff --git a/vendor/setasign/fpdi/filters/FilterASCII85.php b/vendor/setasign/fpdi/filters/FilterASCII85.php index b7e8966..dc100c4 100644 --- a/vendor/setasign/fpdi/filters/FilterASCII85.php +++ b/vendor/setasign/fpdi/filters/FilterASCII85.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ /** diff --git a/vendor/setasign/fpdi/filters/FilterASCIIHexDecode.php b/vendor/setasign/fpdi/filters/FilterASCIIHexDecode.php index e175a08..8591218 100644 --- a/vendor/setasign/fpdi/filters/FilterASCIIHexDecode.php +++ b/vendor/setasign/fpdi/filters/FilterASCIIHexDecode.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ /** diff --git a/vendor/setasign/fpdi/filters/FilterLZW.php b/vendor/setasign/fpdi/filters/FilterLZW.php index f855d22..c3d26ad 100644 --- a/vendor/setasign/fpdi/filters/FilterLZW.php +++ b/vendor/setasign/fpdi/filters/FilterLZW.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ /** diff --git a/vendor/setasign/fpdi/fpdf_tpl.php b/vendor/setasign/fpdi/fpdf_tpl.php index de746dd..47592b2 100644 --- a/vendor/setasign/fpdi/fpdf_tpl.php +++ b/vendor/setasign/fpdi/fpdf_tpl.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ if (!class_exists('fpdi_bridge')) { diff --git a/vendor/setasign/fpdi/fpdi.php b/vendor/setasign/fpdi/fpdi.php index 2d1427b..48223a3 100644 --- a/vendor/setasign/fpdi/fpdi.php +++ b/vendor/setasign/fpdi/fpdi.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ if (!class_exists('FPDF_TPL')) { @@ -22,7 +22,7 @@ class FPDI extends FPDF_TPL * * @string */ - const VERSION = '1.6.1'; + const VERSION = '1.6.2'; /** * Actual filename @@ -88,6 +88,7 @@ class FPDI extends FPDF_TPL * * @param string $filename A valid path to the PDF document from which pages should be imported from * @return int The number of pages in the document + * @throws Exception */ public function setSourceFile($filename) { @@ -95,16 +96,27 @@ public function setSourceFile($filename) if (false !== $_filename) $filename = $_filename; - $this->currentFilename = $filename; - - if (!isset($this->parsers[$filename])) { - $this->parsers[$filename] = $this->_getPdfParser($filename); - $this->setPdfVersion( - max($this->getPdfVersion(), $this->parsers[$filename]->getPdfVersion()) - ); - } + $currentFilename = $this->currentFilename; + $currentParser = $this->currentParser; - $this->currentParser = $this->parsers[$filename]; + try { + $this->currentFilename = $filename; + + if (!isset($this->parsers[$filename])) { + $this->parsers[$filename] = $this->_getPdfParser($filename); + $this->setPdfVersion( + max($this->getPdfVersion(), $this->parsers[$filename]->getPdfVersion()) + ); + } + + $this->currentParser = $this->parsers[$filename]; + + } catch (Exception $e) { + unset($this->parsers[$filename]); + $this->currentFilename = $currentFilename; + $this->currentParser = $currentParser; + throw $e; + } return $this->parsers[$filename]->getPageCount(); } diff --git a/vendor/setasign/fpdi/fpdi_bridge.php b/vendor/setasign/fpdi/fpdi_bridge.php index a7adb3d..8283876 100644 --- a/vendor/setasign/fpdi/fpdi_bridge.php +++ b/vendor/setasign/fpdi/fpdi_bridge.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ /** diff --git a/vendor/setasign/fpdi/fpdi_pdf_parser.php b/vendor/setasign/fpdi/fpdi_pdf_parser.php index 1a06bf7..a9622b0 100644 --- a/vendor/setasign/fpdi/fpdi_pdf_parser.php +++ b/vendor/setasign/fpdi/fpdi_pdf_parser.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (http://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ if (!class_exists('pdf_parser')) { @@ -155,6 +155,10 @@ public function getContent() if (isset($this->_pages[$this->pageNo][1][1]['/Contents'])) { $contents = $this->_getPageContent($this->_pages[$this->pageNo][1][1]['/Contents']); foreach ($contents AS $tmpContent) { + if ($tmpContent[0] !== pdf_parser::TYPE_STREAM) { + continue; + } + $buffer .= $this->_unFilterStream($tmpContent) . ' '; } } @@ -335,6 +339,10 @@ protected function _readPages(&$pages, &$result) foreach ($kids as $v) { $pg = $this->resolveObject($v); + if ($pg[0] !== pdf_parser::TYPE_OBJECT) { + throw new Exception('Invalid data type in page tree.'); + } + if ($pg[1][1]['/Type'][1] === '/Pages') { // If one of the kids is an embedded // /Pages array, resolve it as well. diff --git a/vendor/setasign/fpdi/pdf_context.php b/vendor/setasign/fpdi/pdf_context.php index a165f3d..f7f94e0 100644 --- a/vendor/setasign/fpdi/pdf_context.php +++ b/vendor/setasign/fpdi/pdf_context.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ /** @@ -67,7 +67,14 @@ public function __construct(&$f) public function getPos() { if ($this->_mode == 0) { - return ftell($this->file); + if (feof($this->file)) { + $stat = fstat($this->file); + fseek($this->file, $stat['size']); + } + + $pos = ftell($this->file); + + return $pos; } else { return 0; } @@ -85,7 +92,7 @@ public function reset($pos = null, $l = 100) { if ($this->_mode == 0) { if (!is_null($pos)) { - fseek ($this->file, $pos); + fseek($this->file, $pos); } $this->buffer = $l > 0 ? fread($this->file, $l) : ''; diff --git a/vendor/setasign/fpdi/pdf_parser.php b/vendor/setasign/fpdi/pdf_parser.php index 73ea4eb..5dec59e 100644 --- a/vendor/setasign/fpdi/pdf_parser.php +++ b/vendor/setasign/fpdi/pdf_parser.php @@ -3,9 +3,9 @@ * This file is part of FPDI * * @package FPDI - * @copyright Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com) + * @copyright Copyright (c) 2017 Setasign - Jan Slabon (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License - * @version 1.6.1 + * @version 1.6.2 */ /** diff --git a/vendor/symfony/yaml/Dumper.php b/vendor/symfony/yaml/Dumper.php index 05817f5..96da91e 100644 --- a/vendor/symfony/yaml/Dumper.php +++ b/vendor/symfony/yaml/Dumper.php @@ -45,8 +45,8 @@ public function setIndentation($num) * @param mixed $input The PHP value * @param int $inline The level where you switch to inline YAML * @param int $indent The level of indentation (used internally) - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise * * @return string The YAML representation of the PHP value */ diff --git a/vendor/symfony/yaml/Escaper.php b/vendor/symfony/yaml/Escaper.php index a74f14d..94bb392 100644 --- a/vendor/symfony/yaml/Escaper.php +++ b/vendor/symfony/yaml/Escaper.php @@ -33,13 +33,15 @@ class Escaper "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9"); + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", + ); private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', - '\\N', '\\_', '\\L', '\\P'); + '\\N', '\\_', '\\L', '\\P', + ); /** * Determines if a PHP value would require double quoting in YAML. @@ -50,7 +52,7 @@ class Escaper */ public static function requiresDoubleQuoting($value) { - return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); + return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); } /** @@ -82,7 +84,7 @@ public static function requiresSingleQuoting($value) // Determines if the PHP value contains any single characters that would // cause it to require single quoting in YAML. - return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); + return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); } /** diff --git a/vendor/symfony/yaml/Exception/ParseException.php b/vendor/symfony/yaml/Exception/ParseException.php index b74eb91..60802b6 100644 --- a/vendor/symfony/yaml/Exception/ParseException.php +++ b/vendor/symfony/yaml/Exception/ParseException.php @@ -24,13 +24,11 @@ class ParseException extends RuntimeException private $rawMessage; /** - * Constructor. - * - * @param string $message The error message - * @param int $parsedLine The line where the error occurred - * @param int $snippet The snippet of code near the problem - * @param string $parsedFile The file name where the error occurred - * @param \Exception $previous The previous exception + * @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|null $previous The previous exception */ public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, \Exception $previous = null) { @@ -123,7 +121,7 @@ private function updateRepr() } if (null !== $this->parsedFile) { - if (PHP_VERSION_ID >= 50400) { + if (\PHP_VERSION_ID >= 50400) { $jsonOptions = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; } else { $jsonOptions = 0; diff --git a/vendor/symfony/yaml/Inline.php b/vendor/symfony/yaml/Inline.php index 717cbfd..a4367fb 100644 --- a/vendor/symfony/yaml/Inline.php +++ b/vendor/symfony/yaml/Inline.php @@ -21,22 +21,22 @@ */ class Inline { - const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')'; + const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')'; private static $exceptionOnInvalidType = false; private static $objectSupport = false; private static $objectForMap = false; /** - * Converts a YAML string to a PHP array. + * Converts a YAML string to a PHP value. * * @param string $value A YAML string - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise - * @param bool $objectForMap true if maps should return a stdClass instead of array() + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise + * @param bool $objectForMap True if maps should return a stdClass instead of array() * @param array $references Mapping of variable names to values * - * @return array A PHP array representing the YAML string + * @return mixed A PHP value * * @throws ParseException */ @@ -87,10 +87,10 @@ public static function parse($value, $exceptionOnInvalidType = false, $objectSup * Dumps a given PHP variable to a YAML string. * * @param mixed $value The PHP variable to convert - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise * - * @return string The YAML string representing the PHP array + * @return string The YAML string representing the PHP value * * @throws DumpException When trying to dump PHP resource */ @@ -149,8 +149,8 @@ public static function dump($value, $exceptionOnInvalidType = false, $objectSupp case Escaper::requiresDoubleQuoting($value): return Escaper::escapeWithDoubleQuotes($value); case Escaper::requiresSingleQuoting($value): - case preg_match(self::getHexRegex(), $value): - case preg_match(self::getTimestampRegex(), $value): + case Parser::preg_match(self::getHexRegex(), $value): + case Parser::preg_match(self::getTimestampRegex(), $value): return Escaper::escapeWithSingleQuotes($value); default: return $value; @@ -183,8 +183,8 @@ public static function isHash(array $value) * Dumps a PHP array to a YAML string. * * @param array $value The PHP array to dump - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise * * @return string The YAML string representing the PHP array */ @@ -210,16 +210,16 @@ private static function dumpArray($value, $exceptionOnInvalidType, $objectSuppor } /** - * Parses a scalar to a YAML string. + * Parses a YAML scalar. * - * @param string $scalar - * @param string $delimiters - * @param array $stringDelimiters - * @param int &$i - * @param bool $evaluate - * @param array $references + * @param string $scalar + * @param string[] $delimiters + * @param string[] $stringDelimiters + * @param int &$i + * @param bool $evaluate + * @param array $references * - * @return string A YAML string + * @return string * * @throws ParseException When malformed inline YAML string is parsed * @@ -244,14 +244,14 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter $i += strlen($output); // remove comments - if (preg_match('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) { + if (Parser::preg_match('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) { $output = substr($output, 0, $match[0][1]); } - } elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { + } elseif (Parser::preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { $output = $match[1]; $i += strlen($output); } else { - throw new ParseException(sprintf('Malformed inline YAML string (%s).', $scalar)); + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $scalar)); } // a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >) @@ -271,19 +271,19 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter } /** - * Parses a quoted scalar to YAML. + * Parses a YAML quoted scalar. * * @param string $scalar * @param int &$i * - * @return string A YAML string + * @return string * * @throws ParseException When malformed inline YAML string is parsed */ private static function parseQuotedScalar($scalar, &$i) { - if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { - throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); + if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { + throw new ParseException(sprintf('Malformed inline YAML string: %s.', substr($scalar, $i))); } $output = substr($match[0], 1, strlen($match[0]) - 2); @@ -301,13 +301,13 @@ private static function parseQuotedScalar($scalar, &$i) } /** - * Parses a sequence to a YAML string. + * Parses a YAML sequence. * * @param string $sequence * @param int &$i * @param array $references * - * @return string A YAML string + * @return array * * @throws ParseException When malformed inline YAML string is parsed */ @@ -356,17 +356,17 @@ private static function parseSequence($sequence, &$i = 0, $references = array()) ++$i; } - throw new ParseException(sprintf('Malformed inline YAML string %s', $sequence)); + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $sequence)); } /** - * Parses a mapping to a YAML string. + * Parses a YAML mapping. * * @param string $mapping * @param int &$i * @param array $references * - * @return string A YAML string + * @return array|\stdClass * * @throws ParseException When malformed inline YAML string is parsed */ @@ -375,6 +375,7 @@ private static function parseMapping($mapping, &$i = 0, $references = array()) $output = array(); $len = strlen($mapping); ++$i; + $allowOverwrite = false; // {foo: bar, bar:foo, ...} while ($i < $len) { @@ -394,6 +395,10 @@ private static function parseMapping($mapping, &$i = 0, $references = array()) // key $key = self::parseScalar($mapping, array(':', ' '), array('"', "'"), $i, false); + if ('<<' === $key) { + $allowOverwrite = true; + } + // value $done = false; @@ -405,7 +410,12 @@ private static function parseMapping($mapping, &$i = 0, $references = array()) // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. - if (!isset($output[$key])) { + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + foreach ($value as $parsedValue) { + $output += $parsedValue; + } + } elseif ($allowOverwrite || !isset($output[$key])) { $output[$key] = $value; } $done = true; @@ -416,7 +426,10 @@ private static function parseMapping($mapping, &$i = 0, $references = array()) // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. - if (!isset($output[$key])) { + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + $output += $value; + } elseif ($allowOverwrite || !isset($output[$key])) { $output[$key] = $value; } $done = true; @@ -429,7 +442,10 @@ private static function parseMapping($mapping, &$i = 0, $references = array()) // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. - if (!isset($output[$key])) { + // But overwriting is allowed when a merge node is used in current block. + if ('<<' === $key) { + $output += $value; + } elseif ($allowOverwrite || !isset($output[$key])) { $output[$key] = $value; } $done = true; @@ -444,7 +460,7 @@ private static function parseMapping($mapping, &$i = 0, $references = array()) } } - throw new ParseException(sprintf('Malformed inline YAML string %s', $mapping)); + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $mapping)); } /** @@ -453,7 +469,7 @@ private static function parseMapping($mapping, &$i = 0, $references = array()) * @param string $scalar * @param array $references * - * @return string A YAML string + * @return mixed The evaluated YAML string * * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved */ @@ -491,7 +507,7 @@ private static function evaluateScalar($scalar, $references = array()) case 'false' === $scalarLower: return false; // Optimise for returning strings. - case $scalar[0] === '+' || $scalar[0] === '-' || $scalar[0] === '.' || $scalar[0] === '!' || is_numeric($scalar[0]): + case '+' === $scalar[0] || '-' === $scalar[0] || '.' === $scalar[0] || '!' === $scalar[0] || is_numeric($scalar[0]): switch (true) { case 0 === strpos($scalar, '!str'): return (string) substr($scalar, 5); @@ -530,16 +546,16 @@ private static function evaluateScalar($scalar, $references = array()) return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw === (string) $cast) ? $cast : $raw); case is_numeric($scalar): - case preg_match(self::getHexRegex(), $scalar): + case Parser::preg_match(self::getHexRegex(), $scalar): return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; case '.inf' === $scalarLower: case '.nan' === $scalarLower: return -log(0); case '-.inf' === $scalarLower: return log(0); - case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): + case Parser::preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): return (float) str_replace(',', '', $scalar); - case preg_match(self::getTimestampRegex(), $scalar): + case Parser::preg_match(self::getTimestampRegex(), $scalar): $timeZone = date_default_timezone_get(); date_default_timezone_set('UTC'); $time = strtotime($scalar); @@ -547,6 +563,7 @@ private static function evaluateScalar($scalar, $references = array()) return $time; } + // no break default: return (string) $scalar; } diff --git a/vendor/symfony/yaml/LICENSE b/vendor/symfony/yaml/LICENSE index 12a7453..21d7fb9 100644 --- a/vendor/symfony/yaml/LICENSE +++ b/vendor/symfony/yaml/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2016 Fabien Potencier +Copyright (c) 2004-2018 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/yaml/Parser.php b/vendor/symfony/yaml/Parser.php index 7cdb964..d043dd7 100644 --- a/vendor/symfony/yaml/Parser.php +++ b/vendor/symfony/yaml/Parser.php @@ -34,8 +34,6 @@ class Parser private $locallySkippedLineNumbers = array(); /** - * Constructor. - * * @param int $offset The offset of YAML document (used for line numbers in error messages) * @param int|null $totalNumberOfLines The overall number of lines being parsed * @param int[] $skippedLineNumbers Number of comment lines that have been skipped by the parser @@ -51,9 +49,9 @@ public function __construct($offset = 0, $totalNumberOfLines = null, array $skip * Parses a YAML string to a PHP value. * * @param string $value A YAML string - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise - * @param bool $objectForMap true if maps should return a stdClass instead of array() + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise + * @param bool $objectForMap True if maps should return a stdClass instead of array() * * @return mixed A PHP value * @@ -61,26 +59,60 @@ public function __construct($offset = 0, $totalNumberOfLines = null, array $skip */ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false) { - if (!preg_match('//u', $value)) { + if (false === preg_match('//u', $value)) { throw new ParseException('The YAML value does not appear to be valid UTF-8.'); } + + $this->refs = array(); + + $mbEncoding = null; + $e = null; + $data = null; + + if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('UTF-8'); + } + + try { + $data = $this->doParse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap); + } catch (\Exception $e) { + } catch (\Throwable $e) { + } + + if (null !== $mbEncoding) { + mb_internal_encoding($mbEncoding); + } + + $this->lines = array(); + $this->currentLine = ''; + $this->refs = array(); + $this->skippedLineNumbers = array(); + $this->locallySkippedLineNumbers = array(); + + if (null !== $e) { + throw $e; + } + + return $data; + } + + private function doParse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false) + { $this->currentLineNb = -1; $this->currentLine = ''; $value = $this->cleanup($value); $this->lines = explode("\n", $value); + $this->locallySkippedLineNumbers = array(); if (null === $this->totalNumberOfLines) { $this->totalNumberOfLines = count($this->lines); } - if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('UTF-8'); - } - $data = array(); $context = null; $allowOverwrite = false; + while ($this->moveToNextLine()) { if ($this->isCurrentLineEmpty()) { continue; @@ -92,13 +124,13 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = } $isRef = $mergeNode = false; - if (preg_match('#^\-((?P\s+)(?P.+?))?\s*$#u', $this->currentLine, $values)) { + if (self::preg_match('#^\-((?P\s+)(?P.+))?$#u', rtrim($this->currentLine), $values)) { if ($context && 'mapping' == $context) { throw new ParseException('You cannot define a sequence item when in a mapping', $this->getRealCurrentLineNb() + 1, $this->currentLine); } $context = 'sequence'; - if (isset($values['value']) && preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { + if (isset($values['value']) && self::preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { $isRef = $matches['ref']; $values['value'] = $matches['value']; } @@ -108,7 +140,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = $data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); } else { if (isset($values['leadspaces']) - && preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+?))?\s*$#u', $values['value'], $matches) + && self::preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+))?$#u', rtrim($values['value']), $matches) ) { // this is a compact notation element, add to next block and parse $block = $values['value']; @@ -124,7 +156,10 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = if ($isRef) { $this->refs[$isRef] = end($data); } - } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'")))) { + } elseif ( + self::preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+))?$#u', rtrim($this->currentLine), $values) + && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'"))) + ) { if ($context && 'sequence' == $context) { throw new ParseException('You cannot define a mapping item when in a sequence', $this->currentLineNb + 1, $this->currentLine); } @@ -146,7 +181,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = $key = (string) $key; } - if ('<<' === $key) { + if ('<<' === $key && (!isset($values['value']) || !self::preg_match('#^&(?P[^ ]+)#u', $values['value'], $refMatches))) { $mergeNode = true; $allowOverwrite = true; if (isset($values['value']) && 0 === strpos($values['value'], '*')) { @@ -161,13 +196,9 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } - foreach ($refValue as $key => $value) { - if (!isset($data[$key])) { - $data[$key] = $value; - } - } + $data += $refValue; // array union } else { - if (isset($values['value']) && $values['value'] !== '') { + if (isset($values['value']) && '' !== $values['value']) { $value = $values['value']; } else { $value = $this->getNextEmbedBlock(); @@ -187,30 +218,22 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem); } - foreach ($parsedItem as $key => $value) { - if (!isset($data[$key])) { - $data[$key] = $value; - } - } + $data += $parsedItem; // array union } } else { // If the value associated with the key is a single mapping node, each of its key/value pairs is inserted into the // current mapping, unless the key already exists in it. - foreach ($parsed as $key => $value) { - if (!isset($data[$key])) { - $data[$key] = $value; - } - } + $data += $parsed; // array union } } - } elseif (isset($values['value']) && preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { + } elseif ('<<' !== $key && isset($values['value']) && self::preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { $isRef = $matches['ref']; $values['value'] = $matches['value']; } if ($mergeNode) { // Merge keys - } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#') || '<<' === $key) { // hash // if next line is less indented or equal, then it means that the current value is null if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { @@ -221,9 +244,13 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = } } else { $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap); - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if ($allowOverwrite || !isset($data[$key])) { + + if ('<<' === $key) { + $this->refs[$refMatches['ref']] = $value; + $data += $value; + } elseif ($allowOverwrite || !isset($data[$key])) { + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. $data[$key] = $value; } } @@ -255,52 +282,13 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = throw $e; } - if (is_array($value)) { - $first = reset($value); - if (is_string($first) && 0 === strpos($first, '*')) { - $data = array(); - foreach ($value as $alias) { - $data[] = $this->refs[substr($alias, 1)]; - } - $value = $data; - } - } - - if (isset($mbEncoding)) { - mb_internal_encoding($mbEncoding); - } - return $value; } - switch (preg_last_error()) { - case PREG_INTERNAL_ERROR: - $error = 'Internal PCRE error.'; - break; - case PREG_BACKTRACK_LIMIT_ERROR: - $error = 'pcre.backtrack_limit reached.'; - break; - case PREG_RECURSION_LIMIT_ERROR: - $error = 'pcre.recursion_limit reached.'; - break; - case PREG_BAD_UTF8_ERROR: - $error = 'Malformed UTF-8 data.'; - break; - case PREG_BAD_UTF8_OFFSET_ERROR: - $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; - break; - default: - $error = 'Unable to parse.'; - } - - throw new ParseException($error, $this->getRealCurrentLineNb() + 1, $this->currentLine); + throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } } - if (isset($mbEncoding)) { - mb_internal_encoding($mbEncoding); - } - if ($objectForMap && !is_object($data) && 'mapping' === $context) { $object = new \stdClass(); @@ -329,7 +317,7 @@ private function parseBlock($offset, $yaml, $exceptionOnInvalidType, $objectSupp $parser = new self($offset, $this->totalNumberOfLines, $skippedLineNumbers); $parser->refs = &$this->refs; - return $parser->parse($yaml, $exceptionOnInvalidType, $objectSupport, $objectForMap); + return $parser->doParse($yaml, $exceptionOnInvalidType, $objectSupport, $objectForMap); } /** @@ -426,7 +414,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false) $indent = $this->getCurrentLineIndentation(); // terminate all block scalars that are more indented than the current line - if (!empty($blockScalarIndentations) && $indent < $previousLineIndentation && trim($this->currentLine) !== '') { + if (!empty($blockScalarIndentations) && $indent < $previousLineIndentation && '' !== trim($this->currentLine)) { foreach ($blockScalarIndentations as $key => $blockScalarIndentation) { if ($blockScalarIndentation >= $this->getCurrentLineIndentation()) { unset($blockScalarIndentations[$key]); @@ -440,7 +428,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false) $previousLineIndentation = $indent; - if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) { + if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) { $this->moveToPreviousLine(); break; } @@ -515,7 +503,7 @@ private function moveToPreviousLine() * @param string $value A YAML value * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise * @param bool $objectSupport True if object support is enabled, false otherwise - * @param bool $objectForMap true if maps should return a stdClass instead of array() + * @param bool $objectForMap True if maps should return a stdClass instead of array() * @param string $context The parser context (either sequence or mapping) * * @return mixed A PHP value @@ -538,7 +526,7 @@ private function parseValue($value, $exceptionOnInvalidType, $objectSupport, $ob return $this->refs[$value]; } - if (preg_match('/^'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { + if (self::preg_match('/^'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; return $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs($modifiers)); @@ -593,7 +581,7 @@ private function parseBlockScalar($style, $chomping = '', $indentation = 0) // determine indentation if not specified if (0 === $indentation) { - if (preg_match('/^ +/', $this->currentLine, $matches)) { + if (self::preg_match('/^ +/', $this->currentLine, $matches)) { $indentation = strlen($matches[0]); } } @@ -604,7 +592,7 @@ private function parseBlockScalar($style, $chomping = '', $indentation = 0) while ( $notEOF && ( $isCurrentLineBlank || - preg_match($pattern, $this->currentLine, $matches) + self::preg_match($pattern, $this->currentLine, $matches) ) ) { if ($isCurrentLineBlank && strlen($this->currentLine) > $indentation) { @@ -637,7 +625,7 @@ private function parseBlockScalar($style, $chomping = '', $indentation = 0) $previousLineIndented = false; $previousLineBlank = false; - for ($i = 0; $i < count($blockLines); ++$i) { + for ($i = 0, $blockLinesCount = count($blockLines); $i < $blockLinesCount; ++$i) { if ('' === $blockLines[$i]) { $text .= "\n"; $previousLineIndented = false; @@ -692,10 +680,7 @@ private function isNextLineIndented() return false; } - $ret = false; - if ($this->getCurrentLineIndentation() > $currentIndentation) { - $ret = true; - } + $ret = $this->getCurrentLineIndentation() > $currentIndentation; $this->moveToPreviousLine(); @@ -732,7 +717,7 @@ private function isCurrentLineComment() //checking explicitly the first char of the trim is faster than loops or strpos $ltrimmedLine = ltrim($this->currentLine, ' '); - return '' !== $ltrimmedLine && $ltrimmedLine[0] === '#'; + return '' !== $ltrimmedLine && '#' === $ltrimmedLine[0]; } private function isCurrentLineLastLineInDocument() @@ -758,7 +743,7 @@ private function cleanup($value) // remove leading comments $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); - if ($count == 1) { + if (1 == $count) { // items have been removed, update the offset $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); $value = $trimmedValue; @@ -766,7 +751,7 @@ private function cleanup($value) // remove start of the document marker (---) $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); - if ($count == 1) { + if (1 == $count) { // items have been removed, update the offset $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); $value = $trimmedValue; @@ -796,14 +781,7 @@ private function isNextLineUnIndentedCollection() return false; } - $ret = false; - if ( - $this->getCurrentLineIndentation() == $currentIndentation - && - $this->isStringUnIndentedCollectionItem() - ) { - $ret = true; - } + $ret = $this->getCurrentLineIndentation() === $currentIndentation && $this->isStringUnIndentedCollectionItem(); $this->moveToPreviousLine(); @@ -827,6 +805,48 @@ private function isStringUnIndentedCollectionItem() */ private function isBlockScalarHeader() { - return (bool) preg_match('~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~', $this->currentLine); + return (bool) self::preg_match('~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~', $this->currentLine); + } + + /** + * A local wrapper for `preg_match` which will throw a ParseException if there + * is an internal error in the PCRE engine. + * + * This avoids us needing to check for "false" every time PCRE is used + * in the YAML engine + * + * @throws ParseException on a PCRE internal error + * + * @see preg_last_error() + * + * @internal + */ + public static function preg_match($pattern, $subject, &$matches = null, $flags = 0, $offset = 0) + { + if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) { + switch (preg_last_error()) { + case PREG_INTERNAL_ERROR: + $error = 'Internal PCRE error.'; + break; + case PREG_BACKTRACK_LIMIT_ERROR: + $error = 'pcre.backtrack_limit reached.'; + break; + case PREG_RECURSION_LIMIT_ERROR: + $error = 'pcre.recursion_limit reached.'; + break; + case PREG_BAD_UTF8_ERROR: + $error = 'Malformed UTF-8 data.'; + break; + case PREG_BAD_UTF8_OFFSET_ERROR: + $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; + break; + default: + $error = 'Error.'; + } + + throw new ParseException($error); + } + + return $ret; } } diff --git a/vendor/symfony/yaml/Tests/DumperTest.php b/vendor/symfony/yaml/Tests/DumperTest.php index 84069d8..6a1b3ac 100644 --- a/vendor/symfony/yaml/Tests/DumperTest.php +++ b/vendor/symfony/yaml/Tests/DumperTest.php @@ -11,10 +11,11 @@ namespace Symfony\Component\Yaml\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\Yaml\Parser; use Symfony\Component\Yaml\Dumper; -class DumperTest extends \PHPUnit_Framework_TestCase +class DumperTest extends TestCase { protected $parser; protected $dumper; @@ -209,23 +210,25 @@ public function testEscapedEscapeSequencesInQuotedScalar($input, $expected) public function getEscapeSequences() { return array( - 'null' => array("\t\\0", '"\t\\\\0"'), - 'bell' => array("\t\\a", '"\t\\\\a"'), - 'backspace' => array("\t\\b", '"\t\\\\b"'), - 'horizontal-tab' => array("\t\\t", '"\t\\\\t"'), - 'line-feed' => array("\t\\n", '"\t\\\\n"'), - 'vertical-tab' => array("\t\\v", '"\t\\\\v"'), - 'form-feed' => array("\t\\f", '"\t\\\\f"'), - 'carriage-return' => array("\t\\r", '"\t\\\\r"'), - 'escape' => array("\t\\e", '"\t\\\\e"'), - 'space' => array("\t\\ ", '"\t\\\\ "'), - 'double-quote' => array("\t\\\"", '"\t\\\\\\""'), - 'slash' => array("\t\\/", '"\t\\\\/"'), - 'backslash' => array("\t\\\\", '"\t\\\\\\\\"'), - 'next-line' => array("\t\\N", '"\t\\\\N"'), - 'non-breaking-space' => array("\t\\�", '"\t\\\\�"'), - 'line-separator' => array("\t\\L", '"\t\\\\L"'), - 'paragraph-separator' => array("\t\\P", '"\t\\\\P"'), + 'empty string' => array('', "''"), + 'null' => array("\x0", '"\\0"'), + 'bell' => array("\x7", '"\\a"'), + 'backspace' => array("\x8", '"\\b"'), + 'horizontal-tab' => array("\t", '"\\t"'), + 'line-feed' => array("\n", '"\\n"'), + 'vertical-tab' => array("\v", '"\\v"'), + 'form-feed' => array("\xC", '"\\f"'), + 'carriage-return' => array("\r", '"\\r"'), + 'escape' => array("\x1B", '"\\e"'), + 'space' => array(' ', "' '"), + 'double-quote' => array('"', "'\"'"), + 'slash' => array('/', '/'), + 'backslash' => array('\\', '\\'), + 'next-line' => array("\xC2\x85", '"\\N"'), + 'non-breaking-space' => array("\xc2\xa0", '"\\_"'), + 'line-separator' => array("\xE2\x80\xA8", '"\\L"'), + 'paragraph-separator' => array("\xE2\x80\xA9", '"\\P"'), + 'colon' => array(':', "':'"), ); } diff --git a/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml b/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml index 4b67d34..499446c 100644 --- a/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml +++ b/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml @@ -10,9 +10,11 @@ yaml: | a: Steve b: Clark c: Brian + e: notnull bar: a: before d: other + e: ~ <<: *foo b: new x: Oren @@ -20,6 +22,7 @@ yaml: | foo: bar foo: ignore bar: foo + bar_inline: {a: before, d: other, <<: *foo, b: new, x: Oren, c: { foo: bar, foo: ignore, bar: foo}} duplicate: foo: bar foo: ignore @@ -44,15 +47,20 @@ yaml: | p: 12345 z: <<: *nestedref + head_inline: &head_inline { <<: [ *foo , *dong , *foo2 ] } + recursive_inline: { <<: *head_inline, c: { <<: *foo2 } } php: | array( - 'foo' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian'), - 'bar' => array('a' => 'before', 'd' => 'other', 'b' => 'new', 'c' => array('foo' => 'bar', 'bar' => 'foo'), 'x' => 'Oren'), + 'foo' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull'), + 'bar' => array('a' => 'before', 'd' => 'other', 'e' => null, 'b' => 'new', 'c' => array('foo' => 'bar', 'bar' => 'foo'), 'x' => 'Oren'), + 'bar_inline' => array('a' => 'before', 'd' => 'other', 'b' => 'new', 'c' => array('foo' => 'bar', 'bar' => 'foo'), 'e' => 'notnull', 'x' => 'Oren'), 'duplicate' => array('foo' => 'bar'), 'foo2' => array('a' => 'Ballmer'), 'ding' => array('fi', 'fei', 'fo', 'fam'), - 'check' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'fi', 'fei', 'fo', 'fam', 'isit' => 'tested'), - 'head' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'fi', 'fei', 'fo', 'fam'), + 'check' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam', 'isit' => 'tested'), + 'head' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam'), 'taz' => array('a' => 'Steve', 'w' => array('p' => 1234)), - 'nested' => array('a' => 'Steve', 'w' => array('p' => 12345), 'd' => 'Doug', 'z' => array('p' => 12345)) + 'nested' => array('a' => 'Steve', 'w' => array('p' => 12345), 'd' => 'Doug', 'z' => array('p' => 12345)), + 'head_inline' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam'), + 'recursive_inline' => array('a' => 'Steve', 'b' => 'Clark', 'c' => array('a' => 'Ballmer'), 'e' => 'notnull', 'fi', 'fei', 'fo', 'fam'), ) diff --git a/vendor/symfony/yaml/Tests/InlineTest.php b/vendor/symfony/yaml/Tests/InlineTest.php index e349bfc..7ca692d 100644 --- a/vendor/symfony/yaml/Tests/InlineTest.php +++ b/vendor/symfony/yaml/Tests/InlineTest.php @@ -11,9 +11,10 @@ namespace Symfony\Component\Yaml\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\Yaml\Inline; -class InlineTest extends \PHPUnit_Framework_TestCase +class InlineTest extends TestCase { /** * @dataProvider getTestsForParse @@ -192,27 +193,42 @@ public function testParseUnquotedAsteriskFollowedByAComment() /** * @group legacy - * @dataProvider getReservedIndicators + * @expectedDeprecation Not quoting the scalar "@foo " starting with "@" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0. * throws \Symfony\Component\Yaml\Exception\ParseException in 3.0 */ - public function testParseUnquotedScalarStartingWithReservedIndicator($indicator) + public function testParseUnquotedScalarStartingWithReservedAtIndicator() { - Inline::parse(sprintf('{ foo: %sfoo }', $indicator)); + Inline::parse('{ foo: @foo }'); } - public function getReservedIndicators() + /** + * @group legacy + * @expectedDeprecation Not quoting the scalar "`foo " starting with "`" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0. + * throws \Symfony\Component\Yaml\Exception\ParseException in 3.0 + */ + public function testParseUnquotedScalarStartingWithReservedBacktickIndicator() + { + Inline::parse('{ foo: `foo }'); + } + + /** + * @group legacy + * @expectedDeprecation Not quoting the scalar "|foo " starting with "|" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0. + * throws \Symfony\Component\Yaml\Exception\ParseException in 3.0 + */ + public function testParseUnquotedScalarStartingWithLiteralStyleIndicator() { - return array(array('@'), array('`')); + Inline::parse('{ foo: |foo }'); } /** * @group legacy - * @dataProvider getScalarIndicators + * @expectedDeprecation Not quoting the scalar ">foo " starting with ">" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0. * throws \Symfony\Component\Yaml\Exception\ParseException in 3.0 */ - public function testParseUnquotedScalarStartingWithScalarIndicator($indicator) + public function testParseUnquotedScalarStartingWithFoldedStyleIndicator() { - Inline::parse(sprintf('{ foo: %sfoo }', $indicator)); + Inline::parse('{ foo: >foo }'); } public function getScalarIndicators() @@ -448,4 +464,34 @@ public function getTestsForDump() array('{ foo: { bar: { 1: 2, baz: 3 } } }', array('foo' => array('bar' => array(1 => 2, 'baz' => 3)))), ); } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage Malformed inline YAML string: {this, is not, supported}. + */ + public function testNotSupportedMissingValue() + { + Inline::parse('{this, is not, supported}'); + } + + public function testVeryLongQuotedStrings() + { + $longStringWithQuotes = str_repeat("x\r\n\\\"x\"x", 1000); + + $yamlString = Inline::dump(array('longStringWithQuotes' => $longStringWithQuotes)); + $arrayFromYaml = Inline::parse($yamlString); + + $this->assertEquals($longStringWithQuotes, $arrayFromYaml['longStringWithQuotes']); + } + + public function testBooleanMappingKeysAreConvertedToStrings() + { + $this->assertSame(array('false' => 'foo'), Inline::parse('{false: foo}')); + $this->assertSame(array('true' => 'foo'), Inline::parse('{true: foo}')); + } + + public function testTheEmptyStringIsAValidMappingKey() + { + $this->assertSame(array('' => 'foo'), Inline::parse('{ "": foo }')); + } } diff --git a/vendor/symfony/yaml/Tests/ParseExceptionTest.php b/vendor/symfony/yaml/Tests/ParseExceptionTest.php index e4eb9c9..b7797fb 100644 --- a/vendor/symfony/yaml/Tests/ParseExceptionTest.php +++ b/vendor/symfony/yaml/Tests/ParseExceptionTest.php @@ -11,14 +11,15 @@ namespace Symfony\Component\Yaml\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\Yaml\Exception\ParseException; -class ParseExceptionTest extends \PHPUnit_Framework_TestCase +class ParseExceptionTest extends TestCase { public function testGetMessage() { $exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml'); - if (PHP_VERSION_ID >= 50400) { + if (\PHP_VERSION_ID >= 50400) { $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")'; } else { $message = 'Error message in "\\/var\\/www\\/app\\/config.yml" at line 42 (near "foo: bar")'; @@ -30,7 +31,7 @@ public function testGetMessage() public function testGetMessageWithUnicodeInFilename() { $exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml'); - if (PHP_VERSION_ID >= 50400) { + if (\PHP_VERSION_ID >= 50400) { $message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")'; } else { $message = 'Error message in "\u00e4\u00f6\u00fc.yml" at line 42 (near "foo: bar")'; diff --git a/vendor/symfony/yaml/Tests/ParserTest.php b/vendor/symfony/yaml/Tests/ParserTest.php index 9e9a715..c990423 100644 --- a/vendor/symfony/yaml/Tests/ParserTest.php +++ b/vendor/symfony/yaml/Tests/ParserTest.php @@ -11,12 +11,13 @@ namespace Symfony\Component\Yaml\Tests; -use Symfony\Bridge\PhpUnit\ErrorAssert; +use PHPUnit\Framework\TestCase; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Parser; -class ParserTest extends \PHPUnit_Framework_TestCase +class ParserTest extends TestCase { + /** @var Parser */ protected $parser; protected function setUp() @@ -190,6 +191,22 @@ public function getBlockChompingTests() ); $tests['Literal block chomping clip with multiple trailing newlines'] = array($expected, $yaml); + $yaml = <<<'EOF' +foo: +- bar: | + one + + two +EOF; + $expected = array( + 'foo' => array( + array( + 'bar' => "one\n\ntwo", + ), + ), + ); + $tests['Literal block chomping clip with embedded blank line inside unindented collection'] = array($expected, $yaml); + $yaml = <<<'EOF' foo: | one @@ -422,13 +439,13 @@ public function testBlockLiteralWithLeadingNewlines() public function testObjectSupportEnabled() { - $input = <<assertEquals(array('foo' => new B(), 'bar' => 1), $this->parser->parse($input, false, true), '->parse() is able to parse objects'); - $input = <<baz = 'foobar'; $tests['object-for-map-is-applied-after-parsing'] = array($yaml, $expected); - $yaml = <<array[1]->key = 'two'; $tests['nest-map-and-sequence'] = array($yaml, $expected); - $yaml = <<map->{2} = 'two'; $tests['numeric-keys'] = array($yaml, $expected); - $yaml = <<parser; - - ErrorAssert::assertDeprecationsAreTriggered('Using a colon in the unquoted mapping value "bar: baz" in line 1 is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.', function () use ($parser) { - $yaml = <<parse($yaml); - }); + + $this->parser->parse($yaml); } public function testColonInMappingValueExceptionNotTriggeredByColonInComment() { - $yaml = << @@ -1088,7 +1102,7 @@ public function getCommentLikeStringInScalarBlockData() public function testBlankLinesAreParsedAsNewLinesInFoldedBlocks() { - $yaml = <<

A heading

@@ -1100,7 +1114,7 @@ public function testBlankLinesAreParsedAsNewLinesInFoldedBlocks() $this->assertSame( array( - 'test' => << <<<'EOT'

A heading

  • a list
  • may be a good example
EOT @@ -1112,7 +1126,7 @@ public function testBlankLinesAreParsedAsNewLinesInFoldedBlocks() public function testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() { - $yaml = <<

A heading

@@ -1124,7 +1138,7 @@ public function testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() $this->assertSame( array( - 'test' => << <<<'EOT'

A heading

  • a list
  • @@ -1144,10 +1158,12 @@ public function testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() */ public function testParserThrowsExceptionWithCorrectLineNumber($lineNumber, $yaml) { - $this->setExpectedException( - '\Symfony\Component\Yaml\Exception\ParseException', - sprintf('Unexpected characters near "," at line %d (near "bar: "123",").', $lineNumber) - ); + if (method_exists($this, 'expectException')) { + $this->expectException('\Symfony\Component\Yaml\Exception\ParseException'); + $this->expectExceptionMessage(sprintf('Unexpected characters near "," at line %d (near "bar: "123",").', $lineNumber)); + } else { + $this->setExpectedException('\Symfony\Component\Yaml\Exception\ParseException', sprintf('Unexpected characters near "," at line %d (near "bar: "123",").', $lineNumber)); + } $this->parser->parse($yaml); } @@ -1157,7 +1173,7 @@ public function parserThrowsExceptionWithCorrectLineNumberProvider() return array( array( 4, - << $longStringWithSpaces); + + $yamlString = Yaml::dump($trickyVal); + $arrayFromYaml = $this->parser->parse($yamlString); + + $this->assertEquals($trickyVal, $arrayFromYaml); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage Reference "foo" does not exist at line 2 + */ + public function testParserCleansUpReferencesBetweenRuns() + { + $yaml = <<parser->parse($yaml); + + $yaml = <<parser->parse($yaml); + } + + public function testParseReferencesOnMergeKeys() + { + $yaml = << array( + 'a' => 'foo', + 'b' => 'bar', + 'c' => 'baz', + ), + 'mergekeyderef' => array( + 'd' => 'quux', + 'b' => 'bar', + 'c' => 'baz', + ), + ); + + $this->assertSame($expected, $this->parser->parse($yaml)); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage Reference "foo" does not exist + */ + public function testEvalRefException() + { + $yaml = <<parser->parse($yaml); + } } class B diff --git a/vendor/symfony/yaml/Tests/YamlTest.php b/vendor/symfony/yaml/Tests/YamlTest.php index 883ee83..9e776ca 100644 --- a/vendor/symfony/yaml/Tests/YamlTest.php +++ b/vendor/symfony/yaml/Tests/YamlTest.php @@ -11,9 +11,10 @@ namespace Symfony\Component\Yaml\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\Yaml\Yaml; -class YamlTest extends \PHPUnit_Framework_TestCase +class YamlTest extends TestCase { public function testParseAndDump() { diff --git a/vendor/symfony/yaml/Yaml.php b/vendor/symfony/yaml/Yaml.php index 6fc4e92..595fbef 100644 --- a/vendor/symfony/yaml/Yaml.php +++ b/vendor/symfony/yaml/Yaml.php @@ -33,7 +33,7 @@ class Yaml * you must validate the input before calling this method. Passing a file * as an input is a deprecated feature and will be removed in 3.0. * - * Note: the ability to pass file names to the Yaml::parse method is deprecated since version 2.2 and will be removed in 3.0. Pass the YAML contents of the file instead. + * Note: the ability to pass file names to the Yaml::parse method is deprecated since Symfony 2.2 and will be removed in 3.0. Pass the YAML contents of the file instead. * * @param string $input Path to a YAML file or a string containing YAML * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise @@ -48,8 +48,8 @@ public static function parse($input, $exceptionOnInvalidType = false, $objectSup { // if input is a file, process it $file = ''; - if (strpos($input, "\n") === false && is_file($input)) { - @trigger_error('The ability to pass file names to the '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Pass the YAML contents of the file instead.', E_USER_DEPRECATED); + if (false === strpos($input, "\n") && is_file($input)) { + @trigger_error('The ability to pass file names to the '.__METHOD__.' method is deprecated since Symfony 2.2 and will be removed in 3.0. Pass the YAML contents of the file instead.', E_USER_DEPRECATED); if (false === is_readable($input)) { throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input)); @@ -81,8 +81,8 @@ public static function parse($input, $exceptionOnInvalidType = false, $objectSup * @param mixed $input The PHP value * @param int $inline The level where you switch to inline YAML * @param int $indent The amount of spaces to use for indentation of nested nodes - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise * * @return string A YAML string representing the original PHP value */ diff --git a/vendor/symfony/yaml/phpunit.xml.dist b/vendor/symfony/yaml/phpunit.xml.dist index 6bdbea1..7c732f8 100644 --- a/vendor/symfony/yaml/phpunit.xml.dist +++ b/vendor/symfony/yaml/phpunit.xml.dist @@ -5,6 +5,8 @@ backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" + failOnRisky="true" + failOnWarning="true" >