# HG changeset patch # User Chris Cannam # Date 1519401127 0 # Node ID 7a779792577d8ff8b874e1f4da6ab7f3c8b6fd50 # Parent bfffd8d7479a2f7818af8062aef553ef666a183f Update Drupal core to v8.4.5 (via Composer) diff -r bfffd8d7479a -r 7a779792577d composer.lock --- a/composer.lock Fri Feb 23 15:51:18 2018 +0000 +++ b/composer.lock Fri Feb 23 15:52:07 2018 +0000 @@ -4,26 +4,26 @@ "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": "d4badee5a354c5b329b88bbcbaf8353b", + "content-hash": "673d6450e7592482b377d82d279d6f25", "packages": [ { "name": "asm89/stack-cors", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/asm89/stack-cors.git", - "reference": "65ccbd455370f043c2e3b93482a3813603d68731" + "reference": "c163e2b614550aedcf71165db2473d936abbced6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/asm89/stack-cors/zipball/65ccbd455370f043c2e3b93482a3813603d68731", - "reference": "65ccbd455370f043c2e3b93482a3813603d68731", + "url": "https://api.github.com/repos/asm89/stack-cors/zipball/c163e2b614550aedcf71165db2473d936abbced6", + "reference": "c163e2b614550aedcf71165db2473d936abbced6", "shasum": "" }, "require": { "php": ">=5.5.9", - "symfony/http-foundation": "~2.7|~3.0", - "symfony/http-kernel": "~2.7|~3.0" + "symfony/http-foundation": "~2.7|~3.0|~4.0", + "symfony/http-kernel": "~2.7|~3.0|~4.0" }, "require-dev": { "phpunit/phpunit": "^5.0 || ^4.8.10", @@ -32,7 +32,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -56,20 +56,20 @@ "cors", "stack" ], - "time": "2017-04-11T20:03:41+00:00" + "time": "2017-12-20T14:37:45+00:00" }, { "name": "composer/installers", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b" + "reference": "049797d727261bf27f2690430d935067710049c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", - "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", + "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2", + "reference": "049797d727261bf27f2690430d935067710049c2", "shasum": "" }, "require": { @@ -81,7 +81,7 @@ }, "require-dev": { "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" + "phpunit/phpunit": "^4.8.36" }, "type": "composer-plugin", "extra": { @@ -152,15 +152,18 @@ "lavalite", "lithium", "magento", + "majima", "mako", "mediawiki", "modulework", + "modx", "moodle", "osclass", "phpbb", "piwik", "ppi", "puppet", + "pxcms", "reindex", "roundcube", "shopware", @@ -173,7 +176,7 @@ "zend", "zikula" ], - "time": "2017-08-09T07:53:48+00:00" + "time": "2017-12-29T09:13:20+00:00" }, { "name": "composer/semver", @@ -239,29 +242,29 @@ }, { "name": "consolidation/annotated-command", - "version": "2.8.1", + "version": "2.8.2", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "7f94009d732922d61408536f9228aca8f22e9135" + "reference": "e97c38717eae23a2bafcf3f09438290eee6ebeb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7f94009d732922d61408536f9228aca8f22e9135", - "reference": "7f94009d732922d61408536f9228aca8f22e9135", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/e97c38717eae23a2bafcf3f09438290eee6ebeb4", + "reference": "e97c38717eae23a2bafcf3f09438290eee6ebeb4", "shasum": "" }, "require": { "consolidation/output-formatters": "^3.1.12", "php": ">=5.4.0", "psr/log": "^1", - "symfony/console": "^2.8|~3", - "symfony/event-dispatcher": "^2.5|^3", - "symfony/finder": "^2.5|^3" + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", + "satooshi/php-coveralls": "^1.0.2 | dev-master", "squizlabs/php_codesniffer": "^2.7" }, "type": "library", @@ -286,30 +289,30 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-10-17T01:48:51+00:00" + "time": "2017-11-29T16:23:23+00:00" }, { "name": "consolidation/output-formatters", - "version": "3.1.12", + "version": "3.1.13", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a" + "reference": "3188461e965b32148c8fb85261833b2b72d34b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", - "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/3188461e965b32148c8fb85261833b2b72d34b8c", + "reference": "3188461e965b32148c8fb85261833b2b72d34b8c", "shasum": "" }, "require": { "php": ">=5.4.0", - "symfony/console": "^2.8|~3", - "symfony/finder": "~2.5|~3.0" + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", + "satooshi/php-coveralls": "^1.0.2 | dev-master", "squizlabs/php_codesniffer": "^2.7", "victorjonsson/markdowndocs": "^1.3" }, @@ -335,7 +338,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-10-12T19:38:03+00:00" + "time": "2017-11-29T15:25:38+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -372,35 +375,35 @@ }, { "name": "doctrine/annotations", - "version": "v1.2.7", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": ">=5.3.2" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", @@ -436,20 +439,20 @@ "docblock", "parser" ], - "time": "2015-08-31T12:32:49+00:00" + "time": "2017-02-24T16:22:25+00:00" }, { "name": "doctrine/cache", - "version": "v1.6.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3" + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/b6f544a20f4807e81f7044d31e679ccbb1866dc3", - "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3", + "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", "shasum": "" }, "require": { @@ -506,32 +509,33 @@ "cache", "caching" ], - "time": "2016-10-29T11:16:17+00:00" + "time": "2017-07-22T12:49:21+00:00" }, { "name": "doctrine/collections", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -572,20 +576,20 @@ "collections", "iterator" ], - "time": "2015-04-14T22:21:58+00:00" + "time": "2017-01-03T10:49:41+00:00" }, { "name": "doctrine/common", - "version": "v2.6.2", + "version": "v2.7.3", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3" + "reference": "4acb8f89626baafede6ee5475bc5844096eba8a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3", - "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3", + "url": "https://api.github.com/repos/doctrine/common/zipball/4acb8f89626baafede6ee5475bc5844096eba8a9", + "reference": "4acb8f89626baafede6ee5475bc5844096eba8a9", "shasum": "" }, "require": { @@ -594,10 +598,10 @@ "doctrine/collections": "1.*", "doctrine/inflector": "1.*", "doctrine/lexer": "1.*", - "php": "~5.5|~7.0" + "php": "~5.6|~7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0" + "phpunit/phpunit": "^5.4.6" }, "type": "library", "extra": { @@ -645,37 +649,37 @@ "persistence", "spl" ], - "time": "2016-11-30T16:50:46+00:00" + "time": "2017-07-22T08:35:12+00:00" }, { "name": "doctrine/inflector", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -712,7 +716,7 @@ "singularize", "string" ], - "time": "2015-11-06T14:35:42+00:00" + "time": "2017-07-22T12:18:28+00:00" }, { "name": "doctrine/lexer", @@ -769,207 +773,212 @@ "time": "2014-09-09T13:34:57+00:00" }, { - "name": "drupal/migrate_plus", - "version": "2.0.0-beta2", + "name": "drupal/core", + "version": "8.4.5", "source": { "type": "git", - "url": "https://git.drupal.org/project/migrate_plus", - "reference": "8.x-2.0-beta2" + "url": "https://github.com/drupal/core.git", + "reference": "44a857df6f7ffd063cffed9a41767cdc50dd7474" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/migrate_plus-8.x-2.0-beta2.zip", - "reference": "8.x-2.0-beta2", - "shasum": "0b29113a3c00c7ab3ba73e811da3450edca4c0bb" + "url": "https://api.github.com/repos/drupal/core/zipball/44a857df6f7ffd063cffed9a41767cdc50dd7474", + "reference": "44a857df6f7ffd063cffed9a41767cdc50dd7474", + "shasum": "" }, "require": { - "drupal/core": "^8.1" + "asm89/stack-cors": "^1.1", + "composer/semver": "^1.0", + "doctrine/annotations": "^1.2", + "doctrine/common": "^2.5", + "easyrdf/easyrdf": "^0.9", + "egulias/email-validator": "^1.2", + "guzzlehttp/guzzle": "^6.2.1", + "masterminds/html5": "^2.1", + "paragonie/random_compat": "^1.0|^2.0", + "php": ">=5.5.9", + "stack/builder": "^1.0", + "symfony-cmf/routing": "^1.4", + "symfony/class-loader": "~3.2.8", + "symfony/console": "~3.2.8", + "symfony/dependency-injection": "~3.2.8", + "symfony/event-dispatcher": "~3.2.8", + "symfony/http-foundation": "~3.2.8", + "symfony/http-kernel": "~3.2.8", + "symfony/polyfill-iconv": "^1.0", + "symfony/process": "~3.2.8", + "symfony/psr-http-message-bridge": "^1.0", + "symfony/routing": "~3.2.8", + "symfony/serializer": "~3.2.8", + "symfony/translation": "~3.2.8", + "symfony/validator": "~3.2.8", + "symfony/yaml": "~3.2.8", + "twig/twig": "^1.23.1", + "zendframework/zend-diactoros": "^1.1", + "zendframework/zend-feed": "^2.4" + }, + "conflict": { + "drush/drush": "<8.1.10" + }, + "replace": { + "drupal/action": "self.version", + "drupal/aggregator": "self.version", + "drupal/automated_cron": "self.version", + "drupal/ban": "self.version", + "drupal/bartik": "self.version", + "drupal/basic_auth": "self.version", + "drupal/big_pipe": "self.version", + "drupal/block": "self.version", + "drupal/block_content": "self.version", + "drupal/block_place": "self.version", + "drupal/book": "self.version", + "drupal/breakpoint": "self.version", + "drupal/ckeditor": "self.version", + "drupal/classy": "self.version", + "drupal/color": "self.version", + "drupal/comment": "self.version", + "drupal/config": "self.version", + "drupal/config_translation": "self.version", + "drupal/contact": "self.version", + "drupal/content_moderation": "self.version", + "drupal/content_translation": "self.version", + "drupal/contextual": "self.version", + "drupal/core-annotation": "self.version", + "drupal/core-assertion": "self.version", + "drupal/core-bridge": "self.version", + "drupal/core-class-finder": "self.version", + "drupal/core-datetime": "self.version", + "drupal/core-dependency-injection": "self.version", + "drupal/core-diff": "self.version", + "drupal/core-discovery": "self.version", + "drupal/core-event-dispatcher": "self.version", + "drupal/core-file-cache": "self.version", + "drupal/core-filesystem": "self.version", + "drupal/core-gettext": "self.version", + "drupal/core-graph": "self.version", + "drupal/core-http-foundation": "self.version", + "drupal/core-php-storage": "self.version", + "drupal/core-plugin": "self.version", + "drupal/core-proxy-builder": "self.version", + "drupal/core-render": "self.version", + "drupal/core-serialization": "self.version", + "drupal/core-transliteration": "self.version", + "drupal/core-utility": "self.version", + "drupal/core-uuid": "self.version", + "drupal/datetime": "self.version", + "drupal/datetime_range": "self.version", + "drupal/dblog": "self.version", + "drupal/dynamic_page_cache": "self.version", + "drupal/editor": "self.version", + "drupal/entity_reference": "self.version", + "drupal/field": "self.version", + "drupal/field_layout": "self.version", + "drupal/field_ui": "self.version", + "drupal/file": "self.version", + "drupal/filter": "self.version", + "drupal/forum": "self.version", + "drupal/hal": "self.version", + "drupal/help": "self.version", + "drupal/history": "self.version", + "drupal/image": "self.version", + "drupal/inline_form_errors": "self.version", + "drupal/language": "self.version", + "drupal/layout_discovery": "self.version", + "drupal/link": "self.version", + "drupal/locale": "self.version", + "drupal/media": "self.version", + "drupal/menu_link_content": "self.version", + "drupal/menu_ui": "self.version", + "drupal/migrate": "self.version", + "drupal/migrate_drupal": "self.version", + "drupal/migrate_drupal_ui": "self.version", + "drupal/minimal": "self.version", + "drupal/node": "self.version", + "drupal/options": "self.version", + "drupal/page_cache": "self.version", + "drupal/path": "self.version", + "drupal/quickedit": "self.version", + "drupal/rdf": "self.version", + "drupal/responsive_image": "self.version", + "drupal/rest": "self.version", + "drupal/search": "self.version", + "drupal/serialization": "self.version", + "drupal/settings_tray": "self.version", + "drupal/seven": "self.version", + "drupal/shortcut": "self.version", + "drupal/simpletest": "self.version", + "drupal/standard": "self.version", + "drupal/stark": "self.version", + "drupal/statistics": "self.version", + "drupal/syslog": "self.version", + "drupal/system": "self.version", + "drupal/taxonomy": "self.version", + "drupal/telephone": "self.version", + "drupal/text": "self.version", + "drupal/toolbar": "self.version", + "drupal/tour": "self.version", + "drupal/tracker": "self.version", + "drupal/update": "self.version", + "drupal/user": "self.version", + "drupal/views": "self.version", + "drupal/views_ui": "self.version", + "drupal/workflows": "self.version" }, "require-dev": { - "drupal/migrate_example_advanced_setup": "*", - "drupal/migrate_example_setup": "*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" + "behat/mink": "1.7.x-dev", + "behat/mink-goutte-driver": "^1.2", + "drupal/coder": "^8.2.12", + "jcalderonzumba/gastonjs": "^1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "mikey179/vfsstream": "^1.2", + "phpspec/prophecy": "^1.4", + "phpunit/phpunit": ">=4.8.35 <5", + "symfony/css-selector": "~3.2.8", + "symfony/phpunit-bridge": "~3.2.8" + }, + "type": "drupal-core", + "autoload": { + "psr-4": { + "Drupal\\Core\\": "lib/Drupal/Core", + "Drupal\\Component\\": "lib/Drupal/Component", + "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver" }, - "drupal": { - "version": "8.x-2.0-beta2", - "datestamp": "1476307439", - "security-coverage": { - "status": "not-covered", - "message": "Beta releases are not covered by Drupal security advisories." - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", + "classmap": [ + "lib/Drupal.php", + "lib/Drupal/Component/Utility/Timer.php", + "lib/Drupal/Component/Utility/Unicode.php", + "lib/Drupal/Core/Database/Database.php", + "lib/Drupal/Core/DrupalKernel.php", + "lib/Drupal/Core/DrupalKernelInterface.php", + "lib/Drupal/Core/Site/Settings.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "authors": [ - { - "name": "Mike Ryan", - "homepage": "https://www.drupal.org/u/mikeryan", - "role": "Maintainer" - }, - { - "name": "mikeryan", - "homepage": "https://www.drupal.org/user/4420" - } - ], - "description": "Enhancements to core migration support.", - "homepage": "https://www.drupal.org/project/migrate_plus", - "support": { - "source": "https://cgit.drupalcode.org/migrate_plus", - "issues": "https://www.drupal.org/project/issues/migrate_plus", - "irc": "irc://irc.freenode.org/drupal-migrate" - } - }, - { - "name": "drupal/migrate_tools", - "version": "2.0.0-beta1", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/migrate_tools", - "reference": "8.x-2.0-beta1" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/migrate_tools-8.x-2.0-beta1.zip", - "reference": "8.x-2.0-beta1", - "shasum": "bf823a9d08d08b99d5ea1469729b30f9969ef519" - }, - "require": { - "drupal/core": "^8.1", - "drupal/migrate_plus": "*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, - "drupal": { - "version": "8.x-2.0-beta1", - "datestamp": "1476313439", - "security-coverage": { - "status": "not-covered", - "message": "Beta releases are not covered by Drupal security advisories." - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "heddn", - "homepage": "https://www.drupal.org/user/1463982" - }, - { - "name": "mikeryan", - "homepage": "https://www.drupal.org/user/4420" - }, - { - "name": "moshe weitzman", - "homepage": "https://www.drupal.org/user/23" - } - ], - "description": "Tools to assist in developing and running migrations.", - "homepage": "https://www.drupal.org/project/migrate_tools", - "support": { - "source": "http://cgit.drupalcode.org/migrate_tools" - } - }, - { - "name": "drupal/migrate_upgrade", - "version": "2.0.0-beta1", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/migrate_upgrade", - "reference": "8.x-2.0-beta1" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/migrate_upgrade-8.x-2.0-beta1.zip", - "reference": "8.x-2.0-beta1", - "shasum": "d5458312b74f2d6975b76d5f1115368b364c91b7" - }, - "require": { - "drupal/core": "^8.1", - "drupal/migrate_plus": "*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, - "drupal": { - "version": "8.x-2.0-beta1", - "datestamp": "1472752139", - "security-coverage": { - "status": "not-covered", - "message": "Beta releases are not covered by Drupal security advisories." - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "abhishek-anand", - "homepage": "https://www.drupal.org/user/468982" - }, - { - "name": "heddn", - "homepage": "https://www.drupal.org/user/1463982" - }, - { - "name": "ksenzee", - "homepage": "https://www.drupal.org/user/139855" - }, - { - "name": "mikeryan", - "homepage": "https://www.drupal.org/user/4420" - }, - { - "name": "ultimike", - "homepage": "https://www.drupal.org/user/51132" - }, - { - "name": "xjm", - "homepage": "https://www.drupal.org/user/65776" - } - ], - "description": "Drush support for direct upgrades from older Drupal versions.", - "homepage": "https://www.drupal.org/project/migrate_upgrade", - "support": { - "source": "http://cgit.drupalcode.org/migrate_upgrade" - } + "description": "Drupal is an open source content management platform powering millions of websites and applications.", + "time": "2018-02-20T21:35:13+00:00" }, { "name": "drush/drush", - "version": "8.1.15", + "version": "8.1.16", "source": { "type": "git", "url": "https://github.com/drush-ops/drush.git", - "reference": "f78b619806a9bc7c3d167fa425e8757eb046bb87" + "reference": "bbaff2dc725a5f3eb22006c5de3dc92a2de54b08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drush-ops/drush/zipball/f78b619806a9bc7c3d167fa425e8757eb046bb87", - "reference": "f78b619806a9bc7c3d167fa425e8757eb046bb87", + "url": "https://api.github.com/repos/drush-ops/drush/zipball/bbaff2dc725a5f3eb22006c5de3dc92a2de54b08", + "reference": "bbaff2dc725a5f3eb22006c5de3dc92a2de54b08", "shasum": "" }, "require": { - "consolidation/annotated-command": "~2", + "consolidation/annotated-command": "^2.8.1", "consolidation/output-formatters": "~3", - "pear/console_table": "~1.3.0", + "pear/console_table": "~1.3.1", "php": ">=5.4.5", - "phpdocumentor/reflection-docblock": "^2.0", "psr/log": "~1.0", "psy/psysh": "~0.6", "symfony/console": "~2.7|^3", @@ -1012,7 +1021,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { @@ -1058,7 +1067,7 @@ ], "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", "homepage": "http://www.drush.org", - "time": "2017-10-10T02:05:46+00:00" + "time": "2018-02-06T21:18:48+00:00" }, { "name": "easyrdf/easyrdf", @@ -1509,16 +1518,16 @@ }, { "name": "nikic/php-parser", - "version": "v3.1.2", + "version": "v3.1.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "08131e7ff29de6bb9f12275c7d35df71f25f4d89" + "reference": "e57b3a09784f846411aa7ed664eedb73e3399078" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/08131e7ff29de6bb9f12275c7d35df71f25f4d89", - "reference": "08131e7ff29de6bb9f12275c7d35df71f25f4d89", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e57b3a09784f846411aa7ed664eedb73e3399078", + "reference": "e57b3a09784f846411aa7ed664eedb73e3399078", "shasum": "" }, "require": { @@ -1556,20 +1565,20 @@ "parser", "php" ], - "time": "2017-11-04T11:48:34+00:00" + "time": "2018-01-25T21:31:33+00:00" }, { "name": "paragonie/random_compat", - "version": "v2.0.10", + "version": "v2.0.11", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d" + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", "shasum": "" }, "require": { @@ -1604,20 +1613,20 @@ "pseudorandom", "random" ], - "time": "2017-03-13T16:27:32+00:00" + "time": "2017-09-27T21:40:39+00:00" }, { "name": "pear/console_table", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/pear/Console_Table.git", - "reference": "64100b9ee81852f4fa17823e55d0b385a544f976" + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Console_Table/zipball/64100b9ee81852f4fa17823e55d0b385a544f976", - "reference": "64100b9ee81852f4fa17823e55d0b385a544f976", + "url": "https://api.github.com/repos/pear/Console_Table/zipball/1930c11897ca61fd24b95f2f785e99e0f36dcdea", + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea", "shasum": "" }, "require": { @@ -1659,56 +1668,7 @@ "keywords": [ "console" ], - "time": "2016-01-21T16:14:31+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03T12:10:50+00:00" + "time": "2018-01-25T20:47:17+00:00" }, { "name": "psr/http-message", @@ -1809,16 +1769,16 @@ }, { "name": "psy/psysh", - "version": "v0.8.15", + "version": "v0.8.17", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "b1d289c2cb03a2f8249912c53e96ced38f879926" + "reference": "5069b70e8c4ea492c2b5939b6eddc78bfe41cfec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/b1d289c2cb03a2f8249912c53e96ced38f879926", - "reference": "b1d289c2cb03a2f8249912c53e96ced38f879926", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/5069b70e8c4ea492c2b5939b6eddc78bfe41cfec", + "reference": "5069b70e8c4ea492c2b5939b6eddc78bfe41cfec", "shasum": "" }, "require": { @@ -1826,14 +1786,13 @@ "jakub-onderka/php-console-highlighter": "0.3.*", "nikic/php-parser": "~1.3|~2.0|~3.0", "php": ">=5.3.9", - "symfony/console": "~2.3.10|^2.4.2|~3.0", - "symfony/var-dumper": "~2.7|~3.0" + "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", + "symfony/var-dumper": "~2.7|~3.0|~4.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", "hoa/console": "~3.16|~1.14", "phpunit/phpunit": "^4.8.35|^5.4.3", - "symfony/finder": "~2.1|~3.0" + "symfony/finder": "~2.1|~3.0|~4.0" }, "suggest": { "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", @@ -1878,26 +1837,26 @@ "interactive", "shell" ], - "time": "2017-11-16T14:29:51+00:00" + "time": "2017-12-28T16:14:16+00:00" }, { "name": "stack/builder", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/stackphp/builder.git", - "reference": "59fcc9b448a8ce5e338a04c4e2e4aca893e83425" + "reference": "fb3d136d04c6be41120ebf8c0cc71fe9507d750a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stackphp/builder/zipball/59fcc9b448a8ce5e338a04c4e2e4aca893e83425", - "reference": "59fcc9b448a8ce5e338a04c4e2e4aca893e83425", + "url": "https://api.github.com/repos/stackphp/builder/zipball/fb3d136d04c6be41120ebf8c0cc71fe9507d750a", + "reference": "fb3d136d04c6be41120ebf8c0cc71fe9507d750a", "shasum": "" }, "require": { "php": ">=5.3.0", - "symfony/http-foundation": "~2.1|~3.0", - "symfony/http-kernel": "~2.1|~3.0" + "symfony/http-foundation": "~2.1|~3.0|~4.0", + "symfony/http-kernel": "~2.1|~3.0|~4.0" }, "require-dev": { "silex/silex": "~1.0" @@ -1927,7 +1886,7 @@ "keywords": [ "stack" ], - "time": "2016-06-02T06:58:42+00:00" + "time": "2017-11-18T14:57:29+00:00" }, { "name": "symfony-cmf/routing", @@ -1990,16 +1949,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "fc4c04bfd17130a9dccfded9578353f311967da7" + "reference": "e192d96b15fdd168bdb1c91001d26c93ba4af482" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/fc4c04bfd17130a9dccfded9578353f311967da7", - "reference": "fc4c04bfd17130a9dccfded9578353f311967da7", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/e192d96b15fdd168bdb1c91001d26c93ba4af482", + "reference": "e192d96b15fdd168bdb1c91001d26c93ba4af482", "shasum": "" }, "require": { @@ -2042,20 +2001,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-06-01T21:00:24+00:00" }, { "name": "symfony/console", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38" + "reference": "eced439413608647aeff243038a33ea246b2b33a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", - "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", + "url": "https://api.github.com/repos/symfony/console/zipball/eced439413608647aeff243038a33ea246b2b33a", + "reference": "eced439413608647aeff243038a33ea246b2b33a", "shasum": "" }, "require": { @@ -2105,37 +2064,36 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-04-26T01:39:17+00:00" + "time": "2017-07-29T21:27:41+00:00" }, { "name": "symfony/debug", - "version": "v3.2.8", + "version": "v3.4.4", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686" + "reference": "53f6af2805daf52a43b393b93d2f24925d35c937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/fd6eeee656a5a7b384d56f1072243fe1c0e81686", - "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686", + "url": "https://api.github.com/repos/symfony/debug/zipball/53f6af2805daf52a43b393b93d2f24925d35c937", + "reference": "53f6af2805daf52a43b393b93d2f24925d35c937", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" + "symfony/http-kernel": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2162,20 +2120,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-04-19T20:17:50+00:00" + "time": "2018-01-18T22:16:57+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "5e00857475b6d1fa31ff4c76f1fddf1cfa9e8d59" + "reference": "d9f2e62e1a93d52ad4e4f6faaf66f6eef723d761" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5e00857475b6d1fa31ff4c76f1fddf1cfa9e8d59", - "reference": "5e00857475b6d1fa31ff4c76f1fddf1cfa9e8d59", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/d9f2e62e1a93d52ad4e4f6faaf66f6eef723d761", + "reference": "d9f2e62e1a93d52ad4e4f6faaf66f6eef723d761", "shasum": "" }, "require": { @@ -2225,20 +2183,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-04-26T01:39:17+00:00" + "time": "2017-07-28T15:22:55+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b8a401f733b43251e1d088c589368b2a94155e40" + "reference": "b8de6ee252af19330dd72ad5fc0dd4658a1d6325" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8a401f733b43251e1d088c589368b2a94155e40", - "reference": "b8a401f733b43251e1d088c589368b2a94155e40", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8de6ee252af19330dd72ad5fc0dd4658a1d6325", + "reference": "b8de6ee252af19330dd72ad5fc0dd4658a1d6325", "shasum": "" }, "require": { @@ -2285,20 +2243,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:58:48+00:00" + "time": "2017-06-02T08:26:05+00:00" }, { "name": "symfony/finder", - "version": "v3.3.13", + "version": "v3.4.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880" + "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/138af5ec075d4b1d1bd19de08c38a34bb2d7d880", - "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880", + "url": "https://api.github.com/repos/symfony/finder/zipball/613e26310776f49a1773b6737c6bd554b8bc8c6f", + "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f", "shasum": "" }, "require": { @@ -2307,7 +2265,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2334,20 +2292,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-11-05T15:47:03+00:00" + "time": "2018-01-03T07:37:34+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef" + "reference": "107b7e6c2372ad4859b8a8c8c5b4fb9d7a208fe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9de6add7f731e5af7f5b2e9c0da365e43383ebef", - "reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/107b7e6c2372ad4859b8a8c8c5b4fb9d7a208fe1", + "reference": "107b7e6c2372ad4859b8a8c8c5b4fb9d7a208fe1", "shasum": "" }, "require": { @@ -2387,20 +2345,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:55:58+00:00" + "time": "2017-07-20T07:58:49+00:00" }, { "name": "symfony/http-kernel", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "46e8b209abab55c072c47d72d5cd1d62c0585e05" + "reference": "18ec42e19ec676d7da5ddff13f1eed68d88fb460" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/46e8b209abab55c072c47d72d5cd1d62c0585e05", - "reference": "46e8b209abab55c072c47d72d5cd1d62c0585e05", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/18ec42e19ec676d7da5ddff13f1eed68d88fb460", + "reference": "18ec42e19ec676d7da5ddff13f1eed68d88fb460", "shasum": "" }, "require": { @@ -2411,7 +2369,8 @@ "symfony/http-foundation": "~2.8.13|~3.1.6|~3.2" }, "conflict": { - "symfony/config": "<2.8" + "symfony/config": "<2.8", + "twig/twig": "<1.34|<2.4,>=2" }, "require-dev": { "symfony/browser-kit": "~2.8|~3.0", @@ -2469,20 +2428,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2017-05-01T17:46:48+00:00" + "time": "2017-08-01T09:40:19+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.3.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "cba36f3616d9866b3e52662e88da5c090fac1e97" + "reference": "bd515d8f392730c833bc1ba993a4f598da64fa5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/cba36f3616d9866b3e52662e88da5c090fac1e97", - "reference": "cba36f3616d9866b3e52662e88da5c090fac1e97", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/bd515d8f392730c833bc1ba993a4f598da64fa5b", + "reference": "bd515d8f392730c833bc1ba993a4f598da64fa5b", "shasum": "" }, "require": { @@ -2494,7 +2453,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -2528,20 +2487,20 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2018-01-30T19:27:44+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", "shasum": "" }, "require": { @@ -2553,7 +2512,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -2587,20 +2546,20 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2018-01-30T19:27:44+00:00" }, { "name": "symfony/process", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0" + "reference": "b39d805dd6c4d1cba1f00cd80361ec80eed0d7bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", - "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", + "url": "https://api.github.com/repos/symfony/process/zipball/b39d805dd6c4d1cba1f00cd80361ec80eed0d7bc", + "reference": "b39d805dd6c4d1cba1f00cd80361ec80eed0d7bc", "shasum": "" }, "require": { @@ -2636,29 +2595,29 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-07-03T08:06:20+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v1.0.0", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "66085f246d3893cbdbcec5f5ad15ac60546cf0de" + "reference": "c2b757934f2d9681a287e662efbc27c41fe8ef86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/66085f246d3893cbdbcec5f5ad15ac60546cf0de", - "reference": "66085f246d3893cbdbcec5f5ad15ac60546cf0de", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/c2b757934f2d9681a287e662efbc27c41fe8ef86", + "reference": "c2b757934f2d9681a287e662efbc27c41fe8ef86", "shasum": "" }, "require": { "php": ">=5.3.3", "psr/http-message": "~1.0", - "symfony/http-foundation": "~2.3|~3.0" + "symfony/http-foundation": "~2.3|~3.0|~4.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" + "symfony/phpunit-bridge": "~3.2|4.0" }, "suggest": { "psr/http-message-implementation": "To use the HttpFoundation factory", @@ -2696,20 +2655,20 @@ "http-message", "psr-7" ], - "time": "2016-09-14T18:37:20+00:00" + "time": "2017-12-19T00:31:44+00:00" }, { "name": "symfony/routing", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "5029745d6d463585e8b487dbc83d6333f408853a" + "reference": "b382d7c4f443372c118efcd0cd2bf1028434f2f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/5029745d6d463585e8b487dbc83d6333f408853a", - "reference": "5029745d6d463585e8b487dbc83d6333f408853a", + "url": "https://api.github.com/repos/symfony/routing/zipball/b382d7c4f443372c118efcd0cd2bf1028434f2f5", + "reference": "b382d7c4f443372c118efcd0cd2bf1028434f2f5", "shasum": "" }, "require": { @@ -2771,20 +2730,20 @@ "uri", "url" ], - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-06-23T06:35:45+00:00" }, { "name": "symfony/serializer", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "6eeae1ba82005b761a53b7b8cf960bbf40c95986" + "reference": "dc98d5ab4ae29dc47bfb1507b39806bfe13d3477" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/6eeae1ba82005b761a53b7b8cf960bbf40c95986", - "reference": "6eeae1ba82005b761a53b7b8cf960bbf40c95986", + "url": "https://api.github.com/repos/symfony/serializer/zipball/dc98d5ab4ae29dc47bfb1507b39806bfe13d3477", + "reference": "dc98d5ab4ae29dc47bfb1507b39806bfe13d3477", "shasum": "" }, "require": { @@ -2846,20 +2805,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:55:58+00:00" + "time": "2017-07-06T07:39:51+00:00" }, { "name": "symfony/translation", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f4a04d2df710f81515df576b2de06bdeee518b83" + "reference": "df36a48672b929bf3995eb62c58d83004b1d0d50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f4a04d2df710f81515df576b2de06bdeee518b83", - "reference": "f4a04d2df710f81515df576b2de06bdeee518b83", + "url": "https://api.github.com/repos/symfony/translation/zipball/df36a48672b929bf3995eb62c58d83004b1d0d50", + "reference": "df36a48672b929bf3995eb62c58d83004b1d0d50", "shasum": "" }, "require": { @@ -2910,20 +2869,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-06-24T16:45:17+00:00" }, { "name": "symfony/validator", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "98bf011bf1f3b69bece3b79e19633e9c51545b2b" + "reference": "39244fbf580e01acc3f5df01238a8f69b1b3e46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/98bf011bf1f3b69bece3b79e19633e9c51545b2b", - "reference": "98bf011bf1f3b69bece3b79e19633e9c51545b2b", + "url": "https://api.github.com/repos/symfony/validator/zipball/39244fbf580e01acc3f5df01238a8f69b1b3e46f", + "reference": "39244fbf580e01acc3f5df01238a8f69b1b3e46f", "shasum": "" }, "require": { @@ -2954,7 +2913,6 @@ "symfony/expression-language": "For using the Expression validator", "symfony/http-foundation": "", "symfony/intl": "", - "symfony/property-access": "For using the Expression validator", "symfony/yaml": "" }, "type": "library", @@ -2987,20 +2945,20 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-07-26T06:34:07+00:00" }, { "name": "symfony/var-dumper", - "version": "v3.3.13", + "version": "v3.4.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "805de6bd6869073e60610df1b14ab7d969c61b01" + "reference": "472a9849930cf21f73abdb02240f17cf5b5bd1a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/805de6bd6869073e60610df1b14ab7d969c61b01", - "reference": "805de6bd6869073e60610df1b14ab7d969c61b01", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/472a9849930cf21f73abdb02240f17cf5b5bd1a7", + "reference": "472a9849930cf21f73abdb02240f17cf5b5bd1a7", "shasum": "" }, "require": { @@ -3016,12 +2974,13 @@ }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", "ext-symfony_debug": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3055,20 +3014,20 @@ "debug", "dump" ], - "time": "2017-11-07T14:16:22+00:00" + "time": "2018-01-29T09:03:43+00:00" }, { "name": "symfony/yaml", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6" + "reference": "78a0c5d7d43713212aac73d7c6a56754a5c26cea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/acec26fcf7f3031e094e910b94b002fa53d4e4d6", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/78a0c5d7d43713212aac73d7c6a56754a5c26cea", + "reference": "78a0c5d7d43713212aac73d7c6a56754a5c26cea", "shasum": "" }, "require": { @@ -3110,39 +3069,42 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:55:58+00:00" + "time": "2017-06-02T09:43:35+00:00" }, { "name": "twig/twig", - "version": "v1.32.0", + "version": "v1.35.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "9935b662e24d6e634da88901ab534cc12e8c728f" + "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/9935b662e24d6e634da88901ab534cc12e8c728f", - "reference": "9935b662e24d6e634da88901ab534cc12e8c728f", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f", + "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f", "shasum": "" }, "require": { - "php": ">=5.2.7" + "php": ">=5.3.3" }, "require-dev": { "psr/container": "^1.0", "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~3.2" + "symfony/phpunit-bridge": "~3.3@dev" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.32-dev" + "dev-master": "1.35-dev" } }, "autoload": { "psr-0": { "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3172,20 +3134,20 @@ "keywords": [ "templating" ], - "time": "2017-02-27T00:07:03+00:00" + "time": "2017-09-27T18:06:46+00:00" }, { "name": "webmozart/assert", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, "require": { @@ -3222,7 +3184,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2018-01-29T19:49:41+00:00" }, { "name": "webmozart/path-util", @@ -3321,21 +3283,21 @@ }, { "name": "zendframework/zend-diactoros", - "version": "1.4.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef" + "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/424a840dc3bedcdeea510b42e056c77c2d6c4bef", - "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/ed6ce7e2105c400ca10277643a8327957c0384b7", + "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7", "shasum": "" }, "require": { - "php": "^5.4 || ^7.0", - "psr/http-message": "~1.0" + "php": "^5.6 || ^7.0", + "psr/http-message": "^1.0" }, "provide": { "psr/http-message-implementation": "1.0" @@ -3343,14 +3305,14 @@ "require-dev": { "ext-dom": "*", "ext-libxml": "*", - "phpunit/phpunit": "^4.6 || ^5.5", - "zendframework/zend-coding-standard": "~1.0.0" + "phpunit/phpunit": "^5.7.16 || ^6.0.8", + "zendframework/zend-coding-standard": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev", - "dev-develop": "1.5-dev" + "dev-master": "1.7.x-dev", + "dev-develop": "1.8.x-dev" } }, "autoload": { @@ -3369,7 +3331,7 @@ "psr", "psr-7" ], - "time": "2017-08-17T21:21:00+00:00" + "time": "2018-01-04T18:21:48+00:00" }, { "name": "zendframework/zend-escaper", @@ -3417,46 +3379,46 @@ }, { "name": "zendframework/zend-feed", - "version": "2.7.0", + "version": "2.9.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-feed.git", - "reference": "12b328d382aa5200f1de53d4147033b885776b67" + "reference": "abe88686124d492e0a2a84656f15e5482bfbe030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/12b328d382aa5200f1de53d4147033b885776b67", - "reference": "12b328d382aa5200f1de53d4147033b885776b67", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/abe88686124d492e0a2a84656f15e5482bfbe030", + "reference": "abe88686124d492e0a2a84656f15e5482bfbe030", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-escaper": "^2.5", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "php": "^5.6 || ^7.0", + "zendframework/zend-escaper": "^2.5.2", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "psr/http-message": "^1.0", - "zendframework/zend-cache": "^2.5", - "zendframework/zend-db": "^2.5", - "zendframework/zend-http": "^2.5", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", - "zendframework/zend-validator": "^2.5" + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "psr/http-message": "^1.0.1", + "zendframework/zend-cache": "^2.7.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-db": "^2.8.2", + "zendframework/zend-http": "^2.7", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-validator": "^2.10.1" }, "suggest": { - "psr/http-message": "PSR-7 ^1.0, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator", + "psr/http-message": "PSR-7 ^1.0.1, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator", "zendframework/zend-cache": "Zend\\Cache component, for optionally caching feeds between requests", "zendframework/zend-db": "Zend\\Db component, for use with PubSubHubbub", "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for easily extending ExtensionManager implementations", - "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries ehen using the Writer subcomponent" + "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries when using the Writer subcomponent" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" + "dev-master": "2.9-dev", + "dev-develop": "2.10-dev" } }, "autoload": { @@ -3469,40 +3431,40 @@ "BSD-3-Clause" ], "description": "provides functionality for consuming RSS and Atom feeds", - "homepage": "https://github.com/zendframework/zend-feed", "keywords": [ + "ZendFramework", "feed", - "zf2" - ], - "time": "2016-02-11T18:54:29+00:00" + "zf" + ], + "time": "2017-12-04T17:59:38+00:00" }, { "name": "zendframework/zend-stdlib", - "version": "3.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "8bafa58574204bdff03c275d1d618aaa601588ae" + "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/8bafa58574204bdff03c275d1d618aaa601588ae", - "reference": "8bafa58574204bdff03c275d1d618aaa601588ae", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78", + "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { "athletic/athletic": "~0.1", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" } }, "autoload": { @@ -3519,7 +3481,7 @@ "stdlib", "zf2" ], - "time": "2016-04-12T21:19:36+00:00" + "time": "2016-09-13T14:38:50+00:00" } ], "packages-dev": [ @@ -3529,20 +3491,20 @@ "source": { "type": "git", "url": "https://github.com/minkphp/Mink.git", - "reference": "9ea1cebe3dc529ba3861d87c818f045362c40484" + "reference": "04ab7af68536ac2c80fd6c08a6fd3620d3409891" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/9ea1cebe3dc529ba3861d87c818f045362c40484", - "reference": "9ea1cebe3dc529ba3861d87c818f045362c40484", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/04ab7af68536ac2c80fd6c08a6fd3620d3409891", + "reference": "04ab7af68536ac2c80fd6c08a6fd3620d3409891", "shasum": "" }, "require": { "php": ">=5.3.1", - "symfony/css-selector": "~2.1|~3.0" + "symfony/css-selector": "^2.7|^3.0|^4.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" + "symfony/phpunit-bridge": "^3.3|^4.0" }, "suggest": { "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", @@ -3579,7 +3541,7 @@ "testing", "web" ], - "time": "2017-02-06T09:59:54+00:00" + "time": "2018-01-07T17:25:05+00:00" }, { "name": "behat/mink-browserkit-driver", @@ -3751,7 +3713,7 @@ "version": "8.2.12", "source": { "type": "git", - "url": "https://github.com/klausi/coder.git", + "url": "https://git.drupal.org/project/coder.git", "reference": "984c54a7b1e8f27ff1c32348df69712afd86b17f" }, "dist": { @@ -3785,24 +3747,27 @@ }, { "name": "fabpot/goutte", - "version": "v3.2.1", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "db5c28f4a010b4161d507d5304e28a7ebf211638" + "reference": "395f61d7c2e15a813839769553a4de16fa3b3c96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/db5c28f4a010b4161d507d5304e28a7ebf211638", - "reference": "db5c28f4a010b4161d507d5304e28a7ebf211638", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/395f61d7c2e15a813839769553a4de16fa3b3c96", + "reference": "395f61d7c2e15a813839769553a4de16fa3b3c96", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^6.0", "php": ">=5.5.0", - "symfony/browser-kit": "~2.1|~3.0", - "symfony/css-selector": "~2.1|~3.0", - "symfony/dom-crawler": "~2.1|~3.0" + "symfony/browser-kit": "~2.1|~3.0|~4.0", + "symfony/css-selector": "~2.1|~3.0|~4.0", + "symfony/dom-crawler": "~2.1|~3.0|~4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3 || ^4" }, "type": "application", "extra": { @@ -3813,7 +3778,10 @@ "autoload": { "psr-4": { "Goutte\\": "Goutte" - } + }, + "exclude-from-classmap": [ + "Goutte/Tests" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3830,62 +3798,20 @@ "keywords": [ "scraper" ], - "time": "2017-01-03T13:21:43+00:00" - }, - { - "name": "ircmaxell/password-compat", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "autoload": { - "files": [ - "lib/password.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" - } - ], - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "homepage": "https://github.com/ircmaxell/password_compat", - "keywords": [ - "hashing", - "password" - ], - "time": "2014-11-20T16:49:30+00:00" + "time": "2017-11-19T08:45:40+00:00" }, { "name": "jcalderonzumba/gastonjs", - "version": "v1.0.2", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/jcalderonzumba/gastonjs.git", - "reference": "21bebb8ca03eb0f93ec2f3fad61192fb079e2622" + "reference": "575a9c18d8b87990c37252e8d9707b29f0a313f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/21bebb8ca03eb0f93ec2f3fad61192fb079e2622", - "reference": "21bebb8ca03eb0f93ec2f3fad61192fb079e2622", + "url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/575a9c18d8b87990c37252e8d9707b29f0a313f3", + "reference": "575a9c18d8b87990c37252e8d9707b29f0a313f3", "shasum": "" }, "require": { @@ -3929,34 +3855,31 @@ "headless", "phantomjs" ], - "time": "2016-01-18T09:21:03+00:00" + "time": "2017-03-31T07:31:47+00:00" }, { "name": "jcalderonzumba/mink-phantomjs-driver", - "version": "v0.3.1", + "version": "v0.3.3", "source": { "type": "git", "url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git", - "reference": "782892dbea4af7d04024374672b3790b6c008def" + "reference": "008f43670e94acd39273d15add1e7348eb23848d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/782892dbea4af7d04024374672b3790b6c008def", - "reference": "782892dbea4af7d04024374672b3790b6c008def", + "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/008f43670e94acd39273d15add1e7348eb23848d", + "reference": "008f43670e94acd39273d15add1e7348eb23848d", "shasum": "" }, "require": { - "behat/mink": "~1.6", + "behat/mink": "~1.7", "jcalderonzumba/gastonjs": "~1.0", "php": ">=5.4", "twig/twig": "~1.20|~2.0" }, "require-dev": { - "phpunit/phpunit": "~4.6", - "silex/silex": "~1.2", - "symfony/css-selector": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.3" + "mink/driver-testsuite": "dev-master", + "phpunit/phpunit": "~4.6" }, "type": "mink-driver", "extra": { @@ -3990,7 +3913,7 @@ "phantomjs", "testing" ], - "time": "2015-12-04T13:55:02+00:00" + "time": "2016-12-01T10:57:30+00:00" }, { "name": "mikey179/vfsStream", @@ -4039,34 +3962,186 @@ "time": "2017-08-01T08:02:14+00:00" }, { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "1.7.5", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -4099,7 +4174,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2018-02-19T10:16:54+00:00" }, { "name": "phpunit/php-code-coverage", @@ -4165,16 +4240,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -4208,7 +4283,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -4302,16 +4377,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.11", + "version": "1.4.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "shasum": "" }, "require": { @@ -4347,7 +4422,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", @@ -4543,23 +4618,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "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" }, "type": "library", "extra": { @@ -4591,7 +4666,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -4851,16 +4926,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.8.1", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", "shasum": "" }, "require": { @@ -4925,29 +5000,29 @@ "phpcs", "standards" ], - "time": "2017-03-01T22:17:45+00:00" + "time": "2017-05-22T02:43:20+00:00" }, { "name": "symfony/browser-kit", - "version": "v3.2.8", + "version": "v3.4.4", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57" + "reference": "490f27762705c8489bd042fe3e9377a191dba9b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/9fab1ab6f77b77f3df5fc5250fc6956811699b57", - "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/490f27762705c8489bd042fe3e9377a191dba9b4", + "reference": "490f27762705c8489bd042fe3e9377a191dba9b4", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/dom-crawler": "~2.8|~3.0" + "php": "^5.5.9|>=7.0.8", + "symfony/dom-crawler": "~2.8|~3.0|~4.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/process": "" @@ -4955,7 +5030,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -4982,11 +5057,11 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2018-01-03T07:37:34+00:00" }, { "name": "symfony/css-selector", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -5039,24 +5114,24 @@ }, { "name": "symfony/dom-crawler", - "version": "v3.2.8", + "version": "v3.4.4", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286" + "reference": "09bd97b844b3151fab82f2fdd62db9c464b3910a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f1ad34e8af09ed17570e027cf0c58a12eddec286", - "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/09bd97b844b3151fab82f2fdd62db9c464b3910a", + "reference": "09bd97b844b3151fab82f2fdd62db9c464b3910a", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0" + "symfony/css-selector": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -5064,7 +5139,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -5091,20 +5166,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2018-01-03T07:37:34+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v3.2.8", + "version": "v3.2.14", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "00916603c524b8048906de460b7ea0dfa1651281" + "reference": "9e5c470da4b1e3e9cd8e29fecbd7c91eb961d15f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/00916603c524b8048906de460b7ea0dfa1651281", - "reference": "00916603c524b8048906de460b7ea0dfa1651281", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/9e5c470da4b1e3e9cd8e29fecbd7c91eb961d15f", + "reference": "9e5c470da4b1e3e9cd8e29fecbd7c91eb961d15f", "shasum": "" }, "require": { @@ -5153,7 +5228,7 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-06-02T09:43:35+00:00" } ], "aliases": [], diff -r bfffd8d7479a -r 7a779792577d core/CHANGELOG.txt --- a/core/CHANGELOG.txt Fri Feb 23 15:51:18 2018 +0000 +++ b/core/CHANGELOG.txt Fri Feb 23 15:52:07 2018 +0000 @@ -1,3 +1,7 @@ +Drupal 8.4.5, 2018-02-20 +------------------------ +- Fixed security issues. See SA-CORE-2018-001. + Drupal 8.4.0, 2017-10-04 ------------------------ ### Drush users: Update to Drush 8.1.12+ or higher diff -r bfffd8d7479a -r 7a779792577d core/MAINTAINERS.txt --- a/core/MAINTAINERS.txt Fri Feb 23 15:51:18 2018 +0000 +++ b/core/MAINTAINERS.txt Fri Feb 23 15:52:07 2018 +0000 @@ -11,45 +11,35 @@ --------------- The Drupal Core committers oversee the development of Drupal as a whole. The -core committers for Drupal are (per major version, in alphabetical order): +core committers for Drupal are (in alphabetical order): -Drupal 8 -- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia - (Framework Manager) +BDFL - Dries Buytaert 'dries' https://www.drupal.org/u/dries - (BDFL, Product Manager) + +Product managers +- Dries Buytaert 'dries' https://www.drupal.org/u/dries - Angela Byron 'webchick' https://www.drupal.org/u/webchick - (Product Manager) +- Gábor Hojtsy 'Gábor Hojtsy' https://www.drupal.org/u/gábor-hojtsy +- Roy Scholten 'yoroy' https://www.drupal.org/u/yoroy + +Framework managers + + Backend + - Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia + - Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch + - Alex Pott 'alexpott' https://www.drupal.org/u/alexpott + - Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan + - (provisional) Francesco Placella 'plach' https://www.drupal.org/u/plach + + Frontend + - Lauri Eskola 'lauriii' https://www.drupal.org/u/lauriii + - Scott Reeves 'Cottser' https://www.drupal.org/u/cottser + +Release managers - Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch - (Framework Manager, Release Manager) - Chris McCafferty 'cilefen' https://www.drupal.org/u/cilefen - (Release Manager) - Jess Myrbo 'xjm' https://www.drupal.org/u/xjm - (Release Manager) -- Alex Pott 'alexpott' https://www.drupal.org/u/alexpott - (Framework Manager) -- Scott Reeves 'Cottser' https://www.drupal.org/u/cottser - (Framework Manager - Frontend) -Provisional membership: -- Lauri Eskola 'lauriii' https://www.drupal.org/u/lauriii - (Framework Manager - Frontend) -- Gábor Hojtsy 'Gábor Hojtsy' https://www.drupal.org/u/gábor-hojtsy - (Product Manager) -- Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan - (Framework Manager) -- Roy Scholten 'yoroy' https://www.drupal.org/u/yoroy - (Product Manager) - -Drupal 7 -- Fabian Franz 'Fabianx' https://www.drupal.org/u/fabianx - (Framework Manager) -- David Rothstein 'David_Rothstein' https://www.drupal.org/u/david_rothstein - (Release Manager, Framework Manager, Product Manager) -- Stefan Ruijsenaars 'stefan.r' https://www.drupal.org/u/stefanr-0 - (Release Manager, Product Manager) - -Provisional membership: None at this time. Subsystem maintainers --------------------- @@ -204,6 +194,7 @@ Entity API - Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch +- Hristo Chonov 'hchonov' https://www.drupal.org/u/hchonov - Sascha Grossenbacher 'Berdir' https://www.drupal.org/u/berdir - Francesco Placella 'plach' https://www.drupal.org/u/plach - Tobias Stöckler 'tstoeckler' https://www.drupal.org/u/tstoeckler @@ -256,6 +247,7 @@ - Théodore Biadala 'nod_' https://www.drupal.org/u/nod_ - Kay Leung 'droplet' https://www.drupal.org/u/droplet - Matthew Grill 'drpal' https://www.drupal.org/u/drpal +- Sally Young 'justafish' https://www.drupal.org/u/justafish Language - Francesco Placella 'plach' https://www.drupal.org/u/plach @@ -488,10 +480,8 @@ PHPUnit Initiative - Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner - - Provisional membership: - - Len Swaneveld 'Lendude' https://www.drupal.org/u/lendude - - Michiel Nugter 'michielnugter' https://www.drupal.org/u/michielnugter + - (provisional) Michiel Nugter 'michielnugter' https://www.drupal.org/u/michielnugter + - (provisional) Len Swaneveld 'Lendude' https://www.drupal.org/u/lendude Workflow Initiative - Dick Olsson 'dixon_' https://www.drupal.org/u/dixon_ diff -r bfffd8d7479a -r 7a779792577d core/config/schema/core.data_types.schema.yml --- a/core/config/schema/core.data_types.schema.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/core/config/schema/core.data_types.schema.yml Fri Feb 23 15:52:07 2018 +0000 @@ -757,6 +757,16 @@ type: float label: 'Value' +# Schema for the configuration of the Timestamp field type. + +field.value.timestamp: + type: mapping + label: 'Timestamp value' + mapping: + value: + type: timestamp + label: 'Value' + # Text with a text format. text_format: type: mapping diff -r bfffd8d7479a -r 7a779792577d core/core.services.yml --- a/core/core.services.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/core/core.services.yml Fri Feb 23 15:52:07 2018 +0000 @@ -806,6 +806,8 @@ router.route_provider.lazy_builder: class: Drupal\Core\Routing\RouteProviderLazyBuilder arguments: ['@router.route_provider', '@router.builder'] + tags: + - { name: event_subscriber } router.route_preloader: class: Drupal\Core\Routing\RoutePreloader arguments: ['@router.route_provider', '@state', '@cache.bootstrap'] diff -r bfffd8d7479a -r 7a779792577d core/includes/common.inc --- a/core/includes/common.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/includes/common.inc Fri Feb 23 15:52:07 2018 +0000 @@ -148,12 +148,13 @@ * If the query parameter isn't present, then the URL of the current * request is returned. * - * @see \Drupal\Core\EventSubscriber\RedirectResponseSubscriber::checkRedirectUrl() - * * @ingroup form_api * * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * Use the redirect.destination service. + * + * @see \Drupal\Core\EventSubscriber\RedirectResponseSubscriber::checkRedirectUrl() + * @see https://www.drupal.org/node/2448603 */ function drupal_get_destination() { return \Drupal::destination()->getAsArray(); @@ -176,6 +177,8 @@ * * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * Use \Drupal::service('email.validator')->isValid(). + * + * @see https://www.drupal.org/node/2912661 */ function valid_email_address($mail) { return \Drupal::service('email.validator')->isValid($mail); @@ -209,9 +212,6 @@ * Drupal\Core\Template\Attribute, call * \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() instead. * - * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() - * @see \Drupal\Component\Utility\UrlHelper::filterBadProtocol() - * * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * Use UrlHelper::stripDangerousProtocols() or UrlHelper::filterBadProtocol() * instead. UrlHelper::stripDangerousProtocols() can be used in conjunction @@ -220,6 +220,10 @@ * UrlHelper::filterBadProtocol() is functionality equivalent to check_url() * apart from the fact it is protected from double escaping bugs. Note that * this method no longer marks its output as safe. + * + * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() + * @see \Drupal\Component\Utility\UrlHelper::filterBadProtocol() + * @see https://www.drupal.org/node/2560027 */ function check_url($uri) { return Html::escape(UrlHelper::stripDangerousProtocols($uri)); @@ -315,10 +319,11 @@ * @return * A translated date string in the requested format. * - * @see \Drupal\Core\Datetime\DateFormatter::format() - * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * Use \Drupal::service('date.formatter')->format(). + * + * @see \Drupal\Core\Datetime\DateFormatter::format() + * @see https://www.drupal.org/node/1876852 */ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) { return \Drupal::service('date.formatter')->format($timestamp, $type, $format, $timezone, $langcode); @@ -420,6 +425,8 @@ * * @deprecated in Drupal 8.x, will be removed before Drupal 9.0. * Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll(). + * + * @see https://www.drupal.org/node/2317841 */ function drupal_clear_css_cache() { \Drupal::service('asset.css.collection_optimizer')->deleteAll(); @@ -737,6 +744,8 @@ * * @deprecated in Drupal 8.x, will be removed before Drupal 9.0. * Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll(). + * + * @see https://www.drupal.org/node/2317841 */ function drupal_clear_js_cache() { \Drupal::service('asset.js.collection_optimizer')->deleteAll(); @@ -854,6 +863,7 @@ * 'renderer' service instead. * * @see \Drupal\Core\Render\RendererInterface::renderRoot() + * @see https://www.drupal.org/node/2912696 */ function drupal_render_root(&$elements) { return \Drupal::service('renderer')->renderRoot($elements); @@ -866,6 +876,7 @@ * 'renderer' service instead. * * @see \Drupal\Core\Render\RendererInterface::render() + * @see https://www.drupal.org/node/2912696 */ function drupal_render(&$elements, $is_recursive_call = FALSE) { return \Drupal::service('renderer')->render($elements, $is_recursive_call); @@ -889,6 +900,7 @@ * they are available. * * @see drupal_render() + * @see https://www.drupal.org/node/2912757 */ function drupal_render_children(&$element, $children_keys = NULL) { if ($children_keys === NULL) { @@ -1002,6 +1014,8 @@ * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * Use \Drupal::service('element_info')->getInfo() instead. + * + * @see https://www.drupal.org/node/2235461 */ function element_info($type) { return \Drupal::service('element_info')->getInfo($type); @@ -1020,6 +1034,8 @@ * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * Use \Drupal::service('element_info')->getInfoProperty() instead. + * + * @see https://www.drupal.org/node/2235461 */ function element_info_property($type, $property_name, $default = NULL) { return \Drupal::service('element_info')->getInfoProperty($type, $property_name, $default); @@ -1112,7 +1128,6 @@ // to reset the theme manager. \Drupal::theme()->resetActiveTheme(); - // Rebuild and reboot a new kernel. A simple DrupalKernel reboot is not // sufficient, since the list of enabled modules might have been adjusted // above due to changed code. diff -r bfffd8d7479a -r 7a779792577d core/includes/file.inc --- a/core/includes/file.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/includes/file.inc Fri Feb 23 15:52:07 2018 +0000 @@ -526,7 +526,6 @@ $destination = file_build_uri(drupal_basename($source)); } - // Prepare the destination directory. if (file_prepare_directory($destination)) { // The destination is already a directory, so append the source basename. diff -r bfffd8d7479a -r 7a779792577d core/includes/install.core.inc --- a/core/includes/install.core.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/includes/install.core.inc Fri Feb 23 15:52:07 2018 +0000 @@ -415,6 +415,7 @@ else { $environment = 'prod'; } + $GLOBALS['conf']['container_service_providers']['InstallerConfigOverride'] = 'Drupal\Core\Installer\ConfigOverride'; // Only allow dumping the container once the hash salt has been created. $kernel = InstallerKernel::createFromRequest($request, $class_loader, $environment, (bool) Settings::get('hash_salt', FALSE)); diff -r bfffd8d7479a -r 7a779792577d core/includes/theme.inc --- a/core/includes/theme.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/includes/theme.inc Fri Feb 23 15:52:07 2018 +0000 @@ -461,7 +461,7 @@ * * @param array $theme_settings * An array of theme settings from system setting form or a Drupal 7 variable. - * @param Config $config + * @param \Drupal\Core\Config\Config $config * The configuration object to update. * * @return diff -r bfffd8d7479a -r 7a779792577d core/includes/update.inc --- a/core/includes/update.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/includes/update.inc Fri Feb 23 15:52:07 2018 +0000 @@ -83,7 +83,7 @@ $requirements['minimum schema'] += [ 'value' => 'The installed schema version does not meet the minimum.', 'severity' => REQUIREMENT_ERROR, - 'description' => 'Your system schema version is ' . $system_schema . '. Updating directly from a schema version prior to 8000 is not supported. You must migrate your site to Drupal 8 first.', + 'description' => 'Your system schema version is ' . $system_schema . '. Updating directly from a schema version prior to 8000 is not supported. You must upgrade your site to Drupal 8 first, see https://www.drupal.org/docs/8/upgrade.', ]; } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal.php --- a/core/lib/Drupal.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal.php Fri Feb 23 15:52:07 2018 +0000 @@ -81,7 +81,7 @@ /** * The current system version. */ - const VERSION = '8.4.2'; + const VERSION = '8.4.5'; /** * Core API compatibility. diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Component/Datetime/DateTimePlus.php --- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php Fri Feb 23 15:52:07 2018 +0000 @@ -23,6 +23,19 @@ * errors are. This is less disruptive than allowing datetime exceptions * to abort processing. The calling script can decide what to do about * errors using hasErrors() and getErrors(). + * + * @method $this add(\DateInterval $interval) + * @method static array getLastErrors() + * @method $this modify(string $modify) + * @method $this setDate(int $year, int $month, int $day) + * @method $this setISODate(int $year, int $week, int $day = 1) + * @method $this setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0) + * @method $this setTimestamp(int $unixtimestamp) + * @method $this setTimezone(\DateTimeZone $timezone) + * @method $this sub(\DateInterval $interval) + * @method int getOffset() + * @method int getTimestamp() + * @method \DateTimeZone getTimezone() */ class DateTimePlus { @@ -53,31 +66,43 @@ /** * The value of the time value passed to the constructor. + * + * @var string */ protected $inputTimeRaw = ''; /** * The prepared time, without timezone, for this date. + * + * @var string */ protected $inputTimeAdjusted = ''; /** * The value of the timezone passed to the constructor. + * + * @var string */ protected $inputTimeZoneRaw = ''; /** * The prepared timezone object used to construct this date. + * + * @var string */ protected $inputTimeZoneAdjusted = ''; /** * The value of the format passed to the constructor. + * + * @var string */ protected $inputFormatRaw = ''; /** * The prepared format, if provided. + * + * @var string */ protected $inputFormatAdjusted = ''; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Component/DependencyInjection/Container.php --- a/core/lib/Drupal/Component/DependencyInjection/Container.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Component/DependencyInjection/Container.php Fri Feb 23 15:52:07 2018 +0000 @@ -586,8 +586,7 @@ /** * Ensure that cloning doesn't work. */ - private function __clone() - { + private function __clone() { } } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Component/Gettext/PoItem.php --- a/core/lib/Drupal/Component/Gettext/PoItem.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Component/Gettext/PoItem.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,7 +13,7 @@ /** * The language code this translation is in. * - * @car string + * @var string */ private $_langcode; @@ -27,7 +27,8 @@ /** * The source string or array of strings if it has plurals. * - * @var string or array + * @var string|array + * * @see $_plural */ private $_source; @@ -49,7 +50,7 @@ /** * The translation string or array of strings if it has plurals. * - * @var string or array + * @var string|array * @see $_plural */ private $_translation; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Component/PhpStorage/FileStorage.php --- a/core/lib/Drupal/Component/PhpStorage/FileStorage.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Component/PhpStorage/FileStorage.php Fri Feb 23 15:52:07 2018 +0000 @@ -138,34 +138,42 @@ * The directory path. * @param int $mode * The mode, permissions, the directory should have. - * @param bool $is_backwards_recursive - * Internal use only. * * @return bool * TRUE if the directory exists or has been created, FALSE otherwise. */ - protected function createDirectory($directory, $mode = 0777, $is_backwards_recursive = FALSE) { + protected function createDirectory($directory, $mode = 0777) { // If the directory exists already, there's nothing to do. if (is_dir($directory)) { return TRUE; } - // Otherwise, try to create the directory and ensure to set its permissions, - // because mkdir() obeys the umask of the current process. - if (is_dir($parent = dirname($directory))) { - // If the parent directory exists, then the backwards recursion must end, - // regardless of whether the subdirectory could be created. - if ($status = mkdir($directory)) { - // Only try to chmod() if the subdirectory could be created. - $status = chmod($directory, $mode); + + // If the parent directory doesn't exist, try to create it. + $parent_exists = is_dir($parent = dirname($directory)); + if (!$parent_exists) { + $parent_exists = $this->createDirectory($parent, $mode); + } + + // If parent exists, try to create the directory and ensure to set its + // permissions, because mkdir() obeys the umask of the current process. + if ($parent_exists) { + // We hide warnings and ignore the return because there may have been a + // race getting here and the directory could already exist. + @mkdir($directory); + // Only try to chmod() if the subdirectory could be created. + if (is_dir($directory)) { + // Avoid writing permissions if possible. + if (fileperms($directory) !== $mode) { + return chmod($directory, $mode); + } + return TRUE; } - return $is_backwards_recursive ? TRUE : $status; + else { + // Something failed and the directory doesn't exist. + trigger_error('mkdir(): Permission Denied', E_USER_WARNING); + } } - // If the parent directory and the requested directory does not exist and - // could not be created above, walk the requested directory path back up - // until an existing directory is hit, and from there, recursively create - // the sub-directories. Only if that recursion succeeds, create the final, - // originally requested subdirectory. - return $this->createDirectory($parent, $mode, TRUE) && mkdir($directory) && chmod($directory, $mode); + return FALSE; } /** diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Component/Utility/Unicode.php --- a/core/lib/Drupal/Component/Utility/Unicode.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Component/Utility/Unicode.php Fri Feb 23 15:52:07 2018 +0000 @@ -603,11 +603,13 @@ * * @param string $string * The header to encode. + * @param bool $shorten + * If TRUE, only return the first chunk of a multi-chunk encoded string. * * @return string * The mime-encoded header. */ - public static function mimeHeaderEncode($string) { + public static function mimeHeaderEncode($string, $shorten = FALSE) { if (preg_match('/[^\x20-\x7E]/', $string)) { // floor((75 - strlen("=?UTF-8?B??=")) * 0.75); $chunk_size = 47; @@ -616,6 +618,9 @@ while ($len > 0) { $chunk = static::truncateBytes($string, $chunk_size); $output .= ' =?UTF-8?B?' . base64_encode($chunk) . "?=\n"; + if ($shorten) { + break; + } $c = strlen($chunk); $string = substr($string, $c); $len -= $c; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Access/AccessManagerInterface.php --- a/core/lib/Drupal/Core/Access/AccessManagerInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Access/AccessManagerInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,7 +38,7 @@ /** * Execute access checks against the incoming request. * - * @param Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * The incoming request. * @param \Drupal\Core\Session\AccountInterface $account * (optional) Run access checks for this account. Defaults to the current diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Ajax/OpenDialogCommand.php --- a/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php Fri Feb 23 15:52:07 2018 +0000 @@ -119,7 +119,7 @@ * The new title of the dialog. */ public function setDialogTitle($title) { - $this->setDialogOptions('title', $title); + $this->setDialogOption('title', $title); } /** diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php --- a/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,7 +36,6 @@ } } - $container->setParameter('cache_contexts', $cache_contexts); } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php --- a/core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,7 +13,7 @@ /** * The language manager. * - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager + * @var \Drupal\Core\Language\LanguageManagerInterface */ protected $languageManager; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Config/ConfigManager.php --- a/core/lib/Drupal/Core/Config/ConfigManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Config/ConfigManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -292,78 +292,85 @@ * {@inheritdoc} */ public function getConfigEntitiesToChangeOnDependencyRemoval($type, array $names, $dry_run = TRUE) { - // Determine the current list of dependent configuration entities and set up - // initial values. $dependency_manager = $this->getConfigDependencyManager(); - $dependents = $this->findConfigEntityDependentsAsEntities($type, $names, $dependency_manager); - $original_dependencies = $dependents; - $delete_uuids = []; + // Store the list of dependents in three separate variables. This allows us + // to determine how the dependency graph changes as entities are fixed by + // calling the onDependencyRemoval() method. + + // The list of original dependents on $names. This list never changes. + $original_dependents = $this->findConfigEntityDependentsAsEntities($type, $names, $dependency_manager); + + // The current list of dependents on $names. This list is recalculated when + // calling an entity's onDependencyRemoval() method results in the entity + // changing. This list is passed to each entity's onDependencyRemoval() + // method as the list of affected entities. + $current_dependents = $original_dependents; + + // The list of dependents to process. This list changes as entities are + // processed and are either fixed or deleted. + $dependents_to_process = $original_dependents; + + // Initialize other variables. + $affected_uuids = []; $return = [ 'update' => [], 'delete' => [], 'unchanged' => [], ]; - // Create a map of UUIDs to $original_dependencies key so that we can remove - // fixed dependencies. - $uuid_map = []; - foreach ($original_dependencies as $key => $entity) { - $uuid_map[$entity->uuid()] = $key; - } - - // Try to fix any dependencies and find out what will happen to the - // dependency graph. Entities are processed in the order of most dependent - // first. For example, this ensures that Menu UI third party dependencies on - // node types are fixed before processing the node type's other - // dependencies. - while ($dependent = array_pop($dependents)) { + // Try to fix the dependents and find out what will happen to the dependency + // graph. Entities are processed in the order of most dependent first. For + // example, this ensures that Menu UI third party dependencies on node types + // are fixed before processing the node type's other dependents. + while ($dependent = array_pop($dependents_to_process)) { /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $dependent */ if ($dry_run) { // Clone the entity so any changes do not change any static caches. $dependent = clone $dependent; } $fixed = FALSE; - if ($this->callOnDependencyRemoval($dependent, $original_dependencies, $type, $names)) { + if ($this->callOnDependencyRemoval($dependent, $current_dependents, $type, $names)) { // Recalculate dependencies and update the dependency graph data. $dependent->calculateDependencies(); $dependency_manager->updateData($dependent->getConfigDependencyName(), $dependent->getDependencies()); - // Based on the updated data rebuild the list of dependents. This will - // remove entities that are no longer dependent after the recalculation. - $dependents = $this->findConfigEntityDependentsAsEntities($type, $names, $dependency_manager); - // Remove any entities that we've already marked for deletion. - $dependents = array_filter($dependents, function ($dependent) use ($delete_uuids) { - return !in_array($dependent->uuid(), $delete_uuids); + // Based on the updated data rebuild the list of current dependents. + // This will remove entities that are no longer dependent after the + // recalculation. + $current_dependents = $this->findConfigEntityDependentsAsEntities($type, $names, $dependency_manager); + // Rebuild the list of entities that we need to process using the new + // list of current dependents and removing any entities that we've + // already processed. + $dependents_to_process = array_filter($current_dependents, function ($current_dependent) use ($affected_uuids) { + return !in_array($current_dependent->uuid(), $affected_uuids); }); - // Ensure that the dependency has actually been fixed. It is possible - // that the dependent has multiple dependencies that cause it to be in - // the dependency chain. + // Ensure that the dependent has actually been fixed. It is possible + // that other dependencies cause it to still be in the list. $fixed = TRUE; - foreach ($dependents as $key => $entity) { + foreach ($dependents_to_process as $key => $entity) { if ($entity->uuid() == $dependent->uuid()) { $fixed = FALSE; - unset($dependents[$key]); + unset($dependents_to_process[$key]); break; } } if ($fixed) { - // Remove the fixed dependency from the list of original dependencies. - unset($original_dependencies[$uuid_map[$dependent->uuid()]]); + $affected_uuids[] = $dependent->uuid(); $return['update'][] = $dependent; } } // If the entity cannot be fixed then it has to be deleted. if (!$fixed) { - $delete_uuids[] = $dependent->uuid(); + $affected_uuids[] = $dependent->uuid(); // Deletes should occur in the order of the least dependent first. For // example, this ensures that fields are removed before field storages. array_unshift($return['delete'], $dependent); } } - // Use the lists of UUIDs to filter the original list to work out which - // configuration entities are unchanged. - $return['unchanged'] = array_filter($original_dependencies, function ($dependent) use ($delete_uuids) { - return !(in_array($dependent->uuid(), $delete_uuids)); + // Use the list of affected UUIDs to filter the original list to work out + // which configuration entities are unchanged. + $return['unchanged'] = array_filter($original_dependents, function ($dependent) use ($affected_uuids) { + return !(in_array($dependent->uuid(), $affected_uuids)); }); return $return; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Config/DatabaseStorage.php --- a/core/lib/Drupal/Core/Config/DatabaseStorage.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Config/DatabaseStorage.php Fri Feb 23 15:52:07 2018 +0000 @@ -159,7 +159,7 @@ * @throws \Drupal\Core\Config\StorageException * If a database error occurs. */ - protected function ensureTableExists() { + protected function ensureTableExists() { try { if (!$this->connection->schema()->tableExists($this->table)) { $this->connection->schema()->createTable($this->table, static::schemaDefinition()); diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php Fri Feb 23 15:52:07 2018 +0000 @@ -445,7 +445,7 @@ * @param bool $is_syncing * Is the configuration entity being created as part of a config sync. * - * @return ConfigEntityInterface + * @return \Drupal\Core\Config\ConfigEntityInterface * The configuration entity. * * @see \Drupal\Core\Config\Entity\ConfigEntityStorageInterface::createFromStorageRecord() diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php --- a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -219,7 +219,7 @@ /** * Updates configuration entity in the key store. * - * @param ConfigCrudEvent $event + * @param \Drupal\Core\Config\ConfigCrudEvent $event * The configuration event. */ public function onConfigSave(ConfigCrudEvent $event) { diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php Fri Feb 23 15:52:07 2018 +0000 @@ -124,7 +124,6 @@ throw $e; } - // Create functions needed by SQLite. $pdo->sqliteCreateFunction('if', [__CLASS__, 'sqlFunctionIf']); $pdo->sqliteCreateFunction('greatest', [__CLASS__, 'sqlFunctionGreatest']); diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php Fri Feb 23 15:52:07 2018 +0000 @@ -19,6 +19,8 @@ /** * Override DatabaseSchema::$defaultSchema + * + * @var string */ protected $defaultSchema = 'main'; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Database/Query/Query.php --- a/core/lib/Drupal/Core/Database/Query/Query.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Database/Query/Query.php Fri Feb 23 15:52:07 2018 +0000 @@ -48,6 +48,8 @@ /** * The placeholder counter. + * + * @var int */ protected $nextPlaceholder = 0; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Database/Query/Select.php --- a/core/lib/Drupal/Core/Database/Query/Select.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Database/Query/Select.php Fri Feb 23 15:52:07 2018 +0000 @@ -113,6 +113,8 @@ /** * The FOR UPDATE status + * + * @var bool */ protected $forUpdate = FALSE; @@ -825,7 +827,6 @@ } $query .= implode(', ', $fields); - // FROM - We presume all queries have a FROM, as any query that doesn't won't need the query builder anyway. $query .= "\nFROM "; foreach ($this->tables as $table) { diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Database/Query/SelectExtender.php --- a/core/lib/Drupal/Core/Database/Query/SelectExtender.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Database/Query/SelectExtender.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,6 +30,8 @@ /** * The placeholder counter. + * + * @var int */ protected $placeholder = 0; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Database/Query/SelectInterface.php --- a/core/lib/Drupal/Core/Database/Query/SelectInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Database/Query/SelectInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -346,6 +346,8 @@ * db_query('A')->rightJoin('B') is identical to * db_query('B')->leftJoin('A'). This functionality has been deprecated * because SQLite does not support it. + * + * @see https://www.drupal.org/node/2765249 */ public function rightJoin($table, $alias = NULL, $condition = NULL, $arguments = []); diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Database/Schema.php --- a/core/lib/Drupal/Core/Database/Schema.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Database/Schema.php Fri Feb 23 15:52:07 2018 +0000 @@ -19,6 +19,8 @@ /** * The placeholder counter. + * + * @var int */ protected $placeholder = 0; @@ -30,6 +32,8 @@ * method. * * @see DatabaseSchema::getPrefixInfo() + * + * @var string */ protected $defaultSchema = 'public'; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php Fri Feb 23 15:52:07 2018 +0000 @@ -56,7 +56,6 @@ } } - foreach ($container->findTaggedServiceIds('backend_overridable') as $id => $attributes) { // If the service is already an alias it is not the original backend, so // we don't want to fallback to other storages any longer. diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/DrupalKernel.php --- a/core/lib/Drupal/Core/DrupalKernel.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/DrupalKernel.php Fri Feb 23 15:52:07 2018 +0000 @@ -676,13 +676,13 @@ * * @param \Exception $e * An exception - * @param Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * A Request instance * @param int $type * The type of the request (one of HttpKernelInterface::MASTER_REQUEST or * HttpKernelInterface::SUB_REQUEST) * - * @return Response + * @return \Symfony\Component\HttpFoundation\Response * A Response instance * * @throws \Exception @@ -1187,10 +1187,10 @@ /** * Attach synthetic values on to kernel. * - * @param ContainerInterface $container + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container * Container object * - * @return ContainerInterface + * @return \Symfony\Component\DependencyInjection\ContainerInterface */ protected function attachSynthetic(ContainerInterface $container) { $persist = []; @@ -1213,7 +1213,7 @@ /** * Compiles a new service container. * - * @return ContainerBuilder The compiled service container + * @return \Drupal\Core\DependencyInjection\ContainerBuilder The compiled service container */ protected function compileContainer() { // We are forcing a container build so it is reasonable to assume that the @@ -1334,7 +1334,7 @@ /** * Gets a new ContainerBuilder instance used to build the service container. * - * @return ContainerBuilder + * @return \Drupal\Core\DependencyInjection\ContainerBuilder */ protected function getContainerBuilder() { return new ContainerBuilder(new ParameterBag($this->getKernelParameters())); diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/Annotation/EntityType.php --- a/core/lib/Drupal/Core/Entity/Annotation/EntityType.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/Annotation/EntityType.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,6 +33,8 @@ /** * The group machine name. + * + * @var string */ public $group = 'default'; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/ContentEntityBase.php --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -713,6 +713,12 @@ elseif (isset($this->translatableEntityKeys[$key][$this->activeLangcode])) { unset($this->translatableEntityKeys[$key][$this->activeLangcode]); } + // If the revision identifier field is being populated with the original + // value, we need to make sure the "new revision" flag is reset + // accordingly. + if ($key === 'revision' && $this->getRevisionId() == $this->getLoadedRevisionId()) { + $this->newRevision = FALSE; + } } } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/EntityChangedInterface.php --- a/core/lib/Drupal/Core/Entity/EntityChangedInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/EntityChangedInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,6 +37,11 @@ /** * Gets the timestamp of the last entity change across all translations. * + * This method will return the highest timestamp across all translations. To + * check that no translation is older than in another version of the entity + * (e.g. to avoid overwriting newer translations with old data), compare each + * translation to the other version individually. + * * @return int * The timestamp of the last entity save operation across all * translations. diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/EntityDisplayBase.php --- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -439,7 +439,7 @@ /** * Determines if a field has options for a given display. * - * @param FieldDefinitionInterface $definition + * @param \Drupal\Core\Field\FieldDefinitionInterface $definition * A field definition. * @return array|null */ diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/EntityFieldManager.php --- a/core/lib/Drupal/Core/Entity/EntityFieldManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/EntityFieldManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -60,7 +60,7 @@ * - type: The field type. * - bundles: The bundles in which the field appears. * - * @return array + * @var array */ protected $fieldMap = []; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/EntityViewBuilder.php --- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,7 +52,7 @@ /** * The language manager. * - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager + * @var \Drupal\Core\Language\LanguageManagerInterface */ protected $languageManager; @@ -66,9 +66,9 @@ /** * The EntityViewDisplay objects created for individual field rendering. * + * @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface[] + * * @see \Drupal\Core\Entity\EntityViewBuilder::getSingleFieldDisplay() - * - * @param \Drupal\Core\Entity\Display\EntityViewDisplayInterface[] */ protected $singleFieldDisplays; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php --- a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,10 +18,23 @@ /** @var \Drupal\Core\Entity\EntityInterface $entity */ if (!$entity->isNew()) { $saved_entity = \Drupal::entityManager()->getStorage($entity->getEntityTypeId())->loadUnchanged($entity->id()); - // A change to any other translation must add a violation to the current - // translation because there might be untranslatable shared fields. - if ($saved_entity && $saved_entity->getChangedTimeAcrossTranslations() > $entity->getChangedTimeAcrossTranslations()) { - $this->context->addViolation($constraint->message); + // Ensure that all the entity translations are the same as or newer + // than their current version in the storage in order to avoid + // reverting other changes. In fact the entity object that is being + // saved might contain an older entity translation when different + // translations are being concurrently edited. + if ($saved_entity) { + $common_translation_languages = array_intersect_key($entity->getTranslationLanguages(), $saved_entity->getTranslationLanguages()); + foreach (array_keys($common_translation_languages) as $langcode) { + // Merely comparing the latest changed timestamps across all + // translations is not sufficient since other translations may have + // been edited and saved in the meanwhile. Therefore, compare the + // changed timestamps of each entity translation individually. + if ($saved_entity->getTranslation($langcode)->getChangedTime() > $entity->getTranslation($langcode)->getChangedTime()) { + $this->context->addViolation($constraint->message); + break; + } + } } } } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php Fri Feb 23 15:52:07 2018 +0000 @@ -204,8 +204,10 @@ $current_schema = $this->getSchemaFromStorageDefinition($storage_definition); $this->processFieldStorageSchema($current_schema); + $installed_schema = $this->loadFieldSchemaData($original); + $this->processFieldStorageSchema($installed_schema); - return $current_schema != $this->loadFieldSchemaData($original); + return $current_schema != $installed_schema; } /** diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Entity/entity.api.php --- a/core/lib/Drupal/Core/Entity/entity.api.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Entity/entity.api.php Fri Feb 23 15:52:07 2018 +0000 @@ -287,11 +287,11 @@ * out-of-the-box support for Entity API's revisioning and publishing * features, which will allow your entity type to be used with Drupal's * editorial workflow provided by the Content Moderation module. - * - The 'id' annotation gives the entity type ID, and the 'label' annotation - * gives the human-readable name of the entity type. If you are defining a - * content entity type that uses bundles, the 'bundle_label' annotation gives - * the human-readable name to use for a bundle of this entity type (for - * example, "Content type" for the Node entity). + * - In the annotation, the 'id' property gives the entity type ID, and the + * 'label' property gives the human-readable name of the entity type. If you + * are defining a content entity type that uses bundles, the 'bundle_label' + * property gives the human-readable name to use for a bundle of this entity + * type (for example, "Content type" for the Node entity). * - The annotation will refer to several handler classes, which you will also * need to define: * - list_builder: Define a class that extends @@ -310,16 +310,17 @@ * \Drupal\Core\Entity\EntityViewBuilderInterface (usually extending * \Drupal\Core\Entity\EntityViewBuilder), to display a single entity. * - translation: For translatable content entities (if the 'translatable' - * annotation has value TRUE), define a class that extends + * annotation property has value TRUE), define a class that extends * \Drupal\content_translation\ContentTranslationHandler, to translate * the content. Configuration translation is handled automatically by the * Configuration Translation module, without the need of a handler class. * - access: If your configuration entity has complex permissions, you might * need an access control handling, implementing - * \Drupal\Core\Entity\EntityAccessControlHandlerInterface, but most entities - * can just use the 'admin_permission' annotation instead. Note that if you - * are creating your own access control handler, you should override the - * checkAccess() and checkCreateAccess() methods, not access(). + * \Drupal\Core\Entity\EntityAccessControlHandlerInterface, but most + * entities can just use the 'admin_permission' annotation property + * instead. Note that if you are creating your own access control handler, + * you should override the checkAccess() and checkCreateAccess() methods, + * not access(). * - storage: A class implementing * \Drupal\Core\Entity\EntityStorageInterface. If not specified, content * entities will use \Drupal\Core\Entity\Sql\SqlContentEntityStorage, and @@ -352,25 +353,26 @@ * - delete-form: Confirmation form to delete the entity. * - edit-form: Editing form. * - Other link types specific to your entity type can also be defined. - * - If your content entity is fieldable, provide 'field_ui_base_route' - * annotation, giving the name of the route that the Manage Fields, Manage - * Display, and Manage Form Display pages from the Field UI module will be - * attached to. This is usually the bundle settings edit page, or an entity - * type settings page if there are no bundles. + * - If your content entity is fieldable, provide the 'field_ui_base_route' + * annotation property, giving the name of the route that the Manage Fields, + * Manage Display, and Manage Form Display pages from the Field UI module + * will be attached to. This is usually the bundle settings edit page, or an + * entity type settings page if there are no bundles. * - If your content entity has bundles, you will also need to define a second * plugin to handle the bundles. This plugin is itself a configuration entity * type, so follow the steps here to define it. The machine name ('id' - * annotation) of this configuration entity class goes into the - * 'bundle_entity_type' annotation on the entity type class. For example, for - * the Node entity, the bundle class is \Drupal\node\Entity\NodeType, whose - * machine name is 'node_type'. This is the annotation value for - * 'bundle_entity_type' on the \Drupal\node\Entity\Node class. Also, the - * bundle config entity type annotation must have a 'bundle_of' entry, + * annotation property) of this configuration entity class goes into the + * 'bundle_entity_type' annotation property on the entity type class. For + * example, for the Node entity, the bundle class is + * \Drupal\node\Entity\NodeType, whose machine name is 'node_type'. This is + * the annotation property 'bundle_entity_type' on the + * \Drupal\node\Entity\Node class. Also, the + * bundle config entity type annotation must have a 'bundle_of' property, * giving the machine name of the entity type it is acting as a bundle for. * These machine names are considered permanent, they may not be renamed. - * - Additional annotations can be seen on entity class examples such as - * \Drupal\node\Entity\Node (content) and \Drupal\user\Entity\Role - * (configuration). These annotations are documented on + * - Additional annotation properties can be seen on entity class examples such + * as \Drupal\node\Entity\Node (content) and \Drupal\user\Entity\Role + * (configuration). These annotation properties are documented on * \Drupal\Core\Entity\EntityType. * * @section sec_routes Entity routes @@ -456,8 +458,8 @@ * $storage = $container->get('entity.manager')->getStorage('your_entity_type'); * @endcode * Here, 'your_entity_type' is the machine name of your entity type ('id' - * annotation on the entity class), and note that you should use dependency - * injection to retrieve this object if possible. See the + * annotation property on the entity class), and note that you should use + * dependency injection to retrieve this object if possible. See the * @link container Services and Dependency Injection topic @endlink for more * about how to properly retrieve services. * diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php --- a/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php Fri Feb 23 15:52:07 2018 +0000 @@ -136,7 +136,7 @@ // Ensure the profile is not changing. if ($install_profile !== $core_extension['profile']) { - $config_importer->logError($this->t('Cannot change the install profile from %new_profile to %profile once Drupal is installed.', ['%profile' => $install_profile, '%new_profile' => $core_extension['profile']])); + $config_importer->logError($this->t('Cannot change the install profile from %profile to %new_profile once Drupal is installed.', ['%profile' => $install_profile, '%new_profile' => $core_extension['profile']])); } } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/EventSubscriber/ConfigSnapshotSubscriber.php --- a/core/lib/Drupal/Core/EventSubscriber/ConfigSnapshotSubscriber.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/EventSubscriber/ConfigSnapshotSubscriber.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,9 +37,9 @@ /** * Constructs the ConfigSnapshotSubscriber object. * - * @param StorageInterface $source_storage + * @param \Drupal\Core\Config\StorageInterface $source_storage * The source storage used to discover configuration changes. - * @param StorageInterface $snapshot_storage + * @param \Drupal\Core\Config\StorageInterface $snapshot_storage * The snapshot storage used to write configuration changes. */ public function __construct(ConfigManagerInterface $config_manager, StorageInterface $source_storage, StorageInterface $snapshot_storage) { diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Extension/ModuleInstaller.php --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -194,6 +194,17 @@ // Update the kernel to include it. $this->updateKernel($module_filenames); + // Replace the route provider service with a version that will rebuild + // if routes used during installation. This ensures that a module's + // routes are available during installation. This has to occur before + // any services that depend on it are instantiated otherwise those + // services will have the old route provider injected. Note that, since + // the container is rebuilt by updating the kernel, the route provider + // service is the regular one even though we are in a loop and might + // have replaced it before. + \Drupal::getContainer()->set('router.route_provider.old', \Drupal::service('router.route_provider')); + \Drupal::getContainer()->set('router.route_provider', \Drupal::service('router.route_provider.lazy_builder')); + // Allow modules to react prior to the installation of a module. $this->moduleHandler->invokeAll('module_preinstall', [$module]); @@ -283,10 +294,6 @@ // @see https://www.drupal.org/node/2208429 \Drupal::service('theme_handler')->refreshInfo(); - // In order to make uninstalling transactional if anything uses routes. - \Drupal::getContainer()->set('router.route_provider.old', \Drupal::service('router.route_provider')); - \Drupal::getContainer()->set('router.route_provider', \Drupal::service('router.route_provider.lazy_builder')); - // Allow the module to perform install tasks. $this->moduleHandler->invoke($module, 'install'); @@ -498,34 +505,30 @@ * The name of the module for which to remove all registered cache bins. */ protected function removeCacheBins($module) { - // Remove any cache bins defined by a module. $service_yaml_file = drupal_get_path('module', $module) . "/$module.services.yml"; - if (file_exists($service_yaml_file)) { - $definitions = Yaml::decode(file_get_contents($service_yaml_file)); - if (isset($definitions['services'])) { - foreach ($definitions['services'] as $id => $definition) { - if (isset($definition['tags'])) { - foreach ($definition['tags'] as $tag) { - // This works for the default cache registration and even in some - // cases when a non-default "super" factory is used. That should - // be extremely rare. - if ($tag['name'] == 'cache.bin' && isset($definition['factory_service']) && isset($definition['factory_method']) && !empty($definition['arguments'])) { - try { - $factory = \Drupal::service($definition['factory_service']); - if (method_exists($factory, $definition['factory_method'])) { - $backend = call_user_func_array([$factory, $definition['factory_method']], $definition['arguments']); - if ($backend instanceof CacheBackendInterface) { - $backend->removeBin(); - } - } - } - catch (\Exception $e) { - watchdog_exception('system', $e, 'Failed to remove cache bin defined by the service %id.', ['%id' => $id]); - } - } - } + if (!file_exists($service_yaml_file)) { + return; + } + + $definitions = Yaml::decode(file_get_contents($service_yaml_file)); + + $cache_bin_services = array_filter( + isset($definitions['services']) ? $definitions['services'] : [], + function ($definition) { + $tags = isset($definition['tags']) ? $definition['tags'] : []; + foreach ($tags as $tag) { + if (isset($tag['name']) && ($tag['name'] == 'cache.bin')) { + return TRUE; } } + return FALSE; + } + ); + + foreach (array_keys($cache_bin_services) as $service_id) { + $backend = $this->kernel->getContainer()->get($service_id); + if ($backend instanceof CacheBackendInterface) { + $backend->removeBin(); } } } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Extension/ThemeInstaller.php --- a/core/lib/Drupal/Core/Extension/ThemeInstaller.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Extension/ThemeInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -265,7 +265,6 @@ $extension_config->save(TRUE); $this->state->set('system.theme.data', $current_theme_data); - // @todo Remove system_list(). $this->themeHandler->refreshInfo(); $this->resetSystem(); diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Field/FieldItemList.php --- a/core/lib/Drupal/Core/Field/FieldItemList.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Field/FieldItemList.php Fri Feb 23 15:52:07 2018 +0000 @@ -7,6 +7,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\TypedData\DataDefinitionInterface; use Drupal\Core\TypedData\Plugin\DataType\ItemList; /** @@ -378,7 +379,6 @@ * {@inheritdoc} */ public function equals(FieldItemListInterface $list_to_compare) { - $columns = $this->getFieldDefinition()->getFieldStorageDefinition()->getColumns(); $count1 = count($this); $count2 = count($list_to_compare); if ($count1 === 0 && $count2 === 0) { @@ -396,9 +396,13 @@ } // If the values are not equal ensure a consistent order of field item // properties and remove properties which will not be saved. - $callback = function (&$value) use ($columns) { + $property_definitions = $this->getFieldDefinition()->getFieldStorageDefinition()->getPropertyDefinitions(); + $non_computed_properties = array_filter($property_definitions, function (DataDefinitionInterface $property) { + return !$property->isComputed(); + }); + $callback = function (&$value) use ($non_computed_properties) { if (is_array($value)) { - $value = array_intersect_key($value, $columns); + $value = array_intersect_key($value, $non_computed_properties); ksort($value); } }; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Field/MapFieldItemList.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/lib/Drupal/Core/Field/MapFieldItemList.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,34 @@ +getValue(); + $value2 = $list_to_compare->getValue(); + + return $value1 == $value2; + } + +} diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -82,7 +82,7 @@ * The view mode. * @param array $third_party_settings * Any third party settings settings. - * @param LoggerChannelFactoryInterface $logger_factory + * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory * The logger factory. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php Fri Feb 23 15:52:07 2018 +0000 @@ -503,19 +503,6 @@ } $bundles_changed = TRUE; - - // In case we deleted the only target bundle allowed by the field - // we have to log a critical message because the field will not - // function correctly anymore. - if ($handler_settings['target_bundles'] === []) { - \Drupal::logger('entity_reference')->critical('The %target_bundle bundle (entity type: %target_entity_type) was deleted. As a result, the %field_name entity reference field (entity_type: %entity_type, bundle: %bundle) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted.', [ - '%target_bundle' => $bundle->label(), - '%target_entity_type' => $bundle->getEntityType()->getBundleOf(), - '%field_name' => $field_definition->getName(), - '%entity_type' => $field_definition->getTargetEntityTypeId(), - '%bundle' => $field_definition->getTargetBundle() - ]); - } } } } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,7 +12,8 @@ * id = "map", * label = @Translation("Map"), * description = @Translation("An entity field for storing a serialized array of values."), - * no_ui = TRUE + * no_ui = TRUE, + * list_class = "\Drupal\Core\Field\MapFieldItemList", * ) */ class MapItem extends FieldItemBase { diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php --- a/core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php Fri Feb 23 15:52:07 2018 +0000 @@ -42,7 +42,7 @@ */ public function processFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'value' => 'email', diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php --- a/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,7 +41,7 @@ /** * Constructs a MimeTypeGuesser object. * - * @param StreamWrapperManagerInterface $stream_wrapper_manager + * @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager * The stream wrapper manager. */ public function __construct(StreamWrapperManagerInterface $stream_wrapper_manager) { diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php --- a/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,7 +3,7 @@ namespace Drupal\Core\Form\EventSubscriber; use Drupal\Core\Ajax\AjaxResponse; -use Drupal\Core\Ajax\ReplaceCommand; +use Drupal\Core\Ajax\PrependCommand; use Drupal\Core\EventSubscriber\MainContentViewSubscriber; use Drupal\Core\Form\Exception\BrokenPostRequestException; use Drupal\Core\Form\FormAjaxException; @@ -78,7 +78,7 @@ $this->drupalSetMessage($this->t('An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (@size) that this server supports.', ['@size' => $this->formatSize($exception->getSize())]), 'error'); $response = new AjaxResponse(); $status_messages = ['#type' => 'status_messages']; - $response->addCommand(new ReplaceCommand(NULL, $status_messages)); + $response->addCommand(new PrependCommand(NULL, $status_messages)); $response->headers->set('X-Status-Code', 200); $event->setResponse($response); return; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Form/FormStateDecoratorBase.php --- a/core/lib/Drupal/Core/Form/FormStateDecoratorBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Form/FormStateDecoratorBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -557,7 +557,7 @@ /** * {@inheritdoc} */ - public function isValueEmpty($key) { + public function isValueEmpty($key) { return $this->decoratedFormState->isValueEmpty($key); } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/GeneratedLink.php --- a/core/lib/Drupal/Core/GeneratedLink.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/GeneratedLink.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,7 +32,7 @@ * @return string */ public function getGeneratedLink() { - return $this->generatedLink ; + return $this->generatedLink; } /** diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/GeneratedUrl.php --- a/core/lib/Drupal/Core/GeneratedUrl.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/GeneratedUrl.php Fri Feb 23 15:52:07 2018 +0000 @@ -25,7 +25,7 @@ * @return string */ public function getGeneratedUrl() { - return $this->generatedUrl ; + return $this->generatedUrl; } /** diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Installer/ConfigOverride.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/lib/Drupal/Core/Installer/ConfigOverride.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,62 @@ +register('core.install_config_override', static::class) + ->addTag('config.factory.override'); + } + + /** + * {@inheritdoc} + */ + public function loadOverrides($names) { + $overrides = []; + if (drupal_installation_attempted() && function_exists('drupal_install_profile_distribution_name')) { + // Early in the installer the site name is unknown. In this case we need + // to fallback to the distribution's name. + $overrides['system.site'] = [ + 'name' => drupal_install_profile_distribution_name(), + ]; + } + return $overrides; + } + + /** + * {@inheritdoc} + */ + public function getCacheSuffix() { + return 'core.install_config_override'; + } + + /** + * {@inheritdoc} + */ + public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) { + return NULL; + } + + /** + * {@inheritdoc} + */ + public function getCacheableMetadata($name) { + return new CacheableMetadata(); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -40,7 +40,7 @@ protected $stores = []; /** - * var \Symfony\Component\DependencyInjection\ContainerInterface + * @var \Symfony\Component\DependencyInjection\ContainerInterface */ protected $container; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Mail/MailManager.php --- a/core/lib/Drupal/Core/Mail/MailManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Mail/MailManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,6 +3,7 @@ namespace Drupal\Core\Mail; use Drupal\Component\Render\PlainTextOutput; +use Drupal\Component\Utility\Unicode; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Cache\CacheBackendInterface; @@ -248,7 +249,12 @@ // Return-Path headers should have a domain authorized to use the // originating SMTP server. $headers['Sender'] = $headers['Return-Path'] = $site_mail; - $headers['From'] = $site_config->get('name') . ' <' . $site_mail . '>'; + // Headers are usually encoded in the mail plugin that implements + // \Drupal\Core\Mail\MailInterface::mail(), for example, + // \Drupal\Core\Mail\Plugin\Mail\PhpMail::mail(). The site name must be + // encoded here to prevent mail plugins from encoding the email address, + // which would break the header. + $headers['From'] = Unicode::mimeHeaderEncode($site_config->get('name'), TRUE) . ' <' . $site_mail . '>'; if ($reply) { $headers['Reply-to'] = $reply; } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Password/PhpassHashedPassword.php --- a/core/lib/Drupal/Core/Password/PhpassHashedPassword.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Password/PhpassHashedPassword.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,6 +28,8 @@ /** * Returns a string for mapping an int to the corresponding base 64 character. + * + * @var string */ public static $ITOA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php --- a/core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,7 +17,7 @@ /** * The data type of the data. * - * @return string + * @var string * The data type. */ protected $dataType; @@ -25,7 +25,7 @@ /** * The human-readable label. * - * @return string + * @var string * The label. */ protected $label; @@ -33,7 +33,7 @@ /** * The human-readable description. * - * @return string|null + * @var string|null * The description, or NULL if no description is available. */ protected $description; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Render/Element/HtmlTag.php --- a/core/lib/Drupal/Core/Render/Element/HtmlTag.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Render/Element/HtmlTag.php Fri Feb 23 15:52:07 2018 +0000 @@ -87,19 +87,19 @@ $escaped_tag = HtmlUtility::escape($element['#tag']); $open_tag = '<' . $escaped_tag . $attributes; $close_tag = '\n"; - $prefix = isset($element['#prefix']) ? $element['#prefix'] . $open_tag : $open_tag; - $suffix = isset($element['#suffix']) ? $close_tag . $element['#suffix'] : $close_tag; // Construct a void element. if (in_array($element['#tag'], self::$voidElements)) { - $prefix .= " />\n"; - $suffix = ''; + $open_tag .= ' />'; + $close_tag = "\n"; } // Construct all other elements. else { - $prefix .= '>'; + $open_tag .= '>'; $markup = $element['#value'] instanceof MarkupInterface ? $element['#value'] : Xss::filterAdmin($element['#value']); $element['#markup'] = Markup::create($markup); } + $prefix = isset($element['#prefix']) ? $element['#prefix'] . $open_tag : $open_tag; + $suffix = isset($element['#suffix']) ? $close_tag . $element['#suffix'] : $close_tag; if (!empty($element['#noscript'])) { $prefix = ''; diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Render/Element/RenderElement.php --- a/core/lib/Drupal/Core/Render/Element/RenderElement.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php Fri Feb 23 15:52:07 2018 +0000 @@ -269,7 +269,6 @@ $element['#attributes']['data-disable-refocus'] = "true"; } - // Add a reasonable default event handler if none was specified. if (isset($element['#ajax']) && !isset($element['#ajax']['event'])) { switch ($element['#type']) { diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Render/MainContent/DialogRenderer.php --- a/core/lib/Drupal/Core/Render/MainContent/DialogRenderer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Render/MainContent/DialogRenderer.php Fri Feb 23 15:52:07 2018 +0000 @@ -62,7 +62,7 @@ * * @param array &$options * The 'target' option, if set, is used, and then removed from $options. - * @param RouteMatchInterface $route_match + * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * When no 'target' option is set in $options, $route_match is used instead * to determine the target. * diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Render/Renderer.php --- a/core/lib/Drupal/Core/Render/Renderer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Render/Renderer.php Fri Feb 23 15:52:07 2018 +0000 @@ -509,11 +509,17 @@ // We store the resulting output in $elements['#markup'], to be consistent // with how render cached output gets stored. This ensures that placeholder // replacement logic gets the same data to work with, no matter if #cache is - // disabled, #cache is enabled, there is a cache hit or miss. - $prefix = isset($elements['#prefix']) ? $this->xssFilterAdminIfUnsafe($elements['#prefix']) : ''; - $suffix = isset($elements['#suffix']) ? $this->xssFilterAdminIfUnsafe($elements['#suffix']) : ''; - - $elements['#markup'] = Markup::create($prefix . $elements['#children'] . $suffix); + // disabled, #cache is enabled, there is a cache hit or miss. If + // #render_children is set the #prefix and #suffix will have already been + // added. + if (isset($elements['#render_children'])) { + $elements['#markup'] = Markup::create($elements['#children']); + } + else { + $prefix = isset($elements['#prefix']) ? $this->xssFilterAdminIfUnsafe($elements['#prefix']) : ''; + $suffix = isset($elements['#suffix']) ? $this->xssFilterAdminIfUnsafe($elements['#suffix']) : ''; + $elements['#markup'] = Markup::create($prefix . $elements['#children'] . $suffix); + } // We've rendered this element (and its subtree!), now update the context. $context->update($elements); diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Render/theme.api.php --- a/core/lib/Drupal/Core/Render/theme.api.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Render/theme.api.php Fri Feb 23 15:52:07 2018 +0000 @@ -613,6 +613,10 @@ * hook called (in this case 'node__article') is available in * $variables['theme_hook_original']. * + * Implementations of this hook must be placed in *.module or *.theme files, or + * must otherwise make sure that the hook implementation is available at + * any given time. + * * @todo Add @code sample. * * @param array $variables @@ -694,6 +698,10 @@ * hook called (in this case 'node__article') is available in * $variables['theme_hook_original']. * + * Implementations of this hook must be placed in *.module or *.theme files, or + * must otherwise make sure that the hook implementation is available at + * any given time. + * * @todo Add @code sample. * * @param array $suggestions diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Routing/MatcherDumper.php --- a/core/lib/Drupal/Core/Routing/MatcherDumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -141,7 +141,6 @@ $insert->execute(); } - } catch (\Exception $e) { $transaction->rollBack(); diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Routing/RouteMatch.php --- a/core/lib/Drupal/Core/Routing/RouteMatch.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Routing/RouteMatch.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,7 +67,7 @@ /** * Creates a RouteMatch from a request. * - * @param Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * A request object. * * @return \Drupal\Core\Routing\RouteMatchInterface diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Routing/RouteProvider.php --- a/core/lib/Drupal/Core/Routing/RouteProvider.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Routing/RouteProvider.php Fri Feb 23 15:52:07 2018 +0000 @@ -135,7 +135,7 @@ * very large route sets to be filtered down to likely candidates, which * may then be filtered in memory more completely. * - * @param Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * A request against which to match. * * @return \Symfony\Component\Routing\RouteCollection diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/Routing/RouteProviderLazyBuilder.php --- a/core/lib/Drupal/Core/Routing/RouteProviderLazyBuilder.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/lib/Drupal/Core/Routing/RouteProviderLazyBuilder.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,12 +3,13 @@ namespace Drupal\Core\Routing; use Symfony\Cmf\Component\Routing\PagedRouteProviderInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; /** * A Route Provider front-end for all Drupal-stored routes. */ -class RouteProviderLazyBuilder implements PreloadableRouteProviderInterface, PagedRouteProviderInterface { +class RouteProviderLazyBuilder implements PreloadableRouteProviderInterface, PagedRouteProviderInterface, EventSubscriberInterface { /** * The route provider service. @@ -32,6 +33,18 @@ protected $rebuilt = FALSE; /** + * Flag to determine if router is currently being rebuilt. + * + * Used to prevent recursive router rebuilds during module installation. + * Recursive rebuilds can occur when route information is required by alter + * hooks that are triggered during a rebuild, for example, + * hook_menu_links_discovered_alter(). + * + * @var bool + */ + protected $rebuilding = FALSE; + + /** * RouteProviderLazyBuilder constructor. * * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider @@ -51,7 +64,7 @@ * The route provider service. */ protected function getRouteProvider() { - if (!$this->rebuilt) { + if (!$this->rebuilt && !$this->rebuilding) { $this->routeBuilder->rebuild(); $this->rebuilt = TRUE; } @@ -132,4 +145,27 @@ return $this->rebuilt; } + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() { + $events[RoutingEvents::DYNAMIC][] = ['routerRebuilding', 3000]; + $events[RoutingEvents::FINISHED][] = ['routerRebuildFinished', -3000]; + return $events; + } + + /** + * Sets the router rebuilding flag to TRUE. + */ + public function routerRebuilding() { + $this->rebuilding = TRUE; + } + + /** + * Sets the router rebuilding flag to FALSE. + */ + public function routerRebuildFinished() { + $this->rebuilding = FALSE; + } + } diff -r bfffd8d7479a -r 7a779792577d core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,155 @@ +valueComputed === FALSE) { + $this->computeValue(); + $this->valueComputed = TRUE; + } + } + + /** + * {@inheritdoc} + */ + public function getValue() { + $this->ensureComputedValue(); + return parent::getValue(); + } + + /** + * {@inheritdoc} + */ + public function setValue($values, $notify = TRUE) { + parent::setValue($values, $notify); + + // Make sure that subsequent getter calls do not try to compute the values + // again. + $this->valueComputed = TRUE; + } + + /** + * {@inheritdoc} + */ + public function getString() { + $this->ensureComputedValue(); + return parent::getString(); + } + + /** + * {@inheritdoc} + */ + public function get($index) { + if (!is_numeric($index)) { + throw new \InvalidArgumentException('Unable to get a value with a non-numeric delta in a list.'); + } + + // Unlike the base implementation of + // \Drupal\Core\TypedData\ListInterface::get(), we do not add an empty item + // automatically because computed item lists need to behave like + // non-computed ones. For example, calling isEmpty() on a computed item list + // should return TRUE when the values were computed and the item list is + // truly empty. + // @see \Drupal\Core\TypedData\Plugin\DataType\ItemList::get(). + $this->ensureComputedValue(); + + return isset($this->list[$index]) ? $this->list[$index] : NULL; + } + + /** + * {@inheritdoc} + */ + public function set($index, $value) { + $this->ensureComputedValue(); + return parent::set($index, $value); + } + + /** + * {@inheritdoc} + */ + public function appendItem($value = NULL) { + $this->ensureComputedValue(); + return parent::appendItem($value); + } + + /** + * {@inheritdoc} + */ + public function removeItem($index) { + $this->ensureComputedValue(); + return parent::removeItem($index); + } + + /** + * {@inheritdoc} + */ + public function isEmpty() { + $this->ensureComputedValue(); + return parent::isEmpty(); + } + + /** + * {@inheritdoc} + */ + public function offsetExists($offset) { + $this->ensureComputedValue(); + return parent::offsetExists($offset); + } + + /** + * {@inheritdoc} + */ + public function getIterator() { + $this->ensureComputedValue(); + return parent::getIterator(); + } + + /** + * {@inheritdoc} + */ + public function count() { + $this->ensureComputedValue(); + return parent::count(); + } + + /** + * {@inheritdoc} + */ + public function applyDefaultValue($notify = TRUE) { + // Default values do not make sense for computed item lists. However, this + // method can be overridden if needed. + return $this; + } + +} diff -r bfffd8d7479a -r 7a779792577d core/misc/drupal.es6.js --- a/core/misc/drupal.es6.js Fri Feb 23 15:51:18 2018 +0000 +++ b/core/misc/drupal.es6.js Fri Feb 23 15:52:07 2018 +0000 @@ -239,9 +239,10 @@ Drupal.checkPlain = function (str) { str = str.toString() .replace(/&/g, '&') + .replace(//g, '>') .replace(/"/g, '"') - .replace(//g, '>'); + .replace(/'/g, '''); return str; }; diff -r bfffd8d7479a -r 7a779792577d core/misc/drupal.js --- a/core/misc/drupal.js Fri Feb 23 15:51:18 2018 +0000 +++ b/core/misc/drupal.js Fri Feb 23 15:52:07 2018 +0000 @@ -48,7 +48,7 @@ }; Drupal.checkPlain = function (str) { - str = str.toString().replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>'); + str = str.toString().replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); return str; }; diff -r bfffd8d7479a -r 7a779792577d core/modules/aggregator/aggregator.install --- a/core/modules/aggregator/aggregator.install Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/aggregator/aggregator.install Fri Feb 23 15:52:07 2018 +0000 @@ -40,3 +40,13 @@ $field_definition->setRequired(TRUE); $definition_update_manager->updateFieldStorageDefinition($field_definition); } + +/** + * Add a default value for the 'Refresh' field for aggregator feed entities. + */ +function aggregator_update_8501() { + $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); + $field_definition = $definition_update_manager->getFieldStorageDefinition('refresh', 'aggregator_feed'); + $field_definition->setDefaultValue(3600); + $definition_update_manager->updateFieldStorageDefinition($field_definition); +} diff -r bfffd8d7479a -r 7a779792577d core/modules/aggregator/src/Controller/AggregatorController.php --- a/core/modules/aggregator/src/Controller/AggregatorController.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/aggregator/src/Controller/AggregatorController.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,10 +47,7 @@ * A form array as expected by drupal_render(). */ public function feedAdd() { - $feed = $this->entityManager()->getStorage('aggregator_feed') - ->create([ - 'refresh' => 3600, - ]); + $feed = $this->entityManager()->getStorage('aggregator_feed')->create(); return $this->entityFormBuilder()->getForm($feed); } diff -r bfffd8d7479a -r 7a779792577d core/modules/aggregator/src/Entity/Feed.php --- a/core/modules/aggregator/src/Entity/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/aggregator/src/Entity/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -168,6 +168,7 @@ $fields['refresh'] = BaseFieldDefinition::create('list_integer') ->setLabel(t('Update interval')) ->setDescription(t('The length of time between feed updates. Requires a correctly configured cron maintenance task.')) + ->setDefaultValue(3600) ->setSetting('unsigned', TRUE) ->setRequired(TRUE) ->setSetting('allowed_values', $period) diff -r bfffd8d7479a -r 7a779792577d core/modules/aggregator/tests/src/Functional/Update/AggregatorUpdateTest.php --- a/core/modules/aggregator/tests/src/Functional/Update/AggregatorUpdateTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/aggregator/tests/src/Functional/Update/AggregatorUpdateTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,4 +38,21 @@ $this->assertTrue($field_definition->isRequired()); } + /** + * Tests that the 'Update interval' field has a default value. + */ + public function testUpdateIntervalDefaultValue() { + // Check that the 'refresh' field does not have a default value prior to the + // update. + $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('refresh', 'aggregator_feed'); + $this->assertSame([], $field_definition->getDefaultValueLiteral()); + + // Run updates. + $this->runUpdates(); + + // Check that the 'refresh' has a default value now. + $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('refresh', 'aggregator_feed'); + $this->assertSame([['value' => 3600]], $field_definition->getDefaultValueLiteral()); + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php --- a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -109,5 +109,6 @@ namespace Drupal\Core\Form; if (!function_exists('drupal_set_message')) { - function drupal_set_message() {} + function drupal_set_message() { + } } diff -r bfffd8d7479a -r 7a779792577d core/modules/big_pipe/src/Render/BigPipe.php --- a/core/modules/big_pipe/src/Render/BigPipe.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/big_pipe/src/Render/BigPipe.php Fri Feb 23 15:52:07 2018 +0000 @@ -446,7 +446,6 @@ } } - // Create a new HtmlResponse. Ensure the CSS and (non-bottom) JS is sent // before the HTML they're associated with. In other words: ensure the // critical assets for this placeholder's markup are loaded first. @@ -483,7 +482,6 @@ } } - // Send this embedded HTML response. $this->sendChunk($html_response); diff -r bfffd8d7479a -r 7a779792577d core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php --- a/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php Fri Feb 23 15:52:07 2018 +0000 @@ -45,7 +45,6 @@ 'contexts' => ['session.exists', 'cookies:big_pipe_nojs'], ]; - // 1. Real-world example of HTML placeholder. $status_messages = new BigPipePlaceholderTestCase( ['#type' => 'status_messages'], @@ -96,7 +95,6 @@ $status_messages->embeddedHtmlResponse = '' . "\n \n"; } - // 2. Real-world example of HTML attribute value placeholder: form action. $form_action = new BigPipePlaceholderTestCase( $container ? $container->get('form_builder')->getForm('Drupal\big_pipe_test\Form\BigPipeTestForm') : [], @@ -119,7 +117,6 @@ $form_action->embeddedHtmlResponse = '
embeddedHtmlResponse = $container->get('csrf_token')->get('admin/appearance/default'); } - // 4. Edge case: custom string to be considered as a placeholder that // happens to not be valid HTML. $hello = new BigPipePlaceholderTestCase( @@ -182,7 +178,6 @@ ]; $hello->embeddedHtmlResponse = 'Yarhar llamas forever!'; - // 5. Edge case: non-#lazy_builder placeholder. $current_time = new BigPipePlaceholderTestCase( [ @@ -239,7 +234,6 @@ ]; $current_time->embeddedHtmlResponse = ''; - // 6. Edge case: #lazy_builder that throws an exception. $exception = new BigPipePlaceholderTestCase( [ diff -r bfffd8d7479a -r 7a779792577d core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php --- a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -101,8 +101,8 @@ 'random attachment type (unofficial), with random assigned value, to prove BigPipeResponseAttachmentsProcessor is a perfect decorator' => [$random_attachments], ]; - $big_pipe_placeholder_attachments = ['big_pipe_placeholders' => $this->randomMachineName()]; - $big_pipe_nojs_placeholder_attachments = ['big_pipe_nojs_placeholders' => $this->randomMachineName()]; + $big_pipe_placeholder_attachments = ['big_pipe_placeholders' => [$this->randomMachineName()]]; + $big_pipe_nojs_placeholder_attachments = ['big_pipe_nojs_placeholders' => [$this->randomMachineName()]]; $big_pipe_cases = [ 'only big_pipe_placeholders' => [$big_pipe_placeholder_attachments], 'only big_pipe_nojs_placeholders' => [$big_pipe_nojs_placeholder_attachments], diff -r bfffd8d7479a -r 7a779792577d core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php --- a/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -78,10 +78,10 @@ /** * Removes any non-visible elements from the passed array. * - * @param NodeElement[] $elements + * @param \Behat\Mink\Element\NodeElement[] $elements * An array of node elements. * - * @return NodeElement[] + * @return \Behat\Mink\Element\NodeElement[] */ protected function filterVisibleElements(array $elements) { $elements = array_filter($elements, function (NodeElement $element) { diff -r bfffd8d7479a -r 7a779792577d core/modules/block_content/src/Tests/BlockContentTestBase.php --- a/core/modules/block_content/src/Tests/BlockContentTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/block_content/src/Tests/BlockContentTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,6 +16,8 @@ /** * Profile to use. + * + * @var string */ protected $profile = 'testing'; diff -r bfffd8d7479a -r 7a779792577d core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php --- a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,7 +31,7 @@ protected function setUp() { parent::setUp(); - /** @var UserInterface $user */ + /** @var \Drupal\user\Entity\UserInterface $user */ $user = User::load(1); // Create initial block. diff -r bfffd8d7479a -r 7a779792577d core/modules/block_content/tests/src/Functional/BlockContentTestBase.php --- a/core/modules/block_content/tests/src/Functional/BlockContentTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/block_content/tests/src/Functional/BlockContentTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,6 +13,8 @@ /** * Profile to use. + * + * @var string */ protected $profile = 'testing'; diff -r bfffd8d7479a -r 7a779792577d core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php --- a/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,7 +37,7 @@ * Tests the Drupal 6 custom block to Drupal 8 migration. */ public function testBlockMigration() { - /** @var BlockContent $block */ + /** @var \Drupal\block_content\Entity\BlockContent $block */ $block = BlockContent::load(1); $this->assertIdentical('My block 1', $block->label()); $this->assertTrue(REQUEST_TIME <= $block->getChangedTime() && $block->getChangedTime() <= time()); diff -r bfffd8d7479a -r 7a779792577d core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php --- a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ - 'filtered_html', - 'name' => 'Filtered HTML', - 'weight' => 0, - 'filters' => [], - ]); - $filtered_html_format->save(); - $editor = Editor::create([ - 'format' => 'filtered_html', - 'editor' => 'ckeditor', - ]); - $editor->save(); - } - - /** - * Tests the enabling of plugins. - */ - public function testEnabledPlugins() { - $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); - $editor = Editor::load('filtered_html'); - - // Case 1: no CKEditor plugins. - $definitions = array_keys($this->manager->getDefinitions()); - sort($definitions); - $this->assertIdentical(['drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'stylescombo'], $definitions, 'No CKEditor plugins found besides the built-in ones.'); - $enabled_plugins = [ - 'drupalimage' => drupal_get_path('module', 'ckeditor') . '/js/plugins/drupalimage/plugin.js', - 'drupallink' => drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink/plugin.js', - ]; - $this->assertIdentical($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only built-in plugins are enabled.'); - $this->assertIdentical(['internal' => NULL] + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); - - // Enable the CKEditor Test module, which has the Llama plugin (plus four - // variations of it, to cover all possible ways a plugin can be enabled) and - // clear the editor manager's cache so it is picked up. - $this->enableModules(['ckeditor_test']); - $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); - $this->manager->clearCachedDefinitions(); - - // Case 2: CKEditor plugins are available. - $plugin_ids = array_keys($this->manager->getDefinitions()); - sort($plugin_ids); - $this->assertIdentical(['drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'llama', 'llama_button', 'llama_contextual', 'llama_contextual_and_button', 'llama_css', 'stylescombo'], $plugin_ids, 'Additional CKEditor plugins found.'); - $this->assertIdentical($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only the internal plugins are enabled.'); - $this->assertIdentical(['internal' => NULL] + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); - - // Case 3: enable each of the newly available plugins, if possible: - // a. Llama: cannot be enabled, since it does not implement - // CKEditorPluginContextualInterface nor CKEditorPluginButtonsInterface. - // b. LlamaContextual: enabled by adding the 'Strike' button, which is - // part of another plugin! - // c. LlamaButton: automatically enabled by adding its 'Llama' button. - // d. LlamaContextualAndButton: enabled by either b or c. - // e. LlamaCSS: automatically enabled by add its 'LlamaCSS' button. - // Below, we will first enable the "Llama" button, which will cause the - // LlamaButton and LlamaContextualAndButton plugins to be enabled. Then we - // will remove the "Llama" button and add the "Strike" button, which will - // cause the LlamaContextual and LlamaContextualAndButton plugins to be - // enabled. Then we will add the "Strike" button back again, which would - // cause LlamaButton, LlamaContextual and LlamaContextualAndButton to be - // enabled. Finally, we will add the "LlamaCSS" button which would cause - // all four plugins to be enabled. - $settings = $editor->getSettings(); - $original_toolbar = $settings['toolbar']; - $settings['toolbar']['rows'][0][0]['items'][] = 'Llama'; - $editor->setSettings($settings); - $editor->save(); - $file = []; - $file['b'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_button.js'; - $file['c'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual.js'; - $file['cb'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual_and_button.js'; - $file['css'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_css.js'; - $expected = $enabled_plugins + ['llama_button' => $file['b'], 'llama_contextual_and_button' => $file['cb']]; - $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton and LlamaContextualAndButton plugins are enabled.'); - $this->assertIdentical(['internal' => NULL] + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LlamaButton and LlamaContextualAndButton plugins are enabled.'); - $settings['toolbar'] = $original_toolbar; - $settings['toolbar']['rows'][0][0]['items'][] = 'Strike'; - $editor->setSettings($settings); - $editor->save(); - $expected = $enabled_plugins + ['llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb']]; - $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LLamaContextual and LlamaContextualAndButton plugins are enabled.'); - $this->assertIdentical(['internal' => NULL] + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LlamaContextual and LlamaContextualAndButton plugins are enabled.'); - $settings['toolbar']['rows'][0][0]['items'][] = 'Llama'; - $editor->setSettings($settings); - $editor->save(); - $expected = $enabled_plugins + ['llama_button' => $file['b'], 'llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb']]; - $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton, LlamaContextual and LlamaContextualAndButton plugins are enabled.'); - $this->assertIdentical(['internal' => NULL] + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LLamaButton, LlamaContextual and LlamaContextualAndButton plugins are enabled.'); - $settings['toolbar']['rows'][0][0]['items'][] = 'LlamaCSS'; - $editor->setSettings($settings); - $editor->save(); - $expected = $enabled_plugins + ['llama_button' => $file['b'], 'llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb'], 'llama_css' => $file['css']]; - $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton, LlamaContextual, LlamaContextualAndButton and LlamaCSS plugins are enabled.'); - $this->assertIdentical(['internal' => NULL] + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LLamaButton, LlamaContextual, LlamaContextualAndButton and LlamaCSS plugins are enabled.'); - } - - /** - * Tests the iframe instance CSS files of plugins. - */ - public function testCssFiles() { - $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); - $editor = Editor::load('filtered_html'); - - // Case 1: no CKEditor iframe instance CSS file. - $this->assertIdentical([], $this->manager->getCssFiles($editor), 'No iframe instance CSS file found.'); - - // Enable the CKEditor Test module, which has the LlamaCss plugin and - // clear the editor manager's cache so it is picked up. - $this->enableModules(['ckeditor_test']); - $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); - $settings = $editor->getSettings(); - // LlamaCss: automatically enabled by adding its 'LlamaCSS' button. - $settings['toolbar']['rows'][0][0]['items'][] = 'LlamaCSS'; - $editor->setSettings($settings); - $editor->save(); - - // Case 2: CKEditor iframe instance CSS file. - $expected = [ - 'llama_css' => [drupal_get_path('module', 'ckeditor_test') . '/css/llama.css'] - ]; - $this->assertIdentical($expected, $this->manager->getCssFiles($editor), 'Iframe instance CSS file found.'); - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php --- a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,495 +0,0 @@ - 'filtered_html', - 'name' => 'Filtered HTML', - 'weight' => 0, - 'filters' => [ - 'filter_html' => [ - 'status' => 1, - 'settings' => [ - 'allowed_html' => '


', - ] - ], - ], - ]); - $filtered_html_format->save(); - $editor = Editor::create([ - 'format' => 'filtered_html', - 'editor' => 'ckeditor', - ]); - $editor->save(); - - // Create "CKEditor" text editor plugin instance. - $this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); - } - - /** - * Tests CKEditor::getJSSettings(). - */ - public function testGetJSSettings() { - $editor = Editor::load('filtered_html'); - - // Default toolbar. - $expected_config = $this->getDefaultInternalConfig() + [ - 'drupalImage_dialogTitleAdd' => 'Insert Image', - 'drupalImage_dialogTitleEdit' => 'Edit Image', - 'drupalLink_dialogTitleAdd' => 'Add Link', - 'drupalLink_dialogTitleEdit' => 'Edit Link', - 'allowedContent' => $this->getDefaultAllowedContentConfig(), - 'disallowedContent' => $this->getDefaultDisallowedContentConfig(), - 'toolbar' => $this->getDefaultToolbarConfig(), - 'contentsCss' => $this->getDefaultContentsCssConfig(), - 'extraPlugins' => 'drupalimage,drupallink', - 'language' => 'en', - 'stylesSet' => FALSE, - 'drupalExternalPlugins' => [ - 'drupalimage' => file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupalimage/plugin.js')), - 'drupallink' => file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupallink/plugin.js')), - ], - ]; - $expected_config = $this->castSafeStrings($expected_config); - ksort($expected_config); - ksort($expected_config['allowedContent']); - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for default configuration.'); - - // Customize the configuration: add button, have two contextually enabled - // buttons, and configure a CKEditor plugin setting. - $this->enableModules(['ckeditor_test']); - $this->container->get('plugin.manager.editor')->clearCachedDefinitions(); - $this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); - $this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions(); - $settings = $editor->getSettings(); - $settings['toolbar']['rows'][0][0]['items'][] = 'Strike'; - $settings['toolbar']['rows'][0][0]['items'][] = 'Format'; - $editor->setSettings($settings); - $editor->save(); - $expected_config['toolbar'][0]['items'][] = 'Strike'; - $expected_config['toolbar'][0]['items'][] = 'Format'; - $expected_config['format_tags'] = 'p;h2;h3;h4;h5;h6'; - $expected_config['extraPlugins'] .= ',llama_contextual,llama_contextual_and_button'; - $expected_config['drupalExternalPlugins']['llama_contextual'] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual.js')); - $expected_config['drupalExternalPlugins']['llama_contextual_and_button'] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual_and_button.js')); - $expected_config['contentsCss'][] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/ckeditor_test.css')); - ksort($expected_config); - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); - - // Change the allowed HTML tags; the "allowedContent" and "format_tags" - // settings for CKEditor should automatically be updated as well. - $format = $editor->getFilterFormat(); - $format->filters('filter_html')->settings['allowed_html'] .= '

 

'; - $format->save(); - - $expected_config['allowedContent']['pre'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => TRUE]; - $expected_config['allowedContent']['h1'] = ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE]; - $expected_config['allowedContent']['blockquote'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => TRUE]; - $expected_config['allowedContent']['address'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => 'foo,bar-*']; - $expected_config['format_tags'] = 'p;h1;h2;h3;h4;h5;h6;pre'; - ksort($expected_config['allowedContent']); - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); - - // Disable the filter_html filter: allow *all *tags. - $format->setFilterConfig('filter_html', ['status' => 0]); - $format->save(); - - $expected_config['allowedContent'] = TRUE; - $expected_config['disallowedContent'] = FALSE; - $expected_config['format_tags'] = 'p;h1;h2;h3;h4;h5;h6;pre'; - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); - - // Enable the filter_test_restrict_tags_and_attributes filter. - $format->setFilterConfig('filter_test_restrict_tags_and_attributes', [ - 'status' => 1, - 'settings' => [ - 'restrictions' => [ - 'allowed' => [ - 'p' => TRUE, - 'a' => [ - 'href' => TRUE, - 'rel' => ['nofollow' => TRUE], - 'class' => ['external' => TRUE], - 'target' => ['_blank' => FALSE], - ], - 'span' => [ - 'class' => ['dodo' => FALSE], - 'property' => ['dc:*' => TRUE], - 'rel' => ['foaf:*' => FALSE], - 'style' => ['underline' => FALSE, 'color' => FALSE, 'font-size' => TRUE], - ], - '*' => [ - 'style' => FALSE, - 'on*' => FALSE, - 'class' => ['is-a-hipster-llama' => TRUE, 'and-more' => TRUE], - 'data-*' => TRUE, - ], - 'del' => FALSE, - ], - ], - ], - ]); - $format->save(); - - $expected_config['allowedContent'] = [ - 'p' => [ - 'attributes' => TRUE, - 'styles' => FALSE, - 'classes' => 'is-a-hipster-llama,and-more', - ], - 'a' => [ - 'attributes' => 'href,rel,class,target', - 'styles' => FALSE, - 'classes' => 'external', - ], - 'span' => [ - 'attributes' => 'class,property,rel,style', - 'styles' => 'font-size', - 'classes' => FALSE, - ], - '*' => [ - 'attributes' => 'class,data-*', - 'styles' => FALSE, - 'classes' => 'is-a-hipster-llama,and-more', - ], - 'del' => [ - 'attributes' => FALSE, - 'styles' => FALSE, - 'classes' => FALSE, - ], - ]; - $expected_config['disallowedContent'] = [ - 'span' => [ - 'styles' => 'underline,color', - 'classes' => 'dodo', - ], - '*' => [ - 'attributes' => 'on*', - ], - ]; - $expected_config['format_tags'] = 'p'; - ksort($expected_config); - ksort($expected_config['allowedContent']); - ksort($expected_config['disallowedContent']); - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); - } - - /** - * Tests CKEditor::buildToolbarJSSetting(). - */ - public function testBuildToolbarJSSetting() { - $editor = Editor::load('filtered_html'); - - // Default toolbar. - $expected = $this->getDefaultToolbarConfig(); - $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for default toolbar.'); - - // Customize the configuration. - $settings = $editor->getSettings(); - $settings['toolbar']['rows'][0][0]['items'][] = 'Strike'; - $editor->setSettings($settings); - $editor->save(); - $expected[0]['items'][] = 'Strike'; - $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for customized toolbar.'); - - // Enable the editor_test module, customize further. - $this->enableModules(['ckeditor_test']); - $this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions(); - // Override the label of a toolbar component. - $settings['toolbar']['rows'][0][0]['name'] = 'JunkScience'; - $settings['toolbar']['rows'][0][0]['items'][] = 'Llama'; - $editor->setSettings($settings); - $editor->save(); - $expected[0]['name'] = 'JunkScience'; - $expected[0]['items'][] = 'Llama'; - $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for customized toolbar with contrib module-provided CKEditor plugin.'); - } - - /** - * Tests CKEditor::buildContentsCssJSSetting(). - */ - public function testBuildContentsCssJSSetting() { - $editor = Editor::load('filtered_html'); - - // Default toolbar. - $expected = $this->getDefaultContentsCssConfig(); - $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly for default toolbar.'); - - // Enable the editor_test module, which implements hook_ckeditor_css_alter(). - $this->enableModules(['ckeditor_test']); - $expected[] = file_url_transform_relative(file_create_url(drupal_get_path('module', 'ckeditor_test') . '/ckeditor_test.css')); - $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a hook_ckeditor_css_alter() implementation exists.'); - - // Enable LlamaCss plugin, which adds an additional CKEditor stylesheet. - $this->container->get('plugin.manager.editor')->clearCachedDefinitions(); - $this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); - $this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions(); - $settings = $editor->getSettings(); - // LlamaCss: automatically enabled by adding its 'LlamaCSS' button. - $settings['toolbar']['rows'][0][0]['items'][] = 'LlamaCSS'; - $editor->setSettings($settings); - $editor->save(); - $expected[] = file_url_transform_relative(file_create_url(drupal_get_path('module', 'ckeditor_test') . '/css/llama.css')); - $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a CKEditorPluginInterface implementation exists.'); - - // Enable the Bartik theme, which specifies a CKEditor stylesheet. - \Drupal::service('theme_handler')->install(['bartik']); - $this->config('system.theme')->set('default', 'bartik')->save(); - $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/base/elements.css')); - $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/captions.css')); - $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/table.css')); - $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/text-formatted.css')); - $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a theme providing a CKEditor stylesheet exists.'); - } - - /** - * Tests Internal::getConfig(). - */ - public function testInternalGetConfig() { - $editor = Editor::load('filtered_html'); - $internal_plugin = $this->container->get('plugin.manager.ckeditor.plugin')->createInstance('internal'); - - // Default toolbar. - $expected = $this->getDefaultInternalConfig(); - $expected['disallowedContent'] = $this->getDefaultDisallowedContentConfig(); - $expected['allowedContent'] = $this->getDefaultAllowedContentConfig(); - $this->assertEqual($expected, $internal_plugin->getConfig($editor), '"Internal" plugin configuration built correctly for default toolbar.'); - - // Format dropdown/button enabled: new setting should be present. - $settings = $editor->getSettings(); - $settings['toolbar']['rows'][0][0]['items'][] = 'Format'; - $editor->setSettings($settings); - $expected['format_tags'] = 'p;h2;h3;h4;h5;h6'; - $this->assertEqual($expected, $internal_plugin->getConfig($editor), '"Internal" plugin configuration built correctly for customized toolbar.'); - } - - /** - * Tests StylesCombo::getConfig(). - */ - public function testStylesComboGetConfig() { - $editor = Editor::load('filtered_html'); - $stylescombo_plugin = $this->container->get('plugin.manager.ckeditor.plugin')->createInstance('stylescombo'); - - // Styles dropdown/button enabled: new setting should be present. - $settings = $editor->getSettings(); - $settings['toolbar']['rows'][0][0]['items'][] = 'Styles'; - $settings['plugins']['stylescombo']['styles'] = ''; - $editor->setSettings($settings); - $editor->save(); - $expected['stylesSet'] = []; - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); - - // Configure the optional "styles" setting in odd ways that shouldn't affect - // the end result. - $settings['plugins']['stylescombo']['styles'] = " \n"; - $editor->setSettings($settings); - $editor->save(); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor)); - $settings['plugins']['stylescombo']['styles'] = "\r\n \n \r \n "; - $editor->setSettings($settings); - $editor->save(); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); - - // Now configure it properly, the end result should change. - $settings['plugins']['stylescombo']['styles'] = "h1.title|Title\np.mAgical.Callout|Callout"; - $editor->setSettings($settings); - $editor->save(); - $expected['stylesSet'] = [ - ['name' => 'Title', 'element' => 'h1', 'attributes' => ['class' => 'title']], - ['name' => 'Callout', 'element' => 'p', 'attributes' => ['class' => 'mAgical Callout']], - ]; - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); - - // Same configuration, but now interspersed with nonsense. Should yield the - // same result. - $settings['plugins']['stylescombo']['styles'] = " h1 .title | Title \r \n\r \np.mAgical .Callout|Callout\r"; - $editor->setSettings($settings); - $editor->save(); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); - - // Slightly different configuration: class names are optional. - $settings['plugins']['stylescombo']['styles'] = " h1 | Title "; - $editor->setSettings($settings); - $editor->save(); - $expected['stylesSet'] = [['name' => 'Title', 'element' => 'h1']]; - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); - - // Invalid syntax should cause stylesSet to be set to FALSE. - $settings['plugins']['stylescombo']['styles'] = "h1"; - $editor->setSettings($settings); - $editor->save(); - $expected['stylesSet'] = FALSE; - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); - } - - /** - * Tests language list availability in CKEditor. - */ - public function testLanguages() { - // Get CKEditor supported language codes and spot-check. - $this->enableModules(['language']); - $this->installConfig(['language']); - $langcodes = $this->ckeditor->getLangcodes(); - - // Language codes transformed with browser mappings. - $this->assertTrue($langcodes['pt-pt'] == 'pt', '"pt" properly resolved'); - $this->assertTrue($langcodes['zh-hans'] == 'zh-cn', '"zh-hans" properly resolved'); - - // Language code both in Drupal and CKEditor. - $this->assertTrue($langcodes['gl'] == 'gl', '"gl" properly resolved'); - - // Language codes only in CKEditor. - $this->assertTrue($langcodes['en-au'] == 'en-au', '"en-au" properly resolved'); - $this->assertTrue($langcodes['sr-latn'] == 'sr-latn', '"sr-latn" properly resolved'); - - // No locale module, so even though languages are enabled, CKEditor should - // still be in English. - $this->assertCKEditorLanguage('en'); - } - - /** - * Tests that CKEditor plugins participate in JS translation. - */ - public function testJSTranslation() { - $this->enableModules(['language', 'locale']); - $this->installSchema('locale', 'locales_source'); - $this->installSchema('locale', 'locales_location'); - $this->installSchema('locale', 'locales_target'); - $editor = Editor::load('filtered_html'); - $this->ckeditor->getJSSettings($editor); - $localeStorage = $this->container->get('locale.storage'); - $string = $localeStorage->findString(['source' => 'Edit Link', 'context' => '']); - $this->assertTrue(!empty($string), 'String from JavaScript file saved.'); - - // With locale module, CKEditor should not adhere to the language selected. - $this->assertCKEditorLanguage(); - } - - /** - * Assert that CKEditor picks the expected language when French is default. - * - * @param string $langcode - * Language code to assert for. Defaults to French. That is the default - * language set in this assertion. - */ - protected function assertCKEditorLanguage($langcode = 'fr') { - // Set French as the site default language. - ConfigurableLanguage::createFromLangcode('fr')->save(); - $this->config('system.site')->set('default_langcode', 'fr')->save(); - - // Reset the language manager so new negotiations attempts will fall back on - // French. Reinject the language manager CKEditor to use the current one. - $this->container->get('language_manager')->reset(); - $this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); - - // Test that we now get the expected language. - $editor = Editor::load('filtered_html'); - $settings = $this->ckeditor->getJSSettings($editor); - $this->assertEqual($settings['language'], $langcode); - } - - protected function getDefaultInternalConfig() { - return [ - 'customConfig' => '', - 'pasteFromWordPromptCleanup' => TRUE, - 'resize_dir' => 'vertical', - 'justifyClasses' => ['text-align-left', 'text-align-center', 'text-align-right', 'text-align-justify'], - 'entities' => FALSE, - 'disableNativeSpellChecker' => FALSE, - ]; - } - - protected function getDefaultAllowedContentConfig() { - return [ - 'h2' => ['attributes' => 'id', 'styles' => FALSE, 'classes' => FALSE], - 'h3' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], - 'h4' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], - 'h5' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], - 'h6' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], - 'p' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], - 'br' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], - 'strong' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], - 'a' => ['attributes' => 'href,hreflang', 'styles' => FALSE, 'classes' => FALSE], - '*' => ['attributes' => 'lang,dir', 'styles' => FALSE, 'classes' => FALSE], - ]; - } - - protected function getDefaultDisallowedContentConfig() { - return [ - '*' => ['attributes' => 'on*'], - ]; - } - - protected function getDefaultToolbarConfig() { - return [ - [ - 'name' => 'Formatting', - 'items' => ['Bold', 'Italic'], - ], - [ - 'name' => 'Links', - 'items' => ['DrupalLink', 'DrupalUnlink'], - ], - [ - 'name' => 'Lists', - 'items' => ['BulletedList', 'NumberedList'], - ], - [ - 'name' => 'Media', - 'items' => ['Blockquote', 'DrupalImage'], - ], - [ - 'name' => 'Tools', - 'items' => ['Source'], - ], - '/', - ]; - } - - protected function getDefaultContentsCssConfig() { - return [ - file_url_transform_relative(file_create_url('core/modules/ckeditor/css/ckeditor-iframe.css')), - file_url_transform_relative(file_create_url('core/modules/system/css/components/align.module.css')), - ]; - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,159 @@ + 'filtered_html', + 'name' => 'Filtered HTML', + 'weight' => 0, + 'filters' => [], + ]); + $filtered_html_format->save(); + $editor = Editor::create([ + 'format' => 'filtered_html', + 'editor' => 'ckeditor', + ]); + $editor->save(); + } + + /** + * Tests the enabling of plugins. + */ + public function testEnabledPlugins() { + $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); + $editor = Editor::load('filtered_html'); + + // Case 1: no CKEditor plugins. + $definitions = array_keys($this->manager->getDefinitions()); + sort($definitions); + $this->assertIdentical(['drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'stylescombo'], $definitions, 'No CKEditor plugins found besides the built-in ones.'); + $enabled_plugins = [ + 'drupalimage' => drupal_get_path('module', 'ckeditor') . '/js/plugins/drupalimage/plugin.js', + 'drupallink' => drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink/plugin.js', + ]; + $this->assertIdentical($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only built-in plugins are enabled.'); + $this->assertIdentical(['internal' => NULL] + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); + + // Enable the CKEditor Test module, which has the Llama plugin (plus four + // variations of it, to cover all possible ways a plugin can be enabled) and + // clear the editor manager's cache so it is picked up. + $this->enableModules(['ckeditor_test']); + $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); + $this->manager->clearCachedDefinitions(); + + // Case 2: CKEditor plugins are available. + $plugin_ids = array_keys($this->manager->getDefinitions()); + sort($plugin_ids); + $this->assertIdentical(['drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'llama', 'llama_button', 'llama_contextual', 'llama_contextual_and_button', 'llama_css', 'stylescombo'], $plugin_ids, 'Additional CKEditor plugins found.'); + $this->assertIdentical($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only the internal plugins are enabled.'); + $this->assertIdentical(['internal' => NULL] + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); + + // Case 3: enable each of the newly available plugins, if possible: + // a. Llama: cannot be enabled, since it does not implement + // CKEditorPluginContextualInterface nor CKEditorPluginButtonsInterface. + // b. LlamaContextual: enabled by adding the 'Strike' button, which is + // part of another plugin! + // c. LlamaButton: automatically enabled by adding its 'Llama' button. + // d. LlamaContextualAndButton: enabled by either b or c. + // e. LlamaCSS: automatically enabled by add its 'LlamaCSS' button. + // Below, we will first enable the "Llama" button, which will cause the + // LlamaButton and LlamaContextualAndButton plugins to be enabled. Then we + // will remove the "Llama" button and add the "Strike" button, which will + // cause the LlamaContextual and LlamaContextualAndButton plugins to be + // enabled. Then we will add the "Strike" button back again, which would + // cause LlamaButton, LlamaContextual and LlamaContextualAndButton to be + // enabled. Finally, we will add the "LlamaCSS" button which would cause + // all four plugins to be enabled. + $settings = $editor->getSettings(); + $original_toolbar = $settings['toolbar']; + $settings['toolbar']['rows'][0][0]['items'][] = 'Llama'; + $editor->setSettings($settings); + $editor->save(); + $file = []; + $file['b'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_button.js'; + $file['c'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual.js'; + $file['cb'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual_and_button.js'; + $file['css'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_css.js'; + $expected = $enabled_plugins + ['llama_button' => $file['b'], 'llama_contextual_and_button' => $file['cb']]; + $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton and LlamaContextualAndButton plugins are enabled.'); + $this->assertIdentical(['internal' => NULL] + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LlamaButton and LlamaContextualAndButton plugins are enabled.'); + $settings['toolbar'] = $original_toolbar; + $settings['toolbar']['rows'][0][0]['items'][] = 'Strike'; + $editor->setSettings($settings); + $editor->save(); + $expected = $enabled_plugins + ['llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb']]; + $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LLamaContextual and LlamaContextualAndButton plugins are enabled.'); + $this->assertIdentical(['internal' => NULL] + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LlamaContextual and LlamaContextualAndButton plugins are enabled.'); + $settings['toolbar']['rows'][0][0]['items'][] = 'Llama'; + $editor->setSettings($settings); + $editor->save(); + $expected = $enabled_plugins + ['llama_button' => $file['b'], 'llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb']]; + $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton, LlamaContextual and LlamaContextualAndButton plugins are enabled.'); + $this->assertIdentical(['internal' => NULL] + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LLamaButton, LlamaContextual and LlamaContextualAndButton plugins are enabled.'); + $settings['toolbar']['rows'][0][0]['items'][] = 'LlamaCSS'; + $editor->setSettings($settings); + $editor->save(); + $expected = $enabled_plugins + ['llama_button' => $file['b'], 'llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb'], 'llama_css' => $file['css']]; + $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton, LlamaContextual, LlamaContextualAndButton and LlamaCSS plugins are enabled.'); + $this->assertIdentical(['internal' => NULL] + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LLamaButton, LlamaContextual, LlamaContextualAndButton and LlamaCSS plugins are enabled.'); + } + + /** + * Tests the iframe instance CSS files of plugins. + */ + public function testCssFiles() { + $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); + $editor = Editor::load('filtered_html'); + + // Case 1: no CKEditor iframe instance CSS file. + $this->assertIdentical([], $this->manager->getCssFiles($editor), 'No iframe instance CSS file found.'); + + // Enable the CKEditor Test module, which has the LlamaCss plugin and + // clear the editor manager's cache so it is picked up. + $this->enableModules(['ckeditor_test']); + $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); + $settings = $editor->getSettings(); + // LlamaCss: automatically enabled by adding its 'LlamaCSS' button. + $settings['toolbar']['rows'][0][0]['items'][] = 'LlamaCSS'; + $editor->setSettings($settings); + $editor->save(); + + // Case 2: CKEditor iframe instance CSS file. + $expected = [ + 'llama_css' => [drupal_get_path('module', 'ckeditor_test') . '/css/llama.css'] + ]; + $this->assertIdentical($expected, $this->manager->getCssFiles($editor), 'Iframe instance CSS file found.'); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,495 @@ + 'filtered_html', + 'name' => 'Filtered HTML', + 'weight' => 0, + 'filters' => [ + 'filter_html' => [ + 'status' => 1, + 'settings' => [ + 'allowed_html' => '


', + ] + ], + ], + ]); + $filtered_html_format->save(); + $editor = Editor::create([ + 'format' => 'filtered_html', + 'editor' => 'ckeditor', + ]); + $editor->save(); + + // Create "CKEditor" text editor plugin instance. + $this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); + } + + /** + * Tests CKEditor::getJSSettings(). + */ + public function testGetJSSettings() { + $editor = Editor::load('filtered_html'); + + // Default toolbar. + $expected_config = $this->getDefaultInternalConfig() + [ + 'drupalImage_dialogTitleAdd' => 'Insert Image', + 'drupalImage_dialogTitleEdit' => 'Edit Image', + 'drupalLink_dialogTitleAdd' => 'Add Link', + 'drupalLink_dialogTitleEdit' => 'Edit Link', + 'allowedContent' => $this->getDefaultAllowedContentConfig(), + 'disallowedContent' => $this->getDefaultDisallowedContentConfig(), + 'toolbar' => $this->getDefaultToolbarConfig(), + 'contentsCss' => $this->getDefaultContentsCssConfig(), + 'extraPlugins' => 'drupalimage,drupallink', + 'language' => 'en', + 'stylesSet' => FALSE, + 'drupalExternalPlugins' => [ + 'drupalimage' => file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupalimage/plugin.js')), + 'drupallink' => file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupallink/plugin.js')), + ], + ]; + $expected_config = $this->castSafeStrings($expected_config); + ksort($expected_config); + ksort($expected_config['allowedContent']); + $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for default configuration.'); + + // Customize the configuration: add button, have two contextually enabled + // buttons, and configure a CKEditor plugin setting. + $this->enableModules(['ckeditor_test']); + $this->container->get('plugin.manager.editor')->clearCachedDefinitions(); + $this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); + $this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions(); + $settings = $editor->getSettings(); + $settings['toolbar']['rows'][0][0]['items'][] = 'Strike'; + $settings['toolbar']['rows'][0][0]['items'][] = 'Format'; + $editor->setSettings($settings); + $editor->save(); + $expected_config['toolbar'][0]['items'][] = 'Strike'; + $expected_config['toolbar'][0]['items'][] = 'Format'; + $expected_config['format_tags'] = 'p;h2;h3;h4;h5;h6'; + $expected_config['extraPlugins'] .= ',llama_contextual,llama_contextual_and_button'; + $expected_config['drupalExternalPlugins']['llama_contextual'] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual.js')); + $expected_config['drupalExternalPlugins']['llama_contextual_and_button'] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual_and_button.js')); + $expected_config['contentsCss'][] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/ckeditor_test.css')); + ksort($expected_config); + $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); + + // Change the allowed HTML tags; the "allowedContent" and "format_tags" + // settings for CKEditor should automatically be updated as well. + $format = $editor->getFilterFormat(); + $format->filters('filter_html')->settings['allowed_html'] .= '

 

'; + $format->save(); + + $expected_config['allowedContent']['pre'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => TRUE]; + $expected_config['allowedContent']['h1'] = ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE]; + $expected_config['allowedContent']['blockquote'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => TRUE]; + $expected_config['allowedContent']['address'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => 'foo,bar-*']; + $expected_config['format_tags'] = 'p;h1;h2;h3;h4;h5;h6;pre'; + ksort($expected_config['allowedContent']); + $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); + + // Disable the filter_html filter: allow *all *tags. + $format->setFilterConfig('filter_html', ['status' => 0]); + $format->save(); + + $expected_config['allowedContent'] = TRUE; + $expected_config['disallowedContent'] = FALSE; + $expected_config['format_tags'] = 'p;h1;h2;h3;h4;h5;h6;pre'; + $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); + + // Enable the filter_test_restrict_tags_and_attributes filter. + $format->setFilterConfig('filter_test_restrict_tags_and_attributes', [ + 'status' => 1, + 'settings' => [ + 'restrictions' => [ + 'allowed' => [ + 'p' => TRUE, + 'a' => [ + 'href' => TRUE, + 'rel' => ['nofollow' => TRUE], + 'class' => ['external' => TRUE], + 'target' => ['_blank' => FALSE], + ], + 'span' => [ + 'class' => ['dodo' => FALSE], + 'property' => ['dc:*' => TRUE], + 'rel' => ['foaf:*' => FALSE], + 'style' => ['underline' => FALSE, 'color' => FALSE, 'font-size' => TRUE], + ], + '*' => [ + 'style' => FALSE, + 'on*' => FALSE, + 'class' => ['is-a-hipster-llama' => TRUE, 'and-more' => TRUE], + 'data-*' => TRUE, + ], + 'del' => FALSE, + ], + ], + ], + ]); + $format->save(); + + $expected_config['allowedContent'] = [ + 'p' => [ + 'attributes' => TRUE, + 'styles' => FALSE, + 'classes' => 'is-a-hipster-llama,and-more', + ], + 'a' => [ + 'attributes' => 'href,rel,class,target', + 'styles' => FALSE, + 'classes' => 'external', + ], + 'span' => [ + 'attributes' => 'class,property,rel,style', + 'styles' => 'font-size', + 'classes' => FALSE, + ], + '*' => [ + 'attributes' => 'class,data-*', + 'styles' => FALSE, + 'classes' => 'is-a-hipster-llama,and-more', + ], + 'del' => [ + 'attributes' => FALSE, + 'styles' => FALSE, + 'classes' => FALSE, + ], + ]; + $expected_config['disallowedContent'] = [ + 'span' => [ + 'styles' => 'underline,color', + 'classes' => 'dodo', + ], + '*' => [ + 'attributes' => 'on*', + ], + ]; + $expected_config['format_tags'] = 'p'; + ksort($expected_config); + ksort($expected_config['allowedContent']); + ksort($expected_config['disallowedContent']); + $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); + } + + /** + * Tests CKEditor::buildToolbarJSSetting(). + */ + public function testBuildToolbarJSSetting() { + $editor = Editor::load('filtered_html'); + + // Default toolbar. + $expected = $this->getDefaultToolbarConfig(); + $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for default toolbar.'); + + // Customize the configuration. + $settings = $editor->getSettings(); + $settings['toolbar']['rows'][0][0]['items'][] = 'Strike'; + $editor->setSettings($settings); + $editor->save(); + $expected[0]['items'][] = 'Strike'; + $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for customized toolbar.'); + + // Enable the editor_test module, customize further. + $this->enableModules(['ckeditor_test']); + $this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions(); + // Override the label of a toolbar component. + $settings['toolbar']['rows'][0][0]['name'] = 'JunkScience'; + $settings['toolbar']['rows'][0][0]['items'][] = 'Llama'; + $editor->setSettings($settings); + $editor->save(); + $expected[0]['name'] = 'JunkScience'; + $expected[0]['items'][] = 'Llama'; + $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for customized toolbar with contrib module-provided CKEditor plugin.'); + } + + /** + * Tests CKEditor::buildContentsCssJSSetting(). + */ + public function testBuildContentsCssJSSetting() { + $editor = Editor::load('filtered_html'); + + // Default toolbar. + $expected = $this->getDefaultContentsCssConfig(); + $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly for default toolbar.'); + + // Enable the editor_test module, which implements hook_ckeditor_css_alter(). + $this->enableModules(['ckeditor_test']); + $expected[] = file_url_transform_relative(file_create_url(drupal_get_path('module', 'ckeditor_test') . '/ckeditor_test.css')); + $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a hook_ckeditor_css_alter() implementation exists.'); + + // Enable LlamaCss plugin, which adds an additional CKEditor stylesheet. + $this->container->get('plugin.manager.editor')->clearCachedDefinitions(); + $this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); + $this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions(); + $settings = $editor->getSettings(); + // LlamaCss: automatically enabled by adding its 'LlamaCSS' button. + $settings['toolbar']['rows'][0][0]['items'][] = 'LlamaCSS'; + $editor->setSettings($settings); + $editor->save(); + $expected[] = file_url_transform_relative(file_create_url(drupal_get_path('module', 'ckeditor_test') . '/css/llama.css')); + $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a CKEditorPluginInterface implementation exists.'); + + // Enable the Bartik theme, which specifies a CKEditor stylesheet. + \Drupal::service('theme_handler')->install(['bartik']); + $this->config('system.theme')->set('default', 'bartik')->save(); + $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/base/elements.css')); + $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/captions.css')); + $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/table.css')); + $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/text-formatted.css')); + $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a theme providing a CKEditor stylesheet exists.'); + } + + /** + * Tests Internal::getConfig(). + */ + public function testInternalGetConfig() { + $editor = Editor::load('filtered_html'); + $internal_plugin = $this->container->get('plugin.manager.ckeditor.plugin')->createInstance('internal'); + + // Default toolbar. + $expected = $this->getDefaultInternalConfig(); + $expected['disallowedContent'] = $this->getDefaultDisallowedContentConfig(); + $expected['allowedContent'] = $this->getDefaultAllowedContentConfig(); + $this->assertEqual($expected, $internal_plugin->getConfig($editor), '"Internal" plugin configuration built correctly for default toolbar.'); + + // Format dropdown/button enabled: new setting should be present. + $settings = $editor->getSettings(); + $settings['toolbar']['rows'][0][0]['items'][] = 'Format'; + $editor->setSettings($settings); + $expected['format_tags'] = 'p;h2;h3;h4;h5;h6'; + $this->assertEqual($expected, $internal_plugin->getConfig($editor), '"Internal" plugin configuration built correctly for customized toolbar.'); + } + + /** + * Tests StylesCombo::getConfig(). + */ + public function testStylesComboGetConfig() { + $editor = Editor::load('filtered_html'); + $stylescombo_plugin = $this->container->get('plugin.manager.ckeditor.plugin')->createInstance('stylescombo'); + + // Styles dropdown/button enabled: new setting should be present. + $settings = $editor->getSettings(); + $settings['toolbar']['rows'][0][0]['items'][] = 'Styles'; + $settings['plugins']['stylescombo']['styles'] = ''; + $editor->setSettings($settings); + $editor->save(); + $expected['stylesSet'] = []; + $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + + // Configure the optional "styles" setting in odd ways that shouldn't affect + // the end result. + $settings['plugins']['stylescombo']['styles'] = " \n"; + $editor->setSettings($settings); + $editor->save(); + $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor)); + $settings['plugins']['stylescombo']['styles'] = "\r\n \n \r \n "; + $editor->setSettings($settings); + $editor->save(); + $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + + // Now configure it properly, the end result should change. + $settings['plugins']['stylescombo']['styles'] = "h1.title|Title\np.mAgical.Callout|Callout"; + $editor->setSettings($settings); + $editor->save(); + $expected['stylesSet'] = [ + ['name' => 'Title', 'element' => 'h1', 'attributes' => ['class' => 'title']], + ['name' => 'Callout', 'element' => 'p', 'attributes' => ['class' => 'mAgical Callout']], + ]; + $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + + // Same configuration, but now interspersed with nonsense. Should yield the + // same result. + $settings['plugins']['stylescombo']['styles'] = " h1 .title | Title \r \n\r \np.mAgical .Callout|Callout\r"; + $editor->setSettings($settings); + $editor->save(); + $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + + // Slightly different configuration: class names are optional. + $settings['plugins']['stylescombo']['styles'] = " h1 | Title "; + $editor->setSettings($settings); + $editor->save(); + $expected['stylesSet'] = [['name' => 'Title', 'element' => 'h1']]; + $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + + // Invalid syntax should cause stylesSet to be set to FALSE. + $settings['plugins']['stylescombo']['styles'] = "h1"; + $editor->setSettings($settings); + $editor->save(); + $expected['stylesSet'] = FALSE; + $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + } + + /** + * Tests language list availability in CKEditor. + */ + public function testLanguages() { + // Get CKEditor supported language codes and spot-check. + $this->enableModules(['language']); + $this->installConfig(['language']); + $langcodes = $this->ckeditor->getLangcodes(); + + // Language codes transformed with browser mappings. + $this->assertTrue($langcodes['pt-pt'] == 'pt', '"pt" properly resolved'); + $this->assertTrue($langcodes['zh-hans'] == 'zh-cn', '"zh-hans" properly resolved'); + + // Language code both in Drupal and CKEditor. + $this->assertTrue($langcodes['gl'] == 'gl', '"gl" properly resolved'); + + // Language codes only in CKEditor. + $this->assertTrue($langcodes['en-au'] == 'en-au', '"en-au" properly resolved'); + $this->assertTrue($langcodes['sr-latn'] == 'sr-latn', '"sr-latn" properly resolved'); + + // No locale module, so even though languages are enabled, CKEditor should + // still be in English. + $this->assertCKEditorLanguage('en'); + } + + /** + * Tests that CKEditor plugins participate in JS translation. + */ + public function testJSTranslation() { + $this->enableModules(['language', 'locale']); + $this->installSchema('locale', 'locales_source'); + $this->installSchema('locale', 'locales_location'); + $this->installSchema('locale', 'locales_target'); + $editor = Editor::load('filtered_html'); + $this->ckeditor->getJSSettings($editor); + $localeStorage = $this->container->get('locale.storage'); + $string = $localeStorage->findString(['source' => 'Edit Link', 'context' => '']); + $this->assertTrue(!empty($string), 'String from JavaScript file saved.'); + + // With locale module, CKEditor should not adhere to the language selected. + $this->assertCKEditorLanguage(); + } + + /** + * Assert that CKEditor picks the expected language when French is default. + * + * @param string $langcode + * Language code to assert for. Defaults to French. That is the default + * language set in this assertion. + */ + protected function assertCKEditorLanguage($langcode = 'fr') { + // Set French as the site default language. + ConfigurableLanguage::createFromLangcode('fr')->save(); + $this->config('system.site')->set('default_langcode', 'fr')->save(); + + // Reset the language manager so new negotiations attempts will fall back on + // French. Reinject the language manager CKEditor to use the current one. + $this->container->get('language_manager')->reset(); + $this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); + + // Test that we now get the expected language. + $editor = Editor::load('filtered_html'); + $settings = $this->ckeditor->getJSSettings($editor); + $this->assertEqual($settings['language'], $langcode); + } + + protected function getDefaultInternalConfig() { + return [ + 'customConfig' => '', + 'pasteFromWordPromptCleanup' => TRUE, + 'resize_dir' => 'vertical', + 'justifyClasses' => ['text-align-left', 'text-align-center', 'text-align-right', 'text-align-justify'], + 'entities' => FALSE, + 'disableNativeSpellChecker' => FALSE, + ]; + } + + protected function getDefaultAllowedContentConfig() { + return [ + 'h2' => ['attributes' => 'id', 'styles' => FALSE, 'classes' => FALSE], + 'h3' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], + 'h4' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], + 'h5' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], + 'h6' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], + 'p' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], + 'br' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], + 'strong' => ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE], + 'a' => ['attributes' => 'href,hreflang', 'styles' => FALSE, 'classes' => FALSE], + '*' => ['attributes' => 'lang,dir', 'styles' => FALSE, 'classes' => FALSE], + ]; + } + + protected function getDefaultDisallowedContentConfig() { + return [ + '*' => ['attributes' => 'on*'], + ]; + } + + protected function getDefaultToolbarConfig() { + return [ + [ + 'name' => 'Formatting', + 'items' => ['Bold', 'Italic'], + ], + [ + 'name' => 'Links', + 'items' => ['DrupalLink', 'DrupalUnlink'], + ], + [ + 'name' => 'Lists', + 'items' => ['BulletedList', 'NumberedList'], + ], + [ + 'name' => 'Media', + 'items' => ['Blockquote', 'DrupalImage'], + ], + [ + 'name' => 'Tools', + 'items' => ['Source'], + ], + '/', + ]; + } + + protected function getDefaultContentsCssConfig() { + return [ + file_url_transform_relative(file_create_url('core/modules/ckeditor/css/ckeditor-iframe.css')), + file_url_transform_relative(file_create_url('core/modules/system/css/components/align.module.css')), + ]; + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/src/CommentStorage.php --- a/core/modules/comment/src/CommentStorage.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/src/CommentStorage.php Fri Feb 23 15:52:07 2018 +0000 @@ -324,7 +324,7 @@ * {@inheritdoc} */ public function getUnapprovedCount() { - return $this->database->select('comment_field_data', 'c') + return $this->database->select('comment_field_data', 'c') ->condition('status', CommentInterface::NOT_PUBLISHED, '=') ->condition('default_langcode', 1) ->countQuery() diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/src/Controller/CommentController.php --- a/core/modules/comment/src/Controller/CommentController.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/src/Controller/CommentController.php Fri Feb 23 15:52:07 2018 +0000 @@ -279,9 +279,12 @@ // Check if the user has the proper permissions. $access = AccessResult::allowedIfHasPermission($account, 'post comments'); + // If commenting is open on the entity. $status = $entity->{$field_name}->status; $access = $access->andIf(AccessResult::allowedIf($status == CommentItemInterface::OPEN) - ->addCacheableDependency($entity)); + ->addCacheableDependency($entity)) + // And if user has access to the host entity. + ->andIf(AccessResult::allowedIf($entity->access('view'))); // $pid indicates that this is a reply to a comment. if ($pid) { diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/src/Entity/Comment.php --- a/core/modules/comment/src/Entity/Comment.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/src/Entity/Comment.php Fri Feb 23 15:52:07 2018 +0000 @@ -73,6 +73,8 @@ /** * The thread for which a lock was acquired. + * + * @var string */ protected $threadLock = ''; diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php --- a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -78,7 +78,7 @@ protected $entityFormBuilder; /** - * @param \Drupal\Core\Routing\RouteMatchInterface $routeMatch + * @var \Drupal\Core\Routing\RouteMatchInterface */ protected $routeMatch; diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/src/Plugin/migrate/destination/EntityComment.php --- a/core/modules/comment/src/Plugin/migrate/destination/EntityComment.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/src/Plugin/migrate/destination/EntityComment.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,9 +41,9 @@ * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param MigrationInterface $migration + * @param \Drupal\migrate\Plugin\MigrationInterface $migration * The migration. - * @param EntityStorageInterface $storage + * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The storage for this entity type. * @param array $bundles * The list of bundles this entity type has. diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/src/Plugin/migrate/source/d6/CommentVariable.php --- a/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariable.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariable.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,7 +30,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return count($this->getCommentVariables()); } diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/src/Plugin/views/sort/Thread.php --- a/core/modules/comment/src/Plugin/views/sort/Thread.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/src/Plugin/views/sort/Thread.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,8 +16,8 @@ public function query() { $this->ensureMyTable(); - // Read comment_render() in comment.module for an explanation of the - // thinking behind this sort. + // See \Drupal\comment\CommentStorage::loadThread() for an explanation of + // the thinking behind this sort. if ($this->options['order'] == 'DESC') { $this->query->addOrderBy($this->tableAlias, $this->realField, $this->options['order']); } diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/src/Plugin/views/wizard/Comment.php --- a/core/modules/comment/src/Plugin/views/wizard/Comment.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,6 +21,8 @@ /** * Set the created column. + * + * @var string */ protected $createdColumn = 'created'; diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/tests/src/Functional/CommentAccessTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/comment/tests/src/Functional/CommentAccessTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,120 @@ + 'article', + 'name' => 'Article', + ]); + $node_type->save(); + $node_author = $this->drupalCreateUser([ + 'create article content', + 'access comments', + ]); + + $this->drupalLogin($this->drupalCreateUser([ + 'edit own comments', + 'skip comment approval', + 'post comments', + 'access comments', + 'access content', + ])); + + $this->addDefaultCommentField('node', 'article'); + $this->unpublishedNode = $this->createNode([ + 'title' => 'This is unpublished', + 'uid' => $node_author->id(), + 'status' => 0, + 'type' => 'article', + ]); + $this->unpublishedNode->save(); + } + + /** + * Tests commenting disabled for access-blocked entities. + */ + public function testCannotCommentOnEntitiesYouCannotView() { + $assert = $this->assertSession(); + + $comment_url = 'comment/reply/node/' . $this->unpublishedNode->id() . '/comment'; + + // Commenting on an unpublished node results in access denied. + $this->drupalGet($comment_url); + $assert->statusCodeEquals(403); + + // Publishing the node grants access. + $this->unpublishedNode->setPublished(TRUE)->save(); + $this->drupalGet($comment_url); + $assert->statusCodeEquals(200); + } + + /** + * Tests cannot view comment reply form on entities you cannot view. + */ + public function testCannotViewCommentReplyFormOnEntitiesYouCannotView() { + $assert = $this->assertSession(); + + // Create a comment on an unpublished node. + $comment = Comment::create([ + 'entity_type' => 'node', + 'name' => 'Tony', + 'hostname' => 'magic.example.com', + 'mail' => 'foo@example.com', + 'subject' => 'Comment on unpublished node', + 'entity_id' => $this->unpublishedNode->id(), + 'comment_type' => 'comment', + 'field_name' => 'comment', + 'pid' => 0, + 'uid' => $this->unpublishedNode->getOwnerId(), + 'status' => 1, + ]); + $comment->save(); + + $comment_url = 'comment/reply/node/' . $this->unpublishedNode->id() . '/comment/' . $comment->id(); + + // Replying to a comment on an unpublished node results in access denied. + $this->drupalGet($comment_url); + $assert->statusCodeEquals(403); + + // Publishing the node grants access. + $this->unpublishedNode->setPublished(TRUE)->save(); + $this->drupalGet($comment_url); + $assert->statusCodeEquals(200); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/tests/src/Functional/CommentNonNodeTest.php --- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -450,6 +450,7 @@ 'post comments', 'administer comment fields', 'administer comment types', + 'view test entity', ]); $this->drupalLogin($limited_user); diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/tests/src/Functional/CommentThreadingTest.php --- a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,7 +54,6 @@ // Confirm that there is a link to the parent comment. $this->assertParentLink($comment1_3->id(), $comment1->id()); - // Reply to comment #1_3 creating comment #1_3_4. $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment1_3->id()); $comment1_3_4 = $this->postComment(NULL, $this->randomMachineName(), $this->randomMachineName(), TRUE); diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php --- a/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -144,6 +144,7 @@ // Create a user and a comment. $user = User::create(['name' => 'alice']); + $user->activate(); $user->save(); $this->postComment($user, 'user body', 'user subject', TRUE); diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/tests/src/Kernel/CommentItemTest.php --- a/core/modules/comment/tests/src/Kernel/CommentItemTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/tests/src/Kernel/CommentItemTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -71,6 +71,9 @@ public function testCommentAuthorName() { $this->installEntitySchema('comment'); + $host = EntityTest::create(['name' => $this->randomString()]); + $host->save(); + // Create some comments. $comment = Comment::create([ 'subject' => 'My comment title', @@ -78,6 +81,7 @@ 'name' => 'entity-test', 'mail' => 'entity@localhost', 'entity_type' => 'entity_test', + 'entity_id' => $host->id(), 'comment_type' => 'entity_test', 'status' => 1, ]); @@ -95,6 +99,7 @@ 'mail' => 'test@example.com', 'homepage' => 'https://example.com', 'entity_type' => 'entity_test', + 'entity_id' => $host->id(), 'comment_type' => 'entity_test', 'status' => 1, ]); diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php --- a/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -19,6 +19,13 @@ class CommentLinksTest extends CommentViewsKernelTestBase { /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['entity_test']; + + /** * Views used by this test. * * @var array @@ -26,14 +33,26 @@ public static $testViews = ['test_comment']; /** + * {@inheritdoc} + */ + protected function setUp($import_test_views = TRUE) { + parent::setUp($import_test_views); + + $this->installEntitySchema('entity_test'); + } + + /** * Test the comment approve link. */ public function testLinkApprove() { + $host = EntityTest::create(['name' => $this->randomString()]); + $host->save(); // Create an unapproved comment. $comment = $this->commentStorage->create([ 'uid' => $this->adminUser->id(), 'entity_type' => 'entity_test', + 'entity_id' => $host->id(), 'comment_type' => 'entity_test', 'status' => 0, ]); @@ -91,8 +110,7 @@ * Test the comment reply link. */ public function testLinkReply() { - $this->enableModules(['field', 'entity_test']); - $this->installEntitySchema('entity_test'); + $this->enableModules(['field']); $this->installSchema('comment', ['comment_entity_statistics']); $this->installConfig(['field']); diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php --- a/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,6 +4,7 @@ use Drupal\comment\Entity\Comment; use Drupal\Core\Session\AnonymousUserSession; +use Drupal\entity_test\Entity\EntityTest; use Drupal\Tests\views\Kernel\ViewsKernelTestBase; use Drupal\user\Entity\Role; use Drupal\user\Entity\User; @@ -36,6 +37,7 @@ $this->installEntitySchema('user'); $this->installEntitySchema('comment'); + $this->installEntitySchema('entity_test'); // Create the anonymous role. $this->installConfig(['user']); @@ -67,12 +69,16 @@ ]); $this->adminUser->save(); + $host = EntityTest::create(['name' => $this->randomString()]); + $host->save(); + // Create some comments. $comment = Comment::create([ 'subject' => 'My comment title', 'uid' => $this->adminUser->id(), 'name' => $this->adminUser->label(), 'entity_type' => 'entity_test', + 'entity_id' => $host->id(), 'comment_type' => 'entity_test', 'status' => 1, ]); @@ -85,6 +91,7 @@ 'mail' => 'test@example.com', 'homepage' => 'https://example.com', 'entity_type' => 'entity_test', + 'entity_id' => $host->id(), 'comment_type' => 'entity_test', 'created' => 123456, 'status' => 1, diff -r bfffd8d7479a -r 7a779792577d core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php --- a/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,6 +3,7 @@ namespace Drupal\Tests\comment\Kernel\Views; use Drupal\comment\Entity\Comment; +use Drupal\entity_test\Entity\EntityTest; use Drupal\user\Entity\User; use Drupal\Tests\views\Kernel\Handler\FieldFieldAccessTestBase; @@ -25,6 +26,7 @@ parent::setUp($import_test_views); $this->installEntitySchema('comment'); + $this->installEntitySchema('entity_test'); } /** @@ -36,10 +38,14 @@ ]); $user->save(); + $host = EntityTest::create(['name' => $this->randomString()]); + $host->save(); + $comment = Comment::create([ 'subject' => 'My comment title', 'uid' => $user->id(), 'entity_type' => 'entity_test', + 'entity_id' => $host->id(), 'comment_type' => 'entity_test', ]); $comment->save(); @@ -51,6 +57,7 @@ 'mail' => 'test@example.com', 'homepage' => 'https://example.com', 'entity_type' => 'entity_test', + 'entity_id' => $host->id(), 'comment_type' => 'entity_test', 'created' => 123456, 'status' => 1, diff -r bfffd8d7479a -r 7a779792577d core/modules/config/config.install --- a/core/modules/config/config.install Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ - t('Configuration directory: %type', ['%type' => CONFIG_SYNC_DIRECTORY]), - 'description' => t('The directory %directory is not writable.', ['%directory' => $directory]), - 'severity' => REQUIREMENT_WARNING, - ]; - } - return $requirements; -} diff -r bfffd8d7479a -r 7a779792577d core/modules/config/src/ConfigSubscriber.php --- a/core/modules/config/src/ConfigSubscriber.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/config/src/ConfigSubscriber.php Fri Feb 23 15:52:07 2018 +0000 @@ -14,7 +14,7 @@ /** * Checks that the Configuration module is not being uninstalled. * - * @param ConfigImporterEvent $event + * @param \Drupal\Core\Config\ConfigImporterEvent $event * The config import event. */ public function onConfigImporterValidate(ConfigImporterEvent $event) { diff -r bfffd8d7479a -r 7a779792577d core/modules/config/tests/config_test/src/Entity/ConfigTest.php --- a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -117,9 +117,12 @@ * {@inheritdoc} */ public function onDependencyRemoval(array $dependencies) { - // Record which entities have this method called on. + // Record which entities have this method called on and what dependencies + // are passed. $called = \Drupal::state()->get('config_test.on_dependency_removal_called', []); - $called[] = $this->id(); + $called[$this->id()] = $dependencies; + $called[$this->id()]['config'] = array_keys($called[$this->id()]['config']); + $called[$this->id()]['content'] = array_keys($called[$this->id()]['content']); \Drupal::state()->set('config_test.on_dependency_removal_called', $called); $changed = parent::onDependencyRemoval($dependencies); diff -r bfffd8d7479a -r 7a779792577d core/modules/config/tests/src/Functional/ConfigEntityTest.php --- a/core/modules/config/tests/src/Functional/ConfigEntityTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/config/tests/src/Functional/ConfigEntityTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,7 +35,8 @@ public function testCRUD() { $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); // Verify default properties on a newly created empty entity. - $empty = entity_create('config_test'); + $storage = \Drupal::entityTypeManager()->getStorage('config_test'); + $empty = $storage->create(); $this->assertTrue($empty->uuid()); $this->assertIdentical($empty->label, NULL); $this->assertIdentical($empty->style, NULL); @@ -76,7 +77,7 @@ } // Verify that an entity with an empty ID string is considered empty, too. - $empty_id = entity_create('config_test', [ + $empty_id = $storage->create([ 'id' => '', ]); $this->assertIdentical($empty_id->isNew(), TRUE); @@ -89,7 +90,7 @@ } // Verify properties on a newly created entity. - $config_test = entity_create('config_test', $expected = [ + $config_test = $storage->create($expected = [ 'id' => $this->randomMachineName(), 'label' => $this->randomString(), 'style' => $this->randomMachineName(), @@ -141,7 +142,7 @@ // maximum allowed length, but not longer. // Test with a short ID. - $id_length_config_test = entity_create('config_test', [ + $id_length_config_test = $storage->create([ 'id' => $this->randomMachineName(8), ]); try { @@ -155,7 +156,7 @@ } // Test with an ID of the maximum allowed length. - $id_length_config_test = entity_create('config_test', [ + $id_length_config_test = $storage->create([ 'id' => $this->randomMachineName(static::MAX_ID_LENGTH), ]); try { @@ -169,7 +170,7 @@ } // Test with an ID exceeding the maximum allowed length. - $id_length_config_test = entity_create('config_test', [ + $id_length_config_test = $storage->create([ 'id' => $this->randomMachineName(static::MAX_ID_LENGTH + 1), ]); try { @@ -188,7 +189,7 @@ // Ensure that creating an entity with the same id as an existing one is not // possible. - $same_id = entity_create('config_test', [ + $same_id = $storage->create([ 'id' => $config_test->id(), ]); $this->assertIdentical($same_id->isNew(), TRUE); @@ -223,7 +224,7 @@ // Test config entity prepopulation. \Drupal::state()->set('config_test.prepopulate', TRUE); - $config_test = entity_create('config_test', ['foo' => 'bar']); + $config_test = $storage->create(['foo' => 'bar']); $this->assertEqual($config_test->get('foo'), 'baz', 'Initial value correctly populated'); } diff -r bfffd8d7479a -r 7a779792577d core/modules/config/tests/src/Functional/ConfigInstallWebTest.php --- a/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -204,11 +204,6 @@ file_unmanaged_delete_recursive($directory); $this->drupalGet('/admin/reports/status'); $this->assertRaw(t('The directory %directory does not exist.', ['%directory' => $directory])); - - file_prepare_directory($directory, FILE_CREATE_DIRECTORY); - \Drupal::service('file_system')->chmod($directory, 0555); - $this->drupalGet('/admin/reports/status'); - $this->assertRaw(t('The directory %directory is not writable.', ['%directory' => $directory])); } } diff -r bfffd8d7479a -r 7a779792577d core/modules/config_translation/src/ConfigNamesMapper.php --- a/core/modules/config_translation/src/ConfigNamesMapper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/config_translation/src/ConfigNamesMapper.php Fri Feb 23 15:52:07 2018 +0000 @@ -61,7 +61,7 @@ /** * The base route object that the mapper is attached to. * - * @return \Symfony\Component\Routing\Route + * @var \Symfony\Component\Routing\Route */ protected $baseRoute; diff -r bfffd8d7479a -r 7a779792577d core/modules/config_translation/src/Controller/ConfigTranslationController.php --- a/core/modules/config_translation/src/Controller/ConfigTranslationController.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/config_translation/src/Controller/ConfigTranslationController.php Fri Feb 23 15:52:07 2018 +0000 @@ -62,7 +62,7 @@ /** * The language manager. * - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager + * @var \Drupal\Core\Language\LanguageManagerInterface */ protected $languageManager; diff -r bfffd8d7479a -r 7a779792577d core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -77,7 +77,7 @@ // Make sure there is only a single operation for each dropbutton, either // 'List' or 'Translate'. foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) { - $this->assertIdentical(1, count($dropbutton->find('xpath', 'li'))); + $this->assertIdentical(1, count($dropbutton->findAll('xpath', 'li'))); $this->assertTrue(($dropbutton->getText() === 'Translate') || ($dropbutton->getText() === 'List')); } @@ -87,8 +87,9 @@ $this->randomString(), ]; + $storage = \Drupal::entityTypeManager()->getStorage('config_test'); foreach ($labels as $label) { - $test_entity = entity_create('config_test', [ + $test_entity = $storage->create([ 'id' => $this->randomMachineName(), 'label' => $label, ]); @@ -102,7 +103,7 @@ // Make sure there is only a single 'Translate' operation for each // dropbutton. foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) { - $this->assertIdentical(1, count($dropbutton->find('xpath', 'li'))); + $this->assertIdentical(1, count($dropbutton->findAll('xpath', 'li'))); $this->assertIdentical('Translate', $dropbutton->getText()); } diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/content_moderation.permissions.yml --- a/core/modules/content_moderation/content_moderation.permissions.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/content_moderation.permissions.yml Fri Feb 23 15:52:07 2018 +0000 @@ -3,7 +3,7 @@ view latest version: title: 'View the latest version' - description: 'Requires the "View any unpublished content" permission' + description: 'Requires the "View any unpublished content" or "View own unpublished content" permission' permission_callbacks: - \Drupal\content_moderation\Permissions::transitionPermissions diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/src/EntityTypeInfo.php --- a/core/modules/content_moderation/src/EntityTypeInfo.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/src/EntityTypeInfo.php Fri Feb 23 15:52:07 2018 +0000 @@ -121,7 +121,7 @@ /** * Adds Moderation configuration to appropriate entity types. * - * @param EntityTypeInterface[] $entity_types + * @param \Drupal\Core\Entity\EntityTypeInterface[] $entity_types * The master entity type list to alter. * * @see hook_entity_type_alter() diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/src/Form/EntityModerationForm.php --- a/core/modules/content_moderation/src/Form/EntityModerationForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/src/Form/EntityModerationForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,7 @@ namespace Drupal\content_moderation\Form; +use Drupal\Component\Datetime\Time; use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\RevisionLogInterface; use Drupal\Core\Form\FormBase; @@ -24,6 +25,13 @@ protected $moderationInfo; /** + * The time service. + * + * @var \Drupal\Component\Datetime\Time + */ + protected $time; + + /** * The moderation state transition validation service. * * @var \Drupal\content_moderation\StateTransitionValidation @@ -37,9 +45,12 @@ * The moderation information service. * @param \Drupal\content_moderation\StateTransitionValidation $validation * The moderation state transition validation service. + * @param \Drupal\Component\Datetime\Time $time + * The time service. */ - public function __construct(ModerationInformationInterface $moderation_info, StateTransitionValidation $validation) { + public function __construct(ModerationInformationInterface $moderation_info, StateTransitionValidation $validation, Time $time) { $this->moderationInfo = $moderation_info; + $this->time = $time; $this->validation = $validation; } @@ -49,7 +60,8 @@ public static function create(ContainerInterface $container) { return new static( $container->get('content_moderation.moderation_information'), - $container->get('content_moderation.state_transition_validation') + $container->get('content_moderation.state_transition_validation'), + $container->get('datetime.time') ); } @@ -122,7 +134,7 @@ * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var ContentEntityInterface $entity */ + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ $entity = $form_state->get('entity'); $new_state = $form_state->getValue('new_state'); @@ -130,6 +142,7 @@ $entity->set('moderation_state', $new_state); if ($entity instanceof RevisionLogInterface) { + $entity->setRevisionCreationTime($this->time->getRequestTime()); $entity->setRevisionLogMessage($form_state->getValue('revision_log')); $entity->setRevisionUserId($this->currentUser()->id()); } diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/src/ModerationInformation.php --- a/core/modules/content_moderation/src/ModerationInformation.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/src/ModerationInformation.php Fri Feb 23 15:52:07 2018 +0000 @@ -84,14 +84,15 @@ */ public function getLatestRevisionId($entity_type_id, $entity_id) { if ($storage = $this->entityTypeManager->getStorage($entity_type_id)) { - $revision_ids = $storage->getQuery() - ->allRevisions() + $result = $storage->getQuery() + ->latestRevision() ->condition($this->entityTypeManager->getDefinition($entity_type_id)->getKey('id'), $entity_id) - ->sort($this->entityTypeManager->getDefinition($entity_type_id)->getKey('revision'), 'DESC') - ->range(0, 1) + // No access check is performed here since this is an API function and + // should return the same ID regardless of the current user. + ->accessCheck(FALSE) ->execute(); - if ($revision_ids) { - return array_keys($revision_ids)[0]; + if ($result) { + return key($result); } } } @@ -101,13 +102,15 @@ */ public function getDefaultRevisionId($entity_type_id, $entity_id) { if ($storage = $this->entityTypeManager->getStorage($entity_type_id)) { - $revision_ids = $storage->getQuery() + $result = $storage->getQuery() + ->currentRevision() ->condition($this->entityTypeManager->getDefinition($entity_type_id)->getKey('id'), $entity_id) - ->sort($this->entityTypeManager->getDefinition($entity_type_id)->getKey('revision'), 'DESC') - ->range(0, 1) + // No access check is performed here since this is an API function and + // should return the same ID regardless of the current user. + ->accessCheck(FALSE) ->execute(); - if ($revision_ids) { - return array_keys($revision_ids)[0]; + if ($result) { + return key($result); } } } diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php --- a/core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php Fri Feb 23 15:52:07 2018 +0000 @@ -153,7 +153,7 @@ // Change the entity's default revision flag and the publishing status only // if the new workflow state is a valid one. - if ($workflow->getTypePlugin()->hasState($moderation_state_id)) { + if ($workflow && $workflow->getTypePlugin()->hasState($moderation_state_id)) { /** @var \Drupal\content_moderation\ContentModerationState $current_state */ $current_state = $workflow->getTypePlugin()->getState($moderation_state_id); diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php --- a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -206,6 +206,7 @@ // Make a pending revision. $node->title = $this->randomMachineName(); $node->moderation_state->value = 'draft'; + $node->setRevisionCreationTime(12345); $node->save(); $another_user = $this->drupalCreateUser($this->permissions); @@ -217,6 +218,10 @@ $this->drupalGet(sprintf('node/%d/revisions', $node->id())); $this->assertText('by ' . $another_user->getAccountName()); + + // Verify the revision creation time has been updated. + $node = $node->load($node->id()); + $this->assertGreaterThan(12345, $node->getRevisionCreationTime()); } /** diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php --- a/core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -88,11 +88,11 @@ * @param string $machine_name * The machine name of the type to create. * - * @return NodeType + * @return \Drupal\node\Entity\NodeType * The node type just created. */ protected function createNodeType($label, $machine_name) { - /** @var NodeType $node_type */ + /** @var \Drupal\node\Entity\NodeType $node_type */ $node_type = NodeType::create([ 'type' => $machine_name, 'label' => $label, diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php --- a/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,6 +13,8 @@ /** * Profile to use. + * + * @var string */ protected $profile = 'testing'; diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php --- a/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,8 @@ namespace Drupal\Tests\content_moderation\Functional; +use Drupal\node\Entity\NodeType; + /** * Tests permission access control around nodes. * @@ -19,7 +21,7 @@ 'block', 'block_content', 'node', - 'node_access_test_empty', + 'node_access_test', ]; /** @@ -49,6 +51,9 @@ $this->createContentTypeFromUi('Moderated content', 'moderated_content', FALSE); $this->grantUserPermissionToCreateContentOfType($this->adminUser, 'moderated_content'); + // Add the private field to the node type. + node_access_test_add_field(NodeType::load('moderated_content')); + // Rebuild permissions because hook_node_grants() is implemented by the // node_access_test_empty module. node_access_rebuild(); @@ -58,6 +63,10 @@ * Verifies that a non-admin user can still access the appropriate pages. */ public function testPageAccess() { + // Initially disable access grant records in + // node_access_test_node_access_records(). + \Drupal::state()->set('node_access_test.private', TRUE); + $this->drupalLogin($this->adminUser); // Access the node form before moderation is enabled, the publication state @@ -149,6 +158,30 @@ $this->assertResponse(403); $this->drupalGet($view_path); $this->assertResponse(200); + + // Now create a private node that the user is not granted access to by the + // node grants, but is granted access via hook_node_access(). + // @see node_access_test_node_access + $node = $this->createNode([ + 'type' => 'moderated_content', + 'private' => TRUE, + 'uid' => $this->adminUser->id(), + ]); + $user = $this->createUser([ + 'use editorial transition publish', + ]); + $this->drupalLogin($user); + + // Grant access to the node via node_access_test_node_access(). + \Drupal::state()->set('node_access_test.allow_uid', $user->id()); + + $this->drupalGet($node->toUrl()); + $this->assertResponse(200); + + // Verify the moderation form is in place by publishing the node. + $this->drupalPostForm(NULL, [], t('Apply')); + $node = \Drupal::entityTypeManager()->getStorage('node')->loadUnchanged($node->id()); + $this->assertEquals('published', $node->moderation_state->value); } } diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php --- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -72,59 +72,12 @@ } /** - * Sets up a bundle entity type for the specified entity type, if needed. - * - * @param string $entity_type_id - * The entity type identifier. - * - * @return string - * The bundle identifier. - */ - protected function setupBundleEntityType($entity_type_id) { - $bundle_id = $entity_type_id; - $bundle_entity_type_id = $this->entityTypeManager->getDefinition($entity_type_id)->getBundleEntityType(); - if ($bundle_entity_type_id) { - $bundle_entity_type_definition = $this->entityTypeManager->getDefinition($bundle_entity_type_id); - $entity_type_storage = $this->entityTypeManager->getStorage($bundle_entity_type_id); - - $entity_type = $entity_type_storage->create([ - $bundle_entity_type_definition->getKey('id') => 'example', - ]); - if ($entity_type_id == 'media') { - $entity_type->set('source', 'test'); - $entity_type->save(); - $source_field = $entity_type->getSource()->createSourceField($entity_type); - $source_field->getFieldStorageDefinition()->save(); - $source_field->save(); - $entity_type->set('source_configuration', [ - 'source_field' => $source_field->getName(), - ]); - } - $entity_type->save(); - $bundle_id = $entity_type->id(); - } - - $workflow = Workflow::load('editorial'); - $workflow->getTypePlugin()->addEntityTypeAndBundle($entity_type_id, $bundle_id); - $workflow->save(); - - return $bundle_id; - } - - /** * Tests basic monolingual content moderation through the API. * * @dataProvider basicModerationTestCases */ public function testBasicModeration($entity_type_id) { - $bundle_id = $this->setupBundleEntityType($entity_type_id); - - /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - $entity_storage = $this->entityTypeManager->getStorage($entity_type_id); - $entity = $entity_storage->create([ - 'title' => 'Test title', - $this->entityTypeManager->getDefinition($entity_type_id)->getKey('bundle') => $bundle_id, - ]); + $entity = $this->createEntity($entity_type_id); if ($entity instanceof EntityPublishedInterface) { $entity->setUnpublished(); } @@ -175,6 +128,7 @@ $entity->save(); // Revert to the previous (published) revision. + $entity_storage = $this->entityTypeManager->getStorage($entity_type_id); $previous_revision = $entity_storage->loadRevision(4); $previous_revision->isDefaultRevision(TRUE); $previous_revision->setNewRevision(TRUE); @@ -225,15 +179,9 @@ * @dataProvider basicModerationTestCases */ public function testContentModerationStateDataRemoval($entity_type_id) { - $bundle_id = $this->setupBundleEntityType($entity_type_id); - // Test content moderation state deletion. - $entity_storage = $this->entityTypeManager->getStorage($entity_type_id); /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - $entity = $entity_storage->create([ - 'title' => 'Test title', - $this->entityTypeManager->getDefinition($entity_type_id)->getKey('bundle') => $bundle_id, - ]); + $entity = $this->createEntity($entity_type_id); $entity->save(); $entity = $this->reloadEntity($entity); $entity->delete(); @@ -242,10 +190,7 @@ // Test content moderation state revision deletion. /** @var \Drupal\Core\Entity\ContentEntityInterface $entity2 */ - $entity2 = $entity_storage->create([ - 'title' => 'Test title', - $this->entityTypeManager->getDefinition($entity_type_id)->getKey('bundle') => $bundle_id, - ]); + $entity2 = $this->createEntity($entity_type_id); $entity2->save(); $revision = clone $entity2; $revision->isDefaultRevision(FALSE); @@ -254,6 +199,7 @@ $entity2 = $this->reloadEntity($entity2); $entity2->setNewRevision(TRUE); $entity2->save(); + $entity_storage = $this->entityTypeManager->getStorage($entity_type_id); $entity_storage->deleteRevision($revision->getRevisionId()); $content_moderation_state = ContentModerationState::loadFromModeratedEntity($revision); $this->assertFalse($content_moderation_state); @@ -263,15 +209,16 @@ // Test content moderation state translation deletion. if ($this->entityTypeManager->getDefinition($entity_type_id)->isTranslatable()) { /** @var \Drupal\Core\Entity\ContentEntityInterface $entity3 */ - $entity3 = $entity_storage->create([ - 'title' => 'Test title', - $this->entityTypeManager->getDefinition($entity_type_id)->getKey('bundle') => $bundle_id, - ]); + $entity3 = $this->createEntity($entity_type_id); $langcode = 'it'; ConfigurableLanguage::createFromLangcode($langcode) ->save(); $entity3->save(); $translation = $entity3->addTranslation($langcode, ['title' => 'Titolo test']); + // Make sure we add values for all of the required fields. + if ($entity_type_id == 'block_content') { + $translation->info = $this->randomString(); + } $translation->save(); $content_moderation_state = ContentModerationState::loadFromModeratedEntity($entity3); $this->assertTrue($content_moderation_state->hasTranslation($langcode)); @@ -590,6 +537,63 @@ } /** + * Creates an entity. + * + * The entity will have required fields populated and the corresponding bundle + * will be enabled for content moderation. + * + * @param string $entity_type_id + * The entity type ID. + * + * @return \Drupal\Core\Entity\ContentEntityInterface + * The created entity. + */ + protected function createEntity($entity_type_id) { + $entity_type = $this->entityTypeManager->getDefinition($entity_type_id); + + $bundle_id = $entity_type_id; + // Set up a bundle entity type for the specified entity type, if needed. + if ($bundle_entity_type_id = $entity_type->getBundleEntityType()) { + $bundle_entity_type = $this->entityTypeManager->getDefinition($bundle_entity_type_id); + $bundle_entity_storage = $this->entityTypeManager->getStorage($bundle_entity_type_id); + + $bundle_id = 'example'; + if (!$bundle_entity_storage->load($bundle_id)) { + $bundle_entity = $bundle_entity_storage->create([ + $bundle_entity_type->getKey('id') => 'example', + ]); + if ($entity_type_id == 'media') { + $bundle_entity->set('source', 'test'); + $bundle_entity->save(); + $source_field = $bundle_entity->getSource()->createSourceField($bundle_entity); + $source_field->getFieldStorageDefinition()->save(); + $source_field->save(); + $bundle_entity->set('source_configuration', [ + 'source_field' => $source_field->getName(), + ]); + } + $bundle_entity->save(); + } + } + + $workflow = Workflow::load('editorial'); + $workflow->getTypePlugin()->addEntityTypeAndBundle($entity_type_id, $bundle_id); + $workflow->save(); + + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ + $entity_storage = $this->entityTypeManager->getStorage($entity_type_id); + $entity = $entity_storage->create([ + $entity_type->getKey('label') => 'Test title', + $entity_type->getKey('bundle') => $bundle_id, + ]); + // Make sure we add values for all of the required fields. + if ($entity_type_id == 'block_content') { + $entity->info = $this->randomString(); + } + return $entity; + } + + /** * Reloads the entity after clearing the static cache. * * @param \Drupal\Core\Entity\EntityInterface $entity diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php --- a/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -69,7 +69,7 @@ // Verify the entity saved correctly, and that the presence of pending // revisions doesn't affect the default node load. - /** @var Node $page */ + /** @var \Drupal\node\Entity\Node $page */ $page = Node::load($id); $this->assertEquals('A', $page->getTitle()); $this->assertTrue($page->isDefaultRevision()); @@ -142,7 +142,7 @@ $id = $page->id(); // Verify the entity saved correctly. - /** @var Node $page */ + /** @var \Drupal\node\Entity\Node $page */ $page = Node::load($id); $this->assertEquals('A', $page->getTitle()); $this->assertTrue($page->isDefaultRevision()); diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,64 @@ +installEntitySchema('entity_test_rev'); + $this->installEntitySchema('content_moderation_state'); + $this->installConfig(['content_moderation']); + } + + /** + * @covers ::getDefaultRevisionId + * @covers ::getLatestRevisionId + */ + public function testDefaultAndLatestRevisionId() { + $workflow = Workflow::load('editorial'); + $workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev'); + $workflow->save(); + + $entity_test_rev = EntityTestRev::create([ + 'name' => 'Default Revision', + 'moderation_state' => 'published', + ]); + $entity_test_rev->save(); + + $entity_test_rev->name = 'Pending revision'; + $entity_test_rev->moderation_state = 'draft'; + $entity_test_rev->save(); + + /** @var \Drupal\content_moderation\ModerationInformationInterface $moderation_info */ + $moderation_info = \Drupal::service('content_moderation.moderation_information'); + + // Check that moderation information service returns the correct default + // revision ID. + $default_revision_id = $moderation_info->getDefaultRevisionId('entity_test_rev', $entity_test_rev->id()); + $this->assertSame(1, $default_revision_id); + + // Check that moderation information service returns the correct latest + // revision ID. + $latest_revision_id = $moderation_info->getLatestRevisionId('entity_test_rev', $entity_test_rev->id()); + $this->assertSame(2, $latest_revision_id); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php --- a/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -99,4 +99,29 @@ $this->assertFalse($this->testNode->isDefaultRevision()); } + /** + * Test updating the state for an entity without a workflow. + */ + public function testEntityWithNoWorkflow() { + $node_type = NodeType::create([ + 'type' => 'example_no_workflow', + ]); + $node_type->save(); + $test_node = Node::create([ + 'type' => 'example_no_workflow', + 'title' => 'Test node with no workflow', + ]); + $test_node->save(); + + /** @var \Drupal\content_moderation\ModerationInformationInterface $content_moderation_info */ + $content_moderation_info = \Drupal::service('content_moderation.moderation_information'); + $workflow = $content_moderation_info->getWorkflowForEntity($test_node); + $this->assertNull($workflow); + + $this->assertTrue($test_node->isPublished()); + $test_node->moderation_state->setValue('draft'); + // The entity is still published because there is not a workflow. + $this->assertTrue($test_node->isPublished()); + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,88 @@ +installEntitySchema('content_moderation_state'); + $this->installEntitySchema('node'); + $this->installEntitySchema('user'); + $this->installEntitySchema('workflow'); + $this->installConfig(['content_moderation', 'filter']); + $this->installSchema('system', ['sequences']); + $this->installSchema('node', ['node_access']); + + // Add a moderated node type. + $node_type = NodeType::create([ + 'type' => 'page', + 'label' => 'Page', + ]); + $node_type->save(); + $workflow = Workflow::load('editorial'); + $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'page'); + $workflow->save(); + + $this->moderationInformation = \Drupal::service('content_moderation.moderation_information'); + } + + /** + * Tests for moderation information methods with node access. + */ + public function testModerationInformation() { + // Create an admin user. + $user = $this->createUser([], NULL, TRUE); + \Drupal::currentUser()->setAccount($user); + + // Create a node. + $node = $this->createNode(['type' => 'page']); + $this->assertEquals($node->getRevisionId(), $this->moderationInformation->getDefaultRevisionId('node', $node->id())); + $this->assertEquals($node->getRevisionId(), $this->moderationInformation->getLatestRevisionId('node', $node->id())); + + // Create a non-admin user. + $user = $this->createUser(); + \Drupal::currentUser()->setAccount($user); + $this->assertEquals($node->getRevisionId(), $this->moderationInformation->getDefaultRevisionId('node', $node->id())); + $this->assertEquals($node->getRevisionId(), $this->moderationInformation->getLatestRevisionId('node', $node->id())); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php --- a/core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -22,7 +22,7 @@ /** * Builds a mock user. * - * @return AccountInterface + * @return \Drupal\Core\Session\AccountInterface * The mocked user. */ protected function getUser() { @@ -32,7 +32,7 @@ /** * Returns a mock Entity Type Manager. * - * @return EntityTypeManagerInterface + * @return \Drupal\Core\Entity\EntityTypeManagerInterface * The mocked entity type manager. */ protected function getEntityTypeManager() { diff -r bfffd8d7479a -r 7a779792577d core/modules/content_translation/migration_templates/d6_taxonomy_term_translation.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/content_translation/migration_templates/d6_taxonomy_term_translation.yml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,39 @@ +id: d6_taxonomy_term_translation +label: Taxonomy terms +migration_tags: + - Drupal 6 +source: + plugin: d6_taxonomy_term + translations: true +process: + # If you are using this file to build a custom migration consider removing + # the tid field to allow incremental migrations. + tid: tid + langcode: language + vid: + plugin: migration + migration: d6_taxonomy_vocabulary + source: vid + name: name + description: description + weight: weight + # Only attempt to stub real (non-zero) parents. + parent_id: + - + plugin: skip_on_empty + method: process + source: parent + - + plugin: migration + migration: d6_taxonomy_term + parent: + plugin: default_value + default_value: 0 + source: '@parent_id' + changed: timestamp +destination: + plugin: entity:taxonomy_term +migration_dependencies: + required: + - d6_taxonomy_vocabulary + - d6_taxonomy_term diff -r bfffd8d7479a -r 7a779792577d core/modules/content_translation/src/ContentTranslationMetadataWrapper.php --- a/core/modules/content_translation/src/ContentTranslationMetadataWrapper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/content_translation/src/ContentTranslationMetadataWrapper.php Fri Feb 23 15:52:07 2018 +0000 @@ -27,7 +27,7 @@ /** * Initializes an instance of the content translation metadata handler. * - * @param EntityInterface $translation + * @param \Drupal\Core\Entity\EntityInterface $translation * The entity translation to be wrapped. * @param ContentTranslationHandlerInterface $handler * The content translation handler. diff -r bfffd8d7479a -r 7a779792577d core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,125 @@ +installEntitySchema('taxonomy_term'); + $this->installConfig(static::$modules); + $this->executeMigrations([ + 'd6_node_type', + 'd6_field', + 'd6_taxonomy_vocabulary', + 'd6_field_instance', + 'd6_taxonomy_term', + 'd6_taxonomy_term_translation', + ]); + } + + /** + * Validate a migrated term contains the expected values. + * + * @param int $id + * Entity ID to load and check. + * @param string $expected_language + * The language code for this term. + * @param string $expected_label + * The label the migrated entity should have. + * @param string $expected_vid + * The parent vocabulary the migrated entity should have. + * @param string $expected_description + * The description the migrated entity should have. + * @param string $expected_format + * The format the migrated entity should have. + * @param int $expected_weight + * The weight the migrated entity should have. + * @param array $expected_parents + * The parent terms the migrated entity should have. + * @param int $expected_field_integer_value + * The value the migrated entity field should have. + * @param int $expected_term_reference_tid + * The term reference ID the migrated entity field should have. + */ + protected function assertEntity($id, $expected_language, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, $expected_parents = [], $expected_field_integer_value = NULL, $expected_term_reference_tid = NULL) { + /** @var \Drupal\taxonomy\TermInterface $entity */ + $entity = Term::load($id); + $this->assertInstanceOf(TermInterface::class, $entity); + $this->assertSame($expected_language, $entity->language()->getId()); + $this->assertSame($expected_label, $entity->label()); + $this->assertSame($expected_vid, $entity->getVocabularyId()); + $this->assertSame($expected_description, $entity->getDescription()); + $this->assertSame($expected_format, $entity->getFormat()); + $this->assertSame($expected_weight, $entity->getWeight()); + $this->assertHierarchy($expected_vid, $id, $expected_parents); + } + + /** + * Assert that a term is present in the tree storage, with the right parents. + * + * @param string $vid + * Vocabulary ID. + * @param int $tid + * ID of the term to check. + * @param array $parent_ids + * The expected parent term IDs. + */ + protected function assertHierarchy($vid, $tid, array $parent_ids) { + if (!isset($this->treeData[$vid])) { + $tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid); + $this->treeData[$vid] = []; + foreach ($tree as $item) { + $this->treeData[$vid][$item->tid] = $item; + } + } + + $this->assertArrayHasKey($tid, $this->treeData[$vid], "Term $tid exists in taxonomy tree"); + $term = $this->treeData[$vid][$tid]; + $this->assertEquals($parent_ids, array_filter($term->parents), "Term $tid has correct parents in taxonomy tree"); + } + + /** + * Tests the Drupal 6 i18n taxonomy term to Drupal 8 migration. + */ + public function testTranslatedTaxonomyTerms() { + $this->assertEntity(1, 'zu', 'zu - term 1 of vocabulary 1', 'vocabulary_1_i_0_', 'zu - description of term 1 of vocabulary 1', NULL, '0', []); + $this->assertEntity(2, 'fr', 'fr - term 2 of vocabulary 2', 'vocabulary_2_i_1_', 'fr - description of term 2 of vocabulary 2', NULL, '3', []); + $this->assertEntity(3, 'fr', 'fr - term 3 of vocabulary 2', 'vocabulary_2_i_1_', 'fr - description of term 3 of vocabulary 2', NULL, '4', ['2']); + $this->assertEntity(4, 'en', 'term 4 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 4 of vocabulary 3', NULL, '6', []); + $this->assertEntity(5, 'en', 'term 5 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 5 of vocabulary 3', NULL, '7', ['4']); + $this->assertEntity(6, 'en', 'term 6 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 6 of vocabulary 3', NULL, '8', ['4', '5']); + $this->assertEntity(7, 'fr', 'fr - term 2 of vocabulary 1', 'vocabulary_1_i_0_', 'fr - desc of term 2 vocab 1', NULL, '0', []); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/datetime/src/Plugin/migrate/field/DateField.php --- a/core/modules/datetime/src/Plugin/migrate/field/DateField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/datetime/src/Plugin/migrate/field/DateField.php Fri Feb 23 15:52:07 2018 +0000 @@ -60,7 +60,7 @@ ]; $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => $process, ]; diff -r bfffd8d7479a -r 7a779792577d core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php --- a/core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php Fri Feb 23 15:52:07 2018 +0000 @@ -65,7 +65,7 @@ ]; $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => $process, ]; diff -r bfffd8d7479a -r 7a779792577d core/modules/datetime/src/Plugin/views/filter/Date.php --- a/core/modules/datetime/src/Plugin/views/filter/Date.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/datetime/src/Plugin/views/filter/Date.php Fri Feb 23 15:52:07 2018 +0000 @@ -96,7 +96,6 @@ // Formatting will vary on date storage. - // Convert to ISO format and format for query. UTC timezone is used since // dates are stored in UTC. $a = $this->query->getDateFormat("'" . $this->dateFormatter->format($a, 'custom', DATETIME_DATETIME_STORAGE_FORMAT, DATETIME_STORAGE_TIMEZONE) . "'", $this->dateFormat, TRUE); diff -r bfffd8d7479a -r 7a779792577d core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php --- a/core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,6 +24,8 @@ /** * Use a non-UTC timezone. + * + * @var string */ protected static $timezone = 'America/Vancouver'; diff -r bfffd8d7479a -r 7a779792577d core/modules/dblog/src/Plugin/views/wizard/Watchdog.php --- a/core/modules/dblog/src/Plugin/views/wizard/Watchdog.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/dblog/src/Plugin/views/wizard/Watchdog.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,6 +18,8 @@ /** * Set the created column. + * + * @var string */ protected $createdColumn = 'timestamp'; diff -r bfffd8d7479a -r 7a779792577d core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php --- a/core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -enableService('dblog'); - } - - /** - * Writes a log messages and retrieves it via the REST API. - */ - public function testWatchdog() { - // Write a log message to the DB. - $this->container->get('logger.channel.rest')->notice('Test message'); - // Get the ID of the written message. - $id = db_query_range("SELECT wid FROM {watchdog} WHERE type = :type ORDER BY wid DESC", 0, 1, [':type' => 'rest']) - ->fetchField(); - - // Create a user account that has the required permissions to read - // the watchdog resource via the REST API. - $account = $this->drupalCreateUser(['restful get dblog']); - $this->drupalLogin($account); - - $response = $this->httpRequest(Url::fromRoute('rest.dblog.GET.' . $this->defaultFormat, ['id' => $id, '_format' => $this->defaultFormat]), 'GET'); - $this->assertResponse(200); - $this->assertHeader('content-type', $this->defaultMimeType); - $log = Json::decode($response); - $this->assertEqual($log['wid'], $id, 'Log ID is correct.'); - $this->assertEqual($log['type'], 'rest', 'Type of log message is correct.'); - $this->assertEqual($log['message'], 'Test message', 'Log message text is correct.'); - - // Request an unknown log entry. - $response = $this->httpRequest(Url::fromRoute('rest.dblog.GET.' . $this->defaultFormat, ['id' => 9999, '_format' => $this->defaultFormat]), 'GET'); - $this->assertResponse(404); - $decoded = Json::decode($response); - $this->assertEqual($decoded['message'], 'Log entry with ID 9999 was not found', 'Response message is correct.'); - - // Make a bad request (a true malformed request would never be a route match). - $response = $this->httpRequest(Url::fromRoute('rest.dblog.GET.' . $this->defaultFormat, ['id' => 0, '_format' => $this->defaultFormat]), 'GET'); - $this->assertResponse(400); - $decoded = Json::decode($response); - $this->assertEqual($decoded['message'], 'No log entry ID was provided', 'Response message is correct.'); - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/dblog/tests/src/Functional/DbLogResourceTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/dblog/tests/src/Functional/DbLogResourceTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,127 @@ +provisionResource([static::$format], $auth); + } + + /** + * Writes a log messages and retrieves it via the REST API. + */ + public function testWatchdog() { + // Write a log message to the DB. + $this->container->get('logger.channel.rest')->notice('Test message'); + // Get the ID of the written message. + $id = db_query_range("SELECT wid FROM {watchdog} WHERE type = :type ORDER BY wid DESC", 0, 1, [':type' => 'rest']) + ->fetchField(); + + $this->initAuthentication(); + $url = Url::fromRoute('rest.dblog.GET.' . static::$format, ['id' => $id, '_format' => static::$format]); + $request_options = $this->getAuthenticationRequestOptions('GET'); + + $response = $this->request('GET', $url, $request_options); + $this->assertResourceErrorResponse(403, "The 'restful get dblog' permission is required.", $response); + + // Create a user account that has the required permissions to read + // the watchdog resource via the REST API. + $this->setUpAuthorization('GET'); + + $response = $this->request('GET', $url, $request_options); + $this->assertResourceResponse(200, FALSE, $response, ['config:rest.resource.dblog', 'config:rest.settings', 'http_response'], ['user.permissions'], FALSE, 'MISS'); + $log = Json::decode((string) $response->getBody()); + $this->assertEqual($log['wid'], $id, 'Log ID is correct.'); + $this->assertEqual($log['type'], 'rest', 'Type of log message is correct.'); + $this->assertEqual($log['message'], 'Test message', 'Log message text is correct.'); + + // Request an unknown log entry. + $url->setRouteParameter('id', 9999); + $response = $this->request('GET', $url, $request_options); + $this->assertResourceErrorResponse(404, 'Log entry with ID 9999 was not found', $response); + + // Make a bad request (a true malformed request would never be a route match). + $url->setRouteParameter('id', 0); + $response = $this->request('GET', $url, $request_options); + $this->assertResourceErrorResponse(400, 'No log entry ID was provided', $response); + } + + /** + * {@inheritdoc} + */ + protected function setUpAuthorization($method) { + switch ($method) { + case 'GET': + $this->grantPermissionsToTestedRole(['restful get dblog']); + break; + + default: + throw new \UnexpectedValueException(); + } + } + + /** + * {@inheritdoc} + */ + protected function assertNormalizationEdgeCases($method, Url $url, array $request_options) {} + + /** + * {@inheritdoc} + */ + protected function getExpectedUnauthorizedAccessMessage($method) {} + + /** + * {@inheritdoc} + */ + protected function getExpectedBcUnauthorizedAccessMessage($method) {} + + /** + * {@inheritdoc} + */ + protected function getExpectedUnauthorizedAccessCacheability() {} + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/editor/editor.module --- a/core/modules/editor/editor.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/editor/editor.module Fri Feb 23 15:52:07 2018 +0000 @@ -434,7 +434,7 @@ * * @param array $uuids * An array of file entity UUIDs. - * @param EntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * An entity whose fields to inspect for file references. */ function _editor_record_file_usage(array $uuids, EntityInterface $entity) { @@ -454,7 +454,7 @@ * * @param array $uuids * An array of file entity UUIDs. - * @param EntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * An entity whose fields to inspect for file references. * @param $count * The number of references to delete. Should be 1 when deleting a single @@ -545,7 +545,7 @@ /** * Finds all files referenced (data-entity-uuid) by formatted text fields. * - * @param EntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * An entity whose fields to analyze. * * @return array diff -r bfffd8d7479a -r 7a779792577d core/modules/editor/src/Tests/EditorSecurityTest.php --- a/core/modules/editor/src/Tests/EditorSecurityTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/editor/src/Tests/EditorSecurityTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -158,7 +158,6 @@ ]); $editor->save(); - // Create node type. $this->drupalCreateContentType([ 'type' => 'article', diff -r bfffd8d7479a -r 7a779792577d core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php --- a/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -46,7 +46,6 @@ $this->assertTrue($editor_full_html->get('status')); $this->assertNotIdentical($format_full_html->get('status'), $editor_full_html->get('status')); - // Run updates. $this->runUpdates(); diff -r bfffd8d7479a -r 7a779792577d core/modules/field/field.api.php --- a/core/modules/field/field.api.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/field.api.php Fri Feb 23 15:52:07 2018 +0000 @@ -138,7 +138,8 @@ * Alter forms for field widgets provided by other modules. * * @param $element - * The field widget form element as constructed by hook_field_widget_form(). + * The field widget form element as constructed by + * \Drupal\Core\Field\WidgetBaseInterface::form(). * @param $form_state * The current state of the form. * @param $context @@ -152,6 +153,7 @@ * - default: A boolean indicating whether the form is being shown as a dummy * form to set default values. * + * @see \Drupal\Core\Field\WidgetBaseInterface::form() * @see \Drupal\Core\Field\WidgetBase::formSingleElement() * @see hook_field_widget_WIDGET_TYPE_form_alter() */ @@ -172,13 +174,15 @@ * checking the widget type. * * @param $element - * The field widget form element as constructed by hook_field_widget_form(). + * The field widget form element as constructed by + * \Drupal\Core\Field\WidgetBaseInterface::form(). * @param $form_state * The current state of the form. * @param $context * An associative array. See hook_field_widget_form_alter() for the structure * and content of the array. * + * @see \Drupal\Core\Field\WidgetBaseInterface::form() * @see \Drupal\Core\Field\WidgetBase::formSingleElement() * @see hook_field_widget_form_alter() */ diff -r bfffd8d7479a -r 7a779792577d core/modules/field/field.module --- a/core/modules/field/field.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/field.module Fri Feb 23 15:52:07 2018 +0000 @@ -250,19 +250,6 @@ unset($handler_settings['target_bundles'][$bundle]); $field_config->setSetting('handler_settings', $handler_settings); $field_config->save(); - - // In case we deleted the only target bundle allowed by the field we - // have to log a critical message because the field will not function - // correctly anymore. - if ($handler_settings['target_bundles'] === []) { - \Drupal::logger('entity_reference')->critical('The %target_bundle bundle (entity type: %target_entity_type) was deleted. As a result, the %field_name entity reference field (entity_type: %entity_type, bundle: %bundle) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted.', [ - '%target_bundle' => $bundle, - '%target_entity_type' => $entity_type_id, - '%field_name' => $field_config->getName(), - '%entity_type' => $field_config->getTargetEntityTypeId(), - '%bundle' => $field_config->getTargetBundle() - ]); - } } } } @@ -407,4 +394,17 @@ $selection_manager = \Drupal::service('plugin.manager.entity_reference_selection'); list($current_handler) = explode(':', $field->getSetting('handler'), 2); $field->setSetting('handler', $selection_manager->getPluginId($target_type, $current_handler)); + + // In case we removed all the target bundles allowed by the field in + // EntityReferenceItem::onDependencyRemoval() or field_entity_bundle_delete() + // we have to log a critical message because the field will not function + // correctly anymore. + $handler_settings = $field->getSetting('handler_settings'); + if (isset($handler_settings['target_bundles']) && $handler_settings['target_bundles'] === []) { + \Drupal::logger('entity_reference')->critical('The %field_name entity reference field (entity_type: %entity_type, bundle: %bundle) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted.', [ + '%field_name' => $field->getName(), + '%entity_type' => $field->getTargetEntityTypeId(), + '%bundle' => $field->getTargetBundle(), + ]); + } } diff -r bfffd8d7479a -r 7a779792577d core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php --- a/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,6 +26,16 @@ } break; + case 'date': + case 'datetime': + case 'datestamp': + if ($value['granularity']['hour'] === 0 + && $value['granularity']['minute'] === 0 + && $value['granularity']['second'] === 0) { + $value['datetime_type'] = 'date'; + } + break; + case 'taxonomy_term_reference': $value['target_type'] = 'taxonomy_term'; break; diff -r bfffd8d7479a -r 7a779792577d core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php --- a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php Fri Feb 23 15:52:07 2018 +0000 @@ -145,7 +145,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return $this->initializeIterator()->count(); } diff -r bfffd8d7479a -r 7a779792577d core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -330,6 +330,12 @@ $this->drupalPostForm(NULL, $edit, t('Save field settings')); $this->drupalGet($bundle_path . '/fields/' . $field_path); $term_name = $this->randomString(); + $result = \Drupal::entityQuery('taxonomy_term') + ->condition('name', $term_name) + ->condition('vid', 'tags') + ->accessCheck(FALSE) + ->execute(); + $this->assertIdentical(0, count($result), "No taxonomy terms exist with the name '$term_name'."); $edit = [ // This must be set before new entities will be auto-created. 'settings[handler_settings][auto_create]' => 1, @@ -342,8 +348,12 @@ ]; $this->drupalPostForm(NULL, $edit, t('Save settings')); // The term should now exist. - $term = taxonomy_term_load_multiple_by_name($term_name, 'tags')[1]; - $this->assertIdentical(1, count($term), 'Taxonomy term was auto created when set as field default.'); + $result = \Drupal::entityQuery('taxonomy_term') + ->condition('name', $term_name) + ->condition('vid', 'tags') + ->accessCheck(FALSE) + ->execute(); + $this->assertIdentical(1, count($result), 'Taxonomy term was auto created when set as field default.'); } /** diff -r bfffd8d7479a -r 7a779792577d core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -77,7 +77,6 @@ ], ])->save(); - // Create a file field. $file_field_name = 'file_field'; $field_storage = FieldStorageConfig::create([ diff -r bfffd8d7479a -r 7a779792577d core/modules/field/src/Tests/FieldTestBase.php --- a/core/modules/field/src/Tests/FieldTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/src/Tests/FieldTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,7 +36,7 @@ * * This function only checks a single column in the field values. * - * @param EntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * The entity to test. * @param $field_name * The name of the field to test diff -r bfffd8d7479a -r 7a779792577d core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php --- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -197,9 +197,10 @@ * An array of entity objects. */ protected function getTestEntities() { - $config_entity_1 = entity_create('config_test', ['id' => $this->randomMachineName(), 'label' => $this->randomMachineName()]); + $storage = \Drupal::entityTypeManager()->getStorage('config_test'); + $config_entity_1 = $storage->create(['id' => $this->randomMachineName(), 'label' => $this->randomMachineName()]); $config_entity_1->save(); - $config_entity_2 = entity_create('config_test', ['id' => $this->randomMachineName(), 'label' => $this->randomMachineName()]); + $config_entity_2 = $storage->create(['id' => $this->randomMachineName(), 'label' => $this->randomMachineName()]); $config_entity_2->save(); $content_entity_1 = EntityTest::create(['name' => $this->randomMachineName()]); diff -r bfffd8d7479a -r 7a779792577d core/modules/field/tests/src/Functional/FieldTestBase.php --- a/core/modules/field/tests/src/Functional/FieldTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/tests/src/Functional/FieldTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,7 +33,7 @@ * * This function only checks a single column in the field values. * - * @param EntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * The entity to test. * @param $field_name * The name of the field to test diff -r bfffd8d7479a -r 7a779792577d core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php --- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,11 +3,14 @@ namespace Drupal\Tests\field\Kernel\EntityReference; use Drupal\Component\Utility\Unicode; +use Drupal\Core\DependencyInjection\ContainerBuilder; +use Drupal\Core\Logger\RfcLogLevel; use Drupal\field\Entity\FieldConfig; use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait; use Drupal\node\Entity\NodeType; use Drupal\KernelTests\KernelTestBase; use Drupal\taxonomy\Entity\Vocabulary; +use Symfony\Component\Debug\BufferingLogger; /** * Tests entity reference field settings. @@ -45,6 +48,13 @@ protected $customBundle; /** + * The service name for a logger implementation that collects anything logged. + * + * @var string + */ + protected $testLogServiceName = 'entity_reference_settings_test.logger'; + + /** * {@inheritdoc} */ protected function setUp() { @@ -60,26 +70,38 @@ ]); $this->nodeType->save(); - $this->vocabulary = Vocabulary::create([ - 'vid' => Unicode::strtolower($this->randomMachineName()), - 'name' => $this->randomString(), - ]); - $this->vocabulary->save(); - // Create a custom bundle. $this->customBundle = 'test_bundle_' . Unicode::strtolower($this->randomMachineName()); entity_test_create_bundle($this->customBundle, NULL, 'entity_test'); + + // Prepare the logger for collecting the expected critical error. + $this->container->get($this->testLogServiceName)->cleanLogs(); } /** * Tests that config bundle deletions are mirrored in field config settings. */ public function testConfigTargetBundleDeletion() { + // Create two vocabularies. + /** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */ + $vocabularies = []; + for ($i = 0; $i < 2; $i++) { + $vid = Unicode::strtolower($this->randomMachineName()); + $vocabularies[$i] = Vocabulary::create([ + 'name' => $this->randomString(), + 'vid' => $vid, + ]); + $vocabularies[$i]->save(); + } // Attach an entity reference field to $this->nodeType. $name = Unicode::strtolower($this->randomMachineName()); $label = $this->randomString(); - $vid = $this->vocabulary->id(); - $handler_settings = ['target_bundles' => [$vid => $vid]]; + $handler_settings = [ + 'target_bundles' => [ + $vocabularies[0]->id() => $vocabularies[0]->id(), + $vocabularies[1]->id() => $vocabularies[1]->id(), + ], + ]; $this->createEntityReferenceField('node', $this->nodeType->id(), $name, $label, 'taxonomy_term', 'default', $handler_settings); // Check that the 'target_bundle' setting contains the vocabulary. @@ -88,13 +110,32 @@ $this->assertEqual($handler_settings, $actual_handler_settings); // Delete the vocabulary. - $this->vocabulary->delete(); + $vocabularies[0]->delete(); + // Ensure that noting is logged. + $this->assertEmpty($this->container->get($this->testLogServiceName)->cleanLogs()); // Check that the deleted vocabulary is no longer present in the // 'target_bundles' field setting. $field_config = FieldConfig::loadByName('node', $this->nodeType->id(), $name); $handler_settings = $field_config->getSetting('handler_settings'); - $this->assertTrue(empty($handler_settings['target_bundles'])); + $this->assertEquals([$vocabularies[1]->id() => $vocabularies[1]->id()], $handler_settings['target_bundles']); + + // Delete the other vocabulary. + $vocabularies[1]->delete(); + // Ensure that field_field_config_presave() logs the expected critical + // error. + $log_message = $this->container->get($this->testLogServiceName)->cleanLogs()[0]; + $this->assertEquals(RfcLogLevel::CRITICAL, $log_message[0]); + $this->assertEquals('The %field_name entity reference field (entity_type: %entity_type, bundle: %bundle) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted.', $log_message[1]); + $this->assertEquals($field_config->getName(), $log_message[2]['%field_name']); + $this->assertEquals('node', $log_message[2]['%entity_type']); + $this->assertEquals($this->nodeType->id(), $log_message[2]['%bundle']); + + // Check that the deleted bundle is no longer present in the + // 'target_bundles' field setting. + $field_config = FieldConfig::loadByName('node', $this->nodeType->id(), $name); + $handler_settings = $field_config->getSetting('handler_settings'); + $this->assertEquals([], $handler_settings['target_bundles']); } /** @@ -115,6 +156,15 @@ // Delete the custom bundle. entity_test_delete_bundle($this->customBundle, 'entity_test'); + // Ensure that field_field_config_presave() logs the expected critical + // error. + $log_message = $this->container->get($this->testLogServiceName)->cleanLogs()[0]; + $this->assertEquals(RfcLogLevel::CRITICAL, $log_message[0]); + $this->assertEquals('The %field_name entity reference field (entity_type: %entity_type, bundle: %bundle) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted.', $log_message[1]); + $this->assertEquals($field_config->getName(), $log_message[2]['%field_name']); + $this->assertEquals('node', $log_message[2]['%entity_type']); + $this->assertEquals($this->nodeType->id(), $log_message[2]['%bundle']); + // Check that the deleted bundle is no longer present in the // 'target_bundles' field setting. $field_config = FieldConfig::loadByName('node', $this->nodeType->id(), $name); @@ -122,4 +172,14 @@ $this->assertTrue(empty($handler_settings['target_bundles'])); } + /** + * {@inheritdoc} + */ + public function register(ContainerBuilder $container) { + parent::register($container); + $container + ->register($this->testLogServiceName, BufferingLogger::class) + ->addTag('logger'); + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php --- a/core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,7 +2,13 @@ namespace Drupal\Tests\field\Kernel; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; +use Drupal\Component\Plugin\Exception\PluginNotFoundException; +use Drupal\Component\Utility\NestedArray; +use Drupal\Core\Entity\ContentEntityTypeInterface; +use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Extension\Extension; +use Drupal\Core\Field\BaseFieldDefinition; use Drupal\KernelTests\KernelTestBase; /** @@ -21,22 +27,13 @@ * Tests the integrity of field plugin definitions. */ public function testFieldPluginDefinitionIntegrity() { - - // Enable all core modules that provide field plugins. - $modules = system_rebuild_module_data(); - $modules = array_filter($modules, function (Extension $module) { - // Filter contrib, hidden, already enabled modules and modules in the - // Testing package. - if ($module->origin === 'core' - && empty($module->info['hidden']) - && $module->status == FALSE - && $module->info['package'] !== 'Testing' - && is_readable($module->getPath() . '/src/Plugin/Field')) { - return TRUE; - } - return FALSE; - }); - $this->enableModules(array_keys($modules)); + // Enable all core modules that provide field plugins, and their + // dependencies. + $this->enableModules( + $this->modulesWithSubdirectory( + 'src' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Field' + ) + ); /** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */ $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); @@ -108,7 +105,114 @@ else { $this->pass(sprintf('Field formatter %s integrates with existing field types.', $definition['id'])); } + } } + /** + * Tests to load field plugin definitions used in core's existing entities. + */ + public function testFieldPluginDefinitionAvailability() { + $this->enableModules( + $this->modulesWithSubdirectory('src' . DIRECTORY_SEPARATOR . 'Entity') + ); + + /** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */ + $field_formatter_manager = $this->container->get('plugin.manager.field.formatter'); + + /** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */ + $field_widget_manager = $this->container->get('plugin.manager.field.widget'); + + /** @var \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager */ + $entity_field_manager = $this->container->get('entity_field.manager'); + + /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */ + $entity_type_manager = $this->container->get('entity_type.manager'); + + /** @var \Drupal\Core\Field\BaseFieldDefinition[][] $field_definitions */ + $field_definitions = []; + + /** @var \Drupal\Core\Entity\EntityTypeInterface[] $content_entity_types */ + $content_entity_types = array_filter($entity_type_manager->getDefinitions(), function (EntityTypeInterface $entity_type) { + return $entity_type instanceof ContentEntityTypeInterface; + }); + + foreach ($content_entity_types as $entity_type_id => $entity_type_definition) { + $field_definitions[$entity_type_id] = $entity_field_manager->getBaseFieldDefinitions($entity_type_id); + } + + foreach ($field_definitions as $entity_type_id => $definitions) { + foreach ($definitions as $field_id => $field_definition) { + $this->checkDisplayOption($entity_type_id, $field_id, $field_definition, $field_formatter_manager, 'view'); + $this->checkDisplayOption($entity_type_id, $field_id, $field_definition, $field_widget_manager, 'form'); + } + } + } + + /** + * Helper method that tries to load plugin definitions. + * + * @param string $entity_type_id + * Id of entity type. Required by message. + * @param string $field_id + * Id of field. Required by message. + * @param \Drupal\Core\Field\BaseFieldDefinition $field_definition + * Field definition that provide display options. + * @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $plugin_manager + * Plugin manager that will try to provide plugin definition. + * @param string $display_context + * Defines which display options should be loaded. + */ + protected function checkDisplayOption($entity_type_id, $field_id, BaseFieldDefinition $field_definition, DiscoveryInterface $plugin_manager, $display_context) { + $display_options = $field_definition->getDisplayOptions($display_context); + if (!empty($display_options['type'])) { + try { + $plugin_manager->getDefinition($display_options['type']); + } + catch (PluginNotFoundException $e) { + $this->fail(sprintf( + 'PluginNotFoundException here for "%s" field %s display options of "%s" entity type. Original message: %s', + $field_id, + $display_context, + $entity_type_id, + $e->getMessage() + )); + } + } + } + + /** + * Find modules with a specified subdirectory. + * + * @param string $subdirectory + * The required path, relative to the module directory. + * + * @return string[] + * A list of module names satisfying these criteria: + * - provided by core + * - not hidden + * - not already enabled + * - not in the Testing package + * - containing the required $subdirectory + * and all modules required by any of these modules. + */ + protected function modulesWithSubdirectory($subdirectory) { + $modules = system_rebuild_module_data(); + $modules = array_filter($modules, function (Extension $module) use ($subdirectory) { + // Filter contrib, hidden, already enabled modules and modules in the + // Testing package. + return ($module->origin === 'core' + && empty($module->info['hidden']) + && $module->status == FALSE + && $module->info['package'] !== 'Testing' + && is_readable($module->getPath() . DIRECTORY_SEPARATOR . $subdirectory)); + }); + // Gather the dependencies of the modules. + $dependencies = NestedArray::mergeDeepArray(array_map(function (Extension $module) { + return array_keys($module->requires); + }, $modules)); + + return array_unique(NestedArray::mergeDeep(array_keys($modules), $dependencies)); + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/field/tests/src/Kernel/FieldKernelTestBase.php --- a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -172,7 +172,7 @@ * * This function only checks a single column in the field values. * - * @param EntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * The entity to test. * @param $field_name * The name of the field to test diff -r bfffd8d7479a -r 7a779792577d core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -128,7 +128,6 @@ $this->assertEntity('comment.comment_node_test_content_type.field_integer', 'Integer', 'integer', FALSE, FALSE); $this->assertEntity('user.user.field_file', 'File', 'file', FALSE, FALSE); - $this->assertLinkFields('node.test_content_type.field_link', DRUPAL_OPTIONAL); $this->assertLinkFields('node.article.field_link', DRUPAL_DISABLED); $this->assertLinkFields('node.blog.field_link', DRUPAL_REQUIRED); diff -r bfffd8d7479a -r 7a779792577d core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -101,6 +101,8 @@ $this->assertEntity('node.field_node_entityreference', 'entity_reference', TRUE, -1); $this->assertEntity('node.field_user_entityreference', 'entity_reference', TRUE, 1); $this->assertEntity('node.field_term_entityreference', 'entity_reference', TRUE, -1); + $this->assertEntity('node.field_date_without_time', 'datetime', TRUE, 1); + $this->assertEntity('node.field_datetime_without_time', 'datetime', TRUE, 1); // Assert that the taxonomy term reference fields are referencing the // correct entity type. @@ -117,6 +119,18 @@ $this->assertEquals('user', $field->getSetting('target_type')); $field = FieldStorageConfig::load('node.field_term_entityreference'); $this->assertEquals('taxonomy_term', $field->getSetting('target_type')); + + // Make sure that datetime fields get the right datetime_type setting + $field = FieldStorageConfig::load('node.field_date'); + $this->assertEquals('datetime', $field->getSetting('datetime_type')); + $field = FieldStorageConfig::load('node.field_date_without_time'); + $this->assertEquals('date', $field->getSetting('datetime_type')); + $field = FieldStorageConfig::load('node.field_datetime_without_time'); + $this->assertEquals('date', $field->getSetting('datetime_type')); + // Except for field_date_with_end_time which is a timestamp and so does not + // have a datetime_type setting. + $field = FieldStorageConfig::load('node.field_date_with_end_time'); + $this->assertNull($field->getSetting('datetime_type')); } /** diff -r bfffd8d7479a -r 7a779792577d core/modules/field_layout/src/FieldLayoutBuilder.php --- a/core/modules/field_layout/src/FieldLayoutBuilder.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field_layout/src/FieldLayoutBuilder.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,12 +67,15 @@ $regions = array_fill_keys($layout_definition->getRegionNames(), []); foreach ($fields as $name => $field) { - // Move the field from the top-level of $build into a region-specific - // section. + // If the region is controlled by the layout, move the field from the + // top-level of $build into a region-specific section. Custom regions + // could be set by other code at run-time; these should be ignored. // @todo Ideally the array structure would remain unchanged, see // https://www.drupal.org/node/2846393. - $regions[$field['region']][$name] = $build[$name]; - unset($build[$name]); + if (isset($regions[$field['region']])) { + $regions[$field['region']][$name] = $build[$name]; + unset($build[$name]); + } } // Ensure this will not conflict with any existing array elements by // prefixing with an underscore. @@ -103,7 +106,7 @@ // avoids breaking hook_form_alter() implementations by not actually // moving the field in the form structure. If a #group is already set, // do not overwrite it. - if (!isset($build[$name]['#group'])) { + if (isset($regions[$field['region']]) && !isset($build[$name]['#group'])) { $build[$name]['#group'] = $field['region']; } } diff -r bfffd8d7479a -r 7a779792577d core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php --- a/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -93,6 +93,9 @@ 'test1' => [ '#markup' => 'Test1', ], + 'test2' => [ + '#markup' => 'Test2', + ], 'non_configurable_field' => [ '#markup' => 'Non-configurable', ], @@ -111,6 +114,9 @@ 'test1' => [ 'region' => 'right', ], + 'test2' => [ + 'region' => 'unknown_region', + ], 'non_configurable_field' => [ 'region' => 'left', ], @@ -120,6 +126,9 @@ ]); $expected = [ + 'test2' => [ + '#markup' => 'Test2', + ], 'non_configurable_field' => [ '#markup' => 'Non-configurable', ], @@ -169,6 +178,9 @@ '#markup' => 'Test2', '#group' => 'existing_group', ], + 'test3' => [ + '#markup' => 'Test3', + ], 'field_layout' => [ '#markup' => 'Field created through the UI happens to be named "Layout"', ], @@ -190,6 +202,9 @@ 'test2' => [ 'region' => 'left', ], + 'test3' => [ + 'region' => 'unknown_region', + ], 'field_layout' => [ 'region' => 'right', ], @@ -207,6 +222,9 @@ '#markup' => 'Test2', '#group' => 'existing_group', ], + 'test3' => [ + '#markup' => 'Test3', + ], 'field_layout' => [ '#markup' => 'Field created through the UI happens to be named "Layout"', '#group' => 'right', diff -r bfffd8d7479a -r 7a779792577d core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php --- a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -111,7 +111,8 @@ /** * {@inheritdoc} */ - protected function getDisplayModesLink() {; + protected function getDisplayModesLink() { + ; return [ '#type' => 'link', '#title' => t('Manage view modes'), diff -r bfffd8d7479a -r 7a779792577d core/modules/field_ui/src/Tests/ManageDisplayTest.php --- a/core/modules/field_ui/src/Tests/ManageDisplayTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/field_ui/src/Tests/ManageDisplayTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -452,7 +452,7 @@ /** * Asserts that a string is found in the rendered node in a view mode. * - * @param EntityInterface $node + * @param \Drupal\Core\Entity\EntityInterface $node * The node. * @param $view_mode * The view mode in which the node should be displayed. @@ -471,7 +471,7 @@ /** * Asserts that a string is not found in the rendered node in a view mode. * - * @param EntityInterface $node + * @param \Drupal\Core\Entity\EntityInterface $node * The node. * @param $view_mode * The view mode in which the node should be displayed. @@ -492,7 +492,7 @@ * This helper function is used by assertNodeViewText() and * assertNodeViewNoText(). * - * @param EntityInterface $node + * @param \Drupal\Core\Entity\EntityInterface $node * The node. * @param $view_mode * The view mode in which the node should be displayed. diff -r bfffd8d7479a -r 7a779792577d core/modules/file/src/Plugin/migrate/cckfield/d7/FileField.php --- a/core/modules/file/src/Plugin/migrate/cckfield/d7/FileField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/src/Plugin/migrate/cckfield/d7/FileField.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,7 +49,7 @@ */ public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => 'fid', diff -r bfffd8d7479a -r 7a779792577d core/modules/file/src/Plugin/migrate/cckfield/d7/ImageField.php --- a/core/modules/file/src/Plugin/migrate/cckfield/d7/ImageField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/src/Plugin/migrate/cckfield/d7/ImageField.php Fri Feb 23 15:52:07 2018 +0000 @@ -25,7 +25,7 @@ */ public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => 'fid', diff -r bfffd8d7479a -r 7a779792577d core/modules/file/src/Plugin/migrate/field/d7/FileField.php --- a/core/modules/file/src/Plugin/migrate/field/d7/FileField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/src/Plugin/migrate/field/d7/FileField.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,7 +18,7 @@ */ public function processFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => 'fid', diff -r bfffd8d7479a -r 7a779792577d core/modules/file/src/Plugin/migrate/field/d7/ImageField.php --- a/core/modules/file/src/Plugin/migrate/field/d7/ImageField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/src/Plugin/migrate/field/d7/ImageField.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,7 +18,7 @@ */ public function processFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => 'fid', diff -r bfffd8d7479a -r 7a779792577d core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php --- a/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php Fri Feb 23 15:52:07 2018 +0000 @@ -78,7 +78,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return count($this->initializeIterator()); } diff -r bfffd8d7479a -r 7a779792577d core/modules/file/src/Plugin/views/wizard/File.php --- a/core/modules/file/src/Plugin/views/wizard/File.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/src/Plugin/views/wizard/File.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,6 +17,8 @@ /** * Set the created column. + * + * @var string */ protected $createdColumn = 'created'; diff -r bfffd8d7479a -r 7a779792577d core/modules/file/src/Tests/DownloadTest.php --- a/core/modules/file/src/Tests/DownloadTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/src/Tests/DownloadTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -118,16 +118,6 @@ $this->checkUrl('private', '', $basename, $base_path . '/' . $script_path . 'system/files/' . $basename_encoded); } $this->assertEqual(file_create_url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='), 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', t('Generated URL matches expected URL.')); - // Test public files with a different host name from settings. - $test_base_url = 'http://www.example.com/cdn'; - $this->settingsSet('file_public_base_url', $test_base_url); - $filepath = file_create_filename('test.txt', ''); - $directory_uri = 'public://' . dirname($filepath); - file_prepare_directory($directory_uri, FILE_CREATE_DIRECTORY); - $file = $this->createFile($filepath, NULL, 'public'); - $url = file_create_url($file->getFileUri()); - $expected_url = $test_base_url . '/' . basename($filepath); - $this->assertEqual($url, $expected_url); } /** diff -r bfffd8d7479a -r 7a779792577d core/modules/file/src/Tests/FileFieldValidateTest.php --- a/core/modules/file/src/Tests/FileFieldValidateTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/src/Tests/FileFieldValidateTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -187,4 +187,25 @@ $this->assertText('Article ' . $node->getTitle() . ' has been updated.'); } + /** + * Test the validation message is displayed only once for ajax uploads. + */ + public function testAJAXValidationMessage() { + $field_name = strtolower($this->randomMachineName()); + $this->createFileField($field_name, 'node', 'article'); + + $this->drupalGet('node/add/article'); + /** @var \Drupal\file\FileInterface $image_file */ + $image_file = $this->getTestFile('image'); + $edit = [ + 'files[' . $field_name . '_0]' => $this->container->get('file_system')->realpath($image_file->getFileUri()), + 'title[0][value]' => $this->randomMachineName(), + ]; + $this->drupalPostAjaxForm(NULL, $edit, $field_name . '_0_upload_button'); + $elements = $this->xpath('//div[contains(@class, :class)]', [ + ':class' => 'messages--error', + ]); + $this->assertEqual(count($elements), 1, 'Ajax validation messages are displayed once.'); + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/file/tests/src/Functional/FileFieldCreationTrait.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,86 @@ + $entity_type, + 'field_name' => $name, + 'type' => 'file', + 'settings' => $storage_settings, + 'cardinality' => !empty($storage_settings['cardinality']) ? $storage_settings['cardinality'] : 1, + ]); + $field_storage->save(); + + $this->attachFileField($name, $entity_type, $bundle, $field_settings, $widget_settings); + return $field_storage; + } + + /** + * Attaches a file field to an entity. + * + * @param string $name + * The name of the new field (all lowercase), exclude the "field_" prefix. + * @param string $entity_type + * The entity type this field will be added to. + * @param string $bundle + * The bundle this field will be added to. + * @param array $field_settings + * A list of field settings that will be added to the defaults. + * @param array $widget_settings + * A list of widget settings that will be added to the widget defaults. + */ + public function attachFileField($name, $entity_type, $bundle, $field_settings = [], $widget_settings = []) { + $field = [ + 'field_name' => $name, + 'label' => $name, + 'entity_type' => $entity_type, + 'bundle' => $bundle, + 'required' => !empty($field_settings['required']), + 'settings' => $field_settings, + ]; + FieldConfig::create($field)->save(); + + entity_get_form_display($entity_type, $bundle, 'default') + ->setComponent($name, [ + 'type' => 'file_generic', + 'settings' => $widget_settings, + ]) + ->save(); + // Assign display settings. + entity_get_display($entity_type, $bundle, 'default') + ->setComponent($name, [ + 'label' => 'hidden', + 'type' => 'file_default', + ]) + ->save(); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/file/tests/src/Functional/FileFieldTestBase.php --- a/core/modules/file/tests/src/Functional/FileFieldTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/tests/src/Functional/FileFieldTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,6 +13,8 @@ */ abstract class FileFieldTestBase extends BrowserTestBase { + use FileFieldCreationTrait; + /** * Modules to enable. * @@ -58,76 +60,6 @@ } /** - * Creates a new file field. - * - * @param string $name - * The name of the new field (all lowercase), exclude the "field_" prefix. - * @param string $entity_type - * The entity type. - * @param string $bundle - * The bundle that this field will be added to. - * @param array $storage_settings - * A list of field storage settings that will be added to the defaults. - * @param array $field_settings - * A list of instance settings that will be added to the instance defaults. - * @param array $widget_settings - * A list of widget settings that will be added to the widget defaults. - */ - public function createFileField($name, $entity_type, $bundle, $storage_settings = [], $field_settings = [], $widget_settings = []) { - $field_storage = FieldStorageConfig::create([ - 'entity_type' => $entity_type, - 'field_name' => $name, - 'type' => 'file', - 'settings' => $storage_settings, - 'cardinality' => !empty($storage_settings['cardinality']) ? $storage_settings['cardinality'] : 1, - ]); - $field_storage->save(); - - $this->attachFileField($name, $entity_type, $bundle, $field_settings, $widget_settings); - return $field_storage; - } - - /** - * Attaches a file field to an entity. - * - * @param string $name - * The name of the new field (all lowercase), exclude the "field_" prefix. - * @param string $entity_type - * The entity type this field will be added to. - * @param string $bundle - * The bundle this field will be added to. - * @param array $field_settings - * A list of field settings that will be added to the defaults. - * @param array $widget_settings - * A list of widget settings that will be added to the widget defaults. - */ - public function attachFileField($name, $entity_type, $bundle, $field_settings = [], $widget_settings = []) { - $field = [ - 'field_name' => $name, - 'label' => $name, - 'entity_type' => $entity_type, - 'bundle' => $bundle, - 'required' => !empty($field_settings['required']), - 'settings' => $field_settings, - ]; - FieldConfig::create($field)->save(); - - entity_get_form_display($entity_type, $bundle, 'default') - ->setComponent($name, [ - 'type' => 'file_generic', - 'settings' => $widget_settings, - ]) - ->save(); - // Assign display settings. - entity_get_display($entity_type, $bundle, 'default') - ->setComponent($name, [ - 'label' => 'hidden', - 'type' => 'file_default', - ]) - ->save(); - } - - /** * Updates an existing file field with new settings. */ public function updateFileField($name, $type_name, $field_settings = [], $widget_settings = []) { diff -r bfffd8d7479a -r 7a779792577d core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,119 @@ +fileSystem = $this->container->get('file_system'); + + // Create the Article node type. + $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); + + // Attach a file field to the node type. + $field_settings = ['file_extensions' => 'txt']; + $this->createFileField('field_file', 'node', 'article', [], $field_settings); + + // Log in as a content author who can create Articles. + $this->user = $this->drupalCreateUser([ + 'access content', + 'create article content', + ]); + $this->drupalLogin($this->user); + + // Disable the displaying of errors, so that the AJAX responses are not + // contaminated with error messages about exceeding the maximum POST size. + // @todo Remove this when issue #2905597 is fixed. + // @see https://www.drupal.org/node/2905597 + $this->originalDisplayErrorsValue = ini_set('display_errors', '0'); + } + + /** + * {@inheritdoc} + */ + protected function tearDown() { + // Restore the displaying of errors to the original value. + // @todo Remove this when issue #2905597 is fixed. + // @see https://www.drupal.org/node/2905597 + ini_set('display_errors', $this->originalDisplayErrorsValue); + + parent::tearDown(); + } + + /** + * Tests that uploading files exceeding maximum size are handled correctly. + */ + public function testUploadFileExceedingMaximumFileSize() { + $session = $this->getSession(); + + // Create a test file that exceeds the maximum POST size with 1 kilobyte. + $post_max_size = Bytes::toInt(ini_get('post_max_size')); + $invalid_file = $this->generateFile('exceeding_post_max_size', ceil(($post_max_size + 1024) / 1024), 1024); + + // Go to the node creation form and try to upload the test file. + $this->drupalGet('node/add/article'); + $page = $session->getPage(); + $page->attachFileToField("files[field_file_0]", $this->fileSystem->realpath($invalid_file)); + + // An error message should appear informing the user that the file exceeded + // the maximum file size. + $this->assertSession()->waitForElement('css', '.messages--error'); + // The error message includes the actual file size limit which depends on + // the current environment, so we check for a part of the message. + $this->assertSession()->pageTextContains('An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size'); + + // Now upload a valid file and check that the error message disappears. + $valid_file = $this->generateFile('not_exceeding_post_max_size', 8, 8); + $page->attachFileToField("files[field_file_0]", $this->fileSystem->realpath($valid_file)); + $this->assertSession()->waitForElement('named', ['id_or_name', 'field_file_0_remove_button']); + $this->assertSession()->elementNotExists('css', '.messages--error'); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/file/tests/src/Kernel/FileUrlTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/file/tests/src/Kernel/FileUrlTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,27 @@ +setSetting('file_public_base_url', $test_base_url); + $filepath = file_create_filename('test.txt', ''); + $directory_uri = 'public://' . dirname($filepath); + file_prepare_directory($directory_uri, FILE_CREATE_DIRECTORY); + $file = $this->createFile($filepath, NULL, 'public'); + $url = file_create_url($file->getFileUri()); + $expected_url = $test_base_url . '/' . basename($filepath); + $this->assertSame($url, $expected_url); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php --- a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,7 +51,7 @@ $this->plugin->processCckFieldValues($this->migration, 'somefieldname', []); $expected = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => 'somefieldname', 'process' => [ 'target_id' => 'fid', diff -r bfffd8d7479a -r 7a779792577d core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php --- a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,7 +50,7 @@ $this->plugin->processCckFieldValues($this->migration, 'somefieldname', []); $expected = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => 'somefieldname', 'process' => [ 'target_id' => 'fid', diff -r bfffd8d7479a -r 7a779792577d core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php --- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,7 +50,7 @@ $this->plugin->processFieldValues($this->migration, 'somefieldname', []); $expected = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => 'somefieldname', 'process' => [ 'target_id' => 'fid', diff -r bfffd8d7479a -r 7a779792577d core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php --- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,7 +49,7 @@ $this->plugin->processFieldValues($this->migration, 'somefieldname', []); $expected = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => 'somefieldname', 'process' => [ 'target_id' => 'fid', diff -r bfffd8d7479a -r 7a779792577d core/modules/filter/filter.module --- a/core/modules/filter/filter.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/filter/filter.module Fri Feb 23 15:52:07 2018 +0000 @@ -287,7 +287,7 @@ * @return \Drupal\Component\Render\MarkupInterface * The filtered text. * - * @see filter_process_text() + * @see \Drupal\filter\Plugin\FilterInterface::process() * * @ingroup sanitization */ diff -r bfffd8d7479a -r 7a779792577d core/modules/filter/src/Plugin/FilterInterface.php --- a/core/modules/filter/src/Plugin/FilterInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/filter/src/Plugin/FilterInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,7 +32,7 @@ * should then actually change the content: transform URLs into hyperlinks, * convert smileys into images, etc. * - * @see filter_process_text() + * @see \Drupal\filter\Plugin\FilterInterface::process() * @see check_markup() * * Typically, only text processing is applied, but in more advanced use cases, diff -r bfffd8d7479a -r 7a779792577d core/modules/filter/src/Plugin/migrate/process/FilterID.php --- a/core/modules/filter/src/Plugin/migrate/process/FilterID.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/filter/src/Plugin/migrate/process/FilterID.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,7 +36,7 @@ * The plugin definition. * @param \Drupal\Component\Plugin\PluginManagerInterface $filter_manager * The filter plugin manager. - * @param TranslationInterface $translator + * @param \Drupal\Core\StringTranslation\TranslationInterface $translator * (optional) The string translation service. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, PluginManagerInterface $filter_manager, TranslationInterface $translator = NULL) { diff -r bfffd8d7479a -r 7a779792577d core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php --- a/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,7 +24,7 @@ /** * The mocked MigrateExecutable. * - * @var MigrateExecutableInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\migrate\MigrateExecutableInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $executable; diff -r bfffd8d7479a -r 7a779792577d core/modules/forum/forum.views.inc --- a/core/modules/forum/forum.views.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/forum/forum.views.inc Fri Feb 23 15:52:07 2018 +0000 @@ -86,7 +86,6 @@ ], ]; - $data['forum_index']['created'] = [ 'title' => t('Post date'), 'help' => t('The date the content was posted.'), diff -r bfffd8d7479a -r 7a779792577d core/modules/forum/tests/src/Functional/ForumBlockTest.php --- a/core/modules/forum/tests/src/Functional/ForumBlockTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/forum/tests/src/Functional/ForumBlockTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,7 +52,6 @@ // Create 5 forum topics. $topics = $this->createForumTopics(); - $this->assertLink(t('More'), 0, 'New forum topics block has a "more"-link.'); $this->assertLinkByHref('forum', 0, 'New forum topics block has a "more"-link.'); diff -r bfffd8d7479a -r 7a779792577d core/modules/forum/tests/src/Functional/ForumIndexTest.php --- a/core/modules/forum/tests/src/Functional/ForumIndexTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/forum/tests/src/Functional/ForumIndexTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -69,7 +69,6 @@ $this->assertCacheTag('taxonomy_term:' . $tid); $this->assertCacheTag('taxonomy_term:' . $tid_child); - // Unpublish the node. $edit = ['status[value]' => FALSE]; $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); diff -r bfffd8d7479a -r 7a779792577d core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php --- a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -61,7 +61,6 @@ $public_node = $this->drupalGetNodeByTitle($public_node_title); $this->assertTrue(!empty($public_node), 'New public forum node found in database.'); - // Enable the new and active forum blocks. $this->drupalPlaceBlock('forum_active_block'); $this->drupalPlaceBlock('forum_new_block'); diff -r bfffd8d7479a -r 7a779792577d core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php --- a/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -58,7 +58,7 @@ // User entity without a UUID, we cannot use it. $author = User::load($this->entity->getOwnerId()); $commented_entity = EntityTest::load(1); - return $normalization + [ + return $normalization + [ '_links' => [ 'self' => [ 'href' => $this->baseUrl . '/comment/1?_format=hal_json', diff -r bfffd8d7479a -r 7a779792577d core/modules/hal/tests/src/Functional/EntityResource/EntityTest/EntityTestHalJsonAnonTest.php --- a/core/modules/hal/tests/src/Functional/EntityResource/EntityTest/EntityTestHalJsonAnonTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/hal/tests/src/Functional/EntityResource/EntityTest/EntityTestHalJsonAnonTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,7 +39,7 @@ $normalization = $this->applyHalFieldNormalization($default_normalization); $author = User::load(0); - return $normalization + [ + return $normalization + [ '_links' => [ 'self' => [ 'href' => $this->baseUrl . '/entity_test/1?_format=hal_json', diff -r bfffd8d7479a -r 7a779792577d core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php --- a/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -97,7 +97,6 @@ if ($this->entity->getEntityType()->hasKey('bundle')) { $normalization = $this->getNormalizedPostEntity(); - $normalization['_links']['type'] = Url::fromUri('base:rest/type/' . static::$entityTypeId . '/bad_bundle_name'); $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); @@ -105,11 +104,9 @@ $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(422, 'No entity type(s) specified', $response); - unset($normalization['_links']['type']); $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when no entity type bundle is specified. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(422, 'The type link relation must be specified.', $response); diff -r bfffd8d7479a -r 7a779792577d core/modules/hal/tests/src/Functional/EntityResource/Node/NodeHalJsonAnonTest.php --- a/core/modules/hal/tests/src/Functional/EntityResource/Node/NodeHalJsonAnonTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/hal/tests/src/Functional/EntityResource/Node/NodeHalJsonAnonTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,7 +52,7 @@ $normalization = $this->applyHalFieldNormalization($default_normalization); $author = User::load($this->entity->getOwnerId()); - return $normalization + [ + return $normalization + [ '_links' => [ 'self' => [ 'href' => $this->baseUrl . '/llama?_format=hal_json', diff -r bfffd8d7479a -r 7a779792577d core/modules/help/tests/src/Functional/HelpTest.php --- a/core/modules/help/tests/src/Functional/HelpTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/help/tests/src/Functional/HelpTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,6 +24,8 @@ /** * Use the Standard profile to test help implementations of many core modules. + * + * @var string */ protected $profile = 'standard'; diff -r bfffd8d7479a -r 7a779792577d core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php --- a/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -81,7 +81,6 @@ 'timestamp' => REQUEST_TIME + 100, ])->execute(); - $column_map = [ 'nid' => 'nid', ]; diff -r bfffd8d7479a -r 7a779792577d core/modules/image/src/ImageEffectInterface.php --- a/core/modules/image/src/ImageEffectInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/image/src/ImageEffectInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,8 +50,7 @@ public function transformDimensions(array &$dimensions, $uri); /** - * Returns the extension the derivative would have have after applying this - * image effect. + * Returns the extension of the derivative after applying this image effect. * * @param string $extension * The file extension the derivative has before applying. diff -r bfffd8d7479a -r 7a779792577d core/modules/image/src/Tests/ImageDimensionsTest.php --- a/core/modules/image/src/Tests/ImageDimensionsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/image/src/Tests/ImageDimensionsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -173,7 +173,6 @@ $this->assertResponse(200, 'Image was generated at the URL.'); $this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.'); - // Add a crop effect. $effect = [ 'id' => 'image_crop', @@ -208,14 +207,18 @@ $effect_id = $style->addImageEffect($effect); $style->save(); - $this->assertEqual($this->getImageTag($variables), ''); + // @todo Uncomment this once + // https://www.drupal.org/project/drupal/issues/2670966 is resolved. + // $this->assertEqual($this->getImageTag($variables), ''); $this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.'); $this->drupalGet($this->getAbsoluteUrl($url)); $this->assertResponse(200, 'Image was generated at the URL.'); $this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.'); $image_file = $image_factory->get($generated_uri); - $this->assertEqual($image_file->getWidth(), 41); - $this->assertEqual($image_file->getHeight(), 41); + // @todo Uncomment this once + // https://www.drupal.org/project/drupal/issues/2670966 is resolved. + // $this->assertEqual($image_file->getWidth(), 41); + // $this->assertEqual($image_file->getHeight(), 41); $effect_plugin = $style->getEffect($effect_id); $style->deleteImageEffect($effect_plugin); diff -r bfffd8d7479a -r 7a779792577d core/modules/image/src/Tests/ImageFieldValidateTest.php --- a/core/modules/image/src/Tests/ImageFieldValidateTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/image/src/Tests/ImageFieldValidateTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -156,4 +156,26 @@ ]; } + /** + * Test the validation message is displayed only once for ajax uploads. + */ + public function testAJAXValidationMessage() { + $field_name = strtolower($this->randomMachineName()); + $this->createImageField($field_name, 'article', ['cardinality' => -1]); + + $this->drupalGet('node/add/article'); + /** @var \Drupal\file\FileInterface[] $text_files */ + $text_files = $this->drupalGetTestFiles('text'); + $text_file = reset($text_files); + $edit = [ + 'files[' . $field_name . '_0][]' => $this->container->get('file_system')->realpath($text_file->uri), + 'title[0][value]' => $this->randomMachineName(), + ]; + $this->drupalPostAjaxForm(NULL, $edit, $field_name . '_0_upload_button'); + $elements = $this->xpath('//div[contains(@class, :class)]', [ + ':class' => 'messages--error', + ]); + $this->assertEqual(count($elements), 1, 'Ajax validation messages are displayed once.'); + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/language/language.module --- a/core/modules/language/language.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/language/language.module Fri Feb 23 15:52:07 2018 +0000 @@ -193,7 +193,7 @@ $bundle = $values['bundle']; $form_object = $form_state->getFormObject(); if ($form_object instanceof EntityFormInterface) { - /** @var EntityFormInterface $form_object */ + /** @var \Drupal\Core\Entity\EntityFormInterface $form_object */ $entity = $form_object->getEntity(); if ($entity->getEntityType()->getBundleOf()) { $bundle = $entity->id(); diff -r bfffd8d7479a -r 7a779792577d core/modules/language/src/EventSubscriber/ConfigSubscriber.php --- a/core/modules/language/src/EventSubscriber/ConfigSubscriber.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/language/src/EventSubscriber/ConfigSubscriber.php Fri Feb 23 15:52:07 2018 +0000 @@ -81,7 +81,7 @@ * then this event must be changed to work with both the old and new schema * definition so this event is update safe. * - * @param ConfigCrudEvent $event + * @param \Drupal\Core\Config\ConfigCrudEvent $event * The configuration event. */ public function onConfigSave(ConfigCrudEvent $event) { diff -r bfffd8d7479a -r 7a779792577d core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php --- a/core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,7 +41,7 @@ /** * The current active user. * - * @return \Drupal\Core\Session\AccountInterface + * @var \Drupal\Core\Session\AccountInterface */ protected $currentUser; diff -r bfffd8d7479a -r 7a779792577d core/modules/language/src/Form/NegotiationConfigureForm.php --- a/core/modules/language/src/Form/NegotiationConfigureForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/language/src/Form/NegotiationConfigureForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -213,7 +213,7 @@ * @param string $type * The language type to generate the table for. */ - protected function configureFormTable(array &$form, $type) { + protected function configureFormTable(array &$form, $type) { $info = $form['#language_types_info'][$type]; $table_form = [ diff -r bfffd8d7479a -r 7a779792577d core/modules/language/src/LanguageNegotiationMethodBase.php --- a/core/modules/language/src/LanguageNegotiationMethodBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/language/src/LanguageNegotiationMethodBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,7 +28,7 @@ /** * The current active user. * - * @return \Drupal\Core\Session\AccountInterface + * @var \Drupal\Core\Session\AccountInterface */ protected $currentUser; diff -r bfffd8d7479a -r 7a779792577d core/modules/language/src/LanguageNegotiator.php --- a/core/modules/language/src/LanguageNegotiator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/language/src/LanguageNegotiator.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,7 +38,7 @@ /** * The settings instance. * - * @return \Drupal\Core\Site\Settings + * @var \Drupal\Core\Site\Settings */ protected $settings; @@ -52,7 +52,7 @@ /** * The current active user. * - * @return \Drupal\Core\Session\AccountInterface + * @var \Drupal\Core\Session\AccountInterface */ protected $currentUser; diff -r bfffd8d7479a -r 7a779792577d core/modules/language/tests/src/Functional/LanguageConfigurationTest.php --- a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -198,7 +198,7 @@ * @return int * Maximum weight of configurable languages. */ - protected function getHighestConfigurableLanguageWeight(){ + protected function getHighestConfigurableLanguageWeight() { $max_weight = 0; $storage = $this->container->get('entity_type.manager') diff -r bfffd8d7479a -r 7a779792577d core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php --- a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,7 +31,6 @@ ->method('addViolation'); } - $constraint = new LinkNotExistingInternalConstraint(); $validator = new LinkNotExistingInternalConstraintValidator(); diff -r bfffd8d7479a -r 7a779792577d core/modules/locale/locale.post_update.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/locale/locale.post_update.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,13 @@ +setLanguageName($language_name); $writer = new PoStreamWriter(); - $writer->setUri($uri); + $writer->setURI($uri); $writer->setHeader($header); $writer->open(); diff -r bfffd8d7479a -r 7a779792577d core/modules/locale/src/Form/TranslationStatusForm.php --- a/core/modules/locale/src/Form/TranslationStatusForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/locale/src/Form/TranslationStatusForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -40,7 +40,7 @@ /** * Constructs a TranslationStatusForm object. * - * @param ModuleHandlerInterface $module_handler + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * A module handler. * @param \Drupal\Core\State\StateInterface $state * The state service. diff -r bfffd8d7479a -r 7a779792577d core/modules/locale/src/LocaleLookup.php --- a/core/modules/locale/src/LocaleLookup.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/locale/src/LocaleLookup.php Fri Feb 23 15:52:07 2018 +0000 @@ -7,6 +7,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Lock\LockBackendInterface; +use Drupal\Core\StringTranslation\PluralTranslatableMarkup; use Symfony\Component\HttpFoundation\RequestStack; /** @@ -172,6 +173,12 @@ } } + if (is_string($value) && strpos($value, PluralTranslatableMarkup::DELIMITER) !== FALSE) { + // Community translations imported from localize.drupal.org as well as + // migrated translations may contain @count[number]. + $value = preg_replace('!@count\[\d+\]!', '@count', $value); + } + $this->storage[$offset] = $value; // Disabling the usage of string caching allows a module to watch for // the exact list of strings used on a page. From a performance diff -r bfffd8d7479a -r 7a779792577d core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php --- a/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,7 +21,7 @@ /** * {@inheritdoc} */ - protected function setUp(){ + protected function setUp() { parent::setUp(); $account = $this->drupalCreateUser(['administer site configuration']); $this->drupalLogin($account); diff -r bfffd8d7479a -r 7a779792577d core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php --- a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,7 @@ namespace Drupal\Tests\locale\Functional; +use Drupal\Core\StringTranslation\PluralTranslatableMarkup; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\Tests\BrowserTestBase; @@ -55,4 +56,45 @@ $this->assertEqual($context['operation'], 'locale_lookup'); } + /** + * Test old plural style @count[number] fix. + * + * @dataProvider providerTestFixOldPluralStyle + */ + public function testFixOldPluralStyle($translation_value, $expected) { + $string_storage = \Drupal::service('locale.storage'); + $string = $string_storage->findString(['source' => 'Member for', 'context' => '']); + $lid = $string->getId(); + $string_storage->createTranslation([ + 'lid' => $lid, + 'language' => 'fr', + 'translation' => $translation_value, + ])->save(); + _locale_refresh_translations(['fr'], [$lid]); + + // Check that 'count[2]' was fixed for render value. + $this->drupalGet(''); + $this->assertSession()->pageTextContains($expected); + + // Check that 'count[2]' was saved for source value. + $translation = $string_storage->findTranslation(['language' => 'fr', 'lid' => $lid])->translation; + $this->assertSame($translation_value, $translation, 'Source value not changed'); + $this->assertNotFalse(strpos($translation, '@count[2]'), 'Source value contains @count[2]'); + } + + /** + * Provides data for testFixOldPluralStyle(). + * + * @return array + * An array of test data: + * - translation value + * - expected result + */ + public function providerTestFixOldPluralStyle() { + return [ + 'non-plural translation' => ['@count[2] non-plural test', '@count[2] non-plural test'], + 'plural translation' => ['@count[2] plural test' . PluralTranslatableMarkup::DELIMITER, '@count plural test'], + ]; + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/locale/tests/src/Unit/LocaleLookupTest.php --- a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,6 +3,7 @@ namespace Drupal\Tests\locale\Unit; use Drupal\Core\DependencyInjection\ContainerBuilder; +use Drupal\Core\StringTranslation\PluralTranslatableMarkup; use Drupal\locale\LocaleLookup; use Drupal\Tests\UnitTestCase; use Symfony\Component\HttpFoundation\Request; @@ -266,4 +267,66 @@ $this->assertTrue($locale_lookup->get('test')); } + /** + * Tests locale lookups with old plural style of translations. + * + * @param array $translations + * The source with translations. + * @param string $langcode + * The language code of translation string. + * @param string $string + * The string for translation. + * @param bool $is_fix + * The flag about expected fix translation. + * + * @covers ::resolveCacheMiss + * @dataProvider providerFixOldPluralTranslationProvider + */ + public function testFixOldPluralStyleTranslations($translations, $langcode, $string, $is_fix) { + $this->storage->expects($this->any()) + ->method('findTranslation') + ->will($this->returnCallback(function ($argument) use ($translations) { + if (isset($translations[$argument['language']][$argument['source']])) { + return (object) ['translation' => $translations[$argument['language']][$argument['source']]]; + } + return TRUE; + })); + $this->languageManager->expects($this->any()) + ->method('getFallbackCandidates') + ->will($this->returnCallback(function (array $context = []) { + switch ($context['langcode']) { + case 'by': + return ['ru']; + } + })); + $this->cache->expects($this->once()) + ->method('get') + ->with('locale:' . $langcode . '::anonymous', FALSE); + + $locale_lookup = new LocaleLookup($langcode, '', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack); + $this->assertSame($is_fix, strpos($locale_lookup->get($string), '@count[2]') === FALSE); + } + + /** + * Provides test data for testResolveCacheMissWithFallback(). + */ + public function providerFixOldPluralTranslationProvider() { + $translations = [ + 'by' => [ + 'word1' => '@count[2] word-by', + 'word2' => implode(PluralTranslatableMarkup::DELIMITER, ['word-by', '@count[2] word-by']), + ], + 'ru' => [ + 'word3' => '@count[2] word-ru', + 'word4' => implode(PluralTranslatableMarkup::DELIMITER, ['word-ru', '@count[2] word-ru']), + ], + ]; + return [ + 'no-plural' => [$translations, 'by', 'word1', FALSE], + 'no-plural from other language' => [$translations, 'by', 'word3', FALSE], + 'plural' => [$translations, 'by', 'word2', TRUE], + 'plural from other language' => [$translations, 'by', 'word4', TRUE], + ]; + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/media/config/install/core.entity_view_display.media.file.default.yml --- a/core/modules/media/config/install/core.entity_view_display.media.file.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/media/config/install/core.entity_view_display.media.file.default.yml Fri Feb 23 15:52:07 2018 +0000 @@ -16,8 +16,16 @@ settings: { } third_party_settings: { } type: file_default + weight: 1 + region: content + name: + label: hidden + type: string weight: 0 region: content + settings: + link_to_entity: false + third_party_settings: { } hidden: created: true thumbnail: true diff -r bfffd8d7479a -r 7a779792577d core/modules/media/config/install/core.entity_view_display.media.image.default.yml --- a/core/modules/media/config/install/core.entity_view_display.media.image.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/media/config/install/core.entity_view_display.media.image.default.yml Fri Feb 23 15:52:07 2018 +0000 @@ -19,8 +19,16 @@ image_link: file third_party_settings: { } type: image + weight: 1 + region: content + name: + label: hidden + type: string weight: 0 region: content + settings: + link_to_entity: false + third_party_settings: { } hidden: created: true thumbnail: true diff -r bfffd8d7479a -r 7a779792577d core/modules/media/src/Entity/Media.php --- a/core/modules/media/src/Entity/Media.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/media/src/Entity/Media.php Fri Feb 23 15:52:07 2018 +0000 @@ -404,6 +404,7 @@ 'weight' => -5, ]) ->setDisplayConfigurable('form', TRUE) + ->setDisplayConfigurable('view', TRUE) ->setDisplayOptions('view', [ 'label' => 'hidden', 'type' => 'string', diff -r bfffd8d7479a -r 7a779792577d core/modules/media/tests/src/Kernel/MediaTest.php --- a/core/modules/media/tests/src/Kernel/MediaTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/media/tests/src/Kernel/MediaTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,4 +20,15 @@ $this->assertSame($media, $media->setOwnerId($this->user->id()), 'setOwnerId() method returns its own entity.'); } + /** + * Ensure media name is configurable on manage display. + */ + public function testNameIsConfigurable() { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $field_definitions */ + $field_definitions = $this->container->get('entity_field.manager') + ->getBaseFieldDefinitions('media'); + + $this->assertTrue($field_definitions['name']->isDisplayConfigurable('view')); + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/menu_link_content/src/Entity/MenuLinkContent.php --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php Fri Feb 23 15:52:07 2018 +0000 @@ -316,7 +316,7 @@ ->setDefaultValue(0) ->setDisplayOptions('view', [ 'label' => 'hidden', - 'type' => 'integer', + 'type' => 'number_integer', 'weight' => 0, ]) ->setDisplayOptions('form', [ diff -r bfffd8d7479a -r 7a779792577d core/modules/menu_link_content/tests/src/Functional/LinksTest.php --- a/core/modules/menu_link_content/tests/src/Functional/LinksTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/menu_link_content/tests/src/Functional/LinksTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -127,6 +127,7 @@ 'menu_name' => 'menu_test', 'bundle' => 'menu_link_content', 'link' => [['uri' => 'internal:/']], + 'title' => 'Link test', ]; $link = MenuLinkContent::create($options); $link->save(); @@ -148,7 +149,12 @@ public function testMenuLinkOnEntityDelete() { $user = User::create(['name' => 'username']); $user->save(); - $menu_link_content = MenuLinkContent::create(['menu_name' => 'menu_test', 'link' => [['uri' => 'entity:user/' . $user->id()]], 'bundle' => 'menu_test']); + $menu_link_content = MenuLinkContent::create([ + 'title' => 'username profile', + 'menu_name' => 'menu_test', + 'link' => [['uri' => 'entity:user/' . $user->id()]], + 'bundle' => 'menu_test', + ]); $menu_link_content->save(); $menu_tree_condition = (new MenuTreeParameters())->addCondition('route_name', 'entity.user.canonical'); $this->assertCount(1, \Drupal::menuTree()->load('menu_test', $menu_tree_condition)); diff -r bfffd8d7479a -r 7a779792577d core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php --- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php Fri Feb 23 15:52:07 2018 +0000 @@ -70,7 +70,11 @@ $this->drupalGet('admin/structure/menu/manage/tools'); $this->assertNoLink(t('Translate')); - $menu_link_content = MenuLinkContent::create(['menu_name' => 'tools', 'link' => ['uri' => 'internal:/admin/structure/menu']]); + $menu_link_content = MenuLinkContent::create([ + 'menu_name' => 'tools', + 'link' => ['uri' => 'internal:/admin/structure/menu'], + 'title' => 'Link test', + ]); $menu_link_content->save(); $this->drupalGet('admin/structure/menu/manage/tools'); $this->assertLink(t('Translate')); diff -r bfffd8d7479a -r 7a779792577d core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php --- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -59,7 +59,6 @@ $menu_tree = \Drupal::menuTree(); $renderer = \Drupal::service('renderer'); - $default_menu_cacheability = (new BubbleableMetadata()) ->setCacheMaxAge(Cache::PERMANENT) ->setCacheTags(['config:system.menu.tools']) @@ -109,6 +108,7 @@ $menu_link_content = MenuLinkContent::create([ 'link' => ['uri' => $expectation['uri']], 'menu_name' => 'tools', + 'title' => 'Link test', ]); $menu_link_content->save(); $tree = $menu_tree->load('tools', new MenuTreeParameters()); @@ -129,6 +129,7 @@ $menu_link_content = MenuLinkContent::create([ 'link' => ['uri' => $expectation['uri']], 'menu_name' => 'tools', + 'title' => 'Link test', ]); $menu_link_content->save(); $expected_cacheability = $expected_cacheability->merge($expectation['cacheability']); diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Annotation/MigrateProcessPlugin.php --- a/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,7 +36,7 @@ * Whether the plugin handles multiples itself. * * Typically these plugins will expect an array as input and iterate over it - * themselves, changing the whole array. For example the 'iterator' and the + * themselves, changing the whole array. For example the 'sub_process' and the * 'flatten' plugins. If the plugin only need to change a single value it * can skip setting this attribute and let * \Drupal\migrate\MigrateExecutable::processRow() handle the iteration. diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/MigrateSourceInterface.php --- a/core/modules/migrate/src/Plugin/MigrateSourceInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/MigrateSourceInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -53,9 +53,12 @@ * An associative array of field definitions keyed by field ID. Values are * associative arrays with a structure that contains the field type ('type' * key). The other keys are the field storage settings as they are returned - * by FieldStorageDefinitionInterface::getSettings(). As an example, for a - * composite source primary key that is defined by an integer and a - * string, the returned value might look like: + * by FieldStorageDefinitionInterface::getSettings(). + * + * Examples: + * + * A composite source primary key that is defined by an integer and a string + * might look like this: * @code * return [ * 'id' => [ @@ -70,6 +73,7 @@ * ], * ]; * @endcode + * * If 'type' points to a field plugin with multiple columns and needs to * refer to a column different than 'value', the key of that column will be * appended as a suffix to the plugin name, separated by dot ('.'). Example: @@ -80,9 +84,13 @@ * ], * ]; * @endcode - * Additional custom keys/values, that are not part of field storage - * definition, can be passed in definitions. The most common setting, passed - * along the ID definition, is 'alias' used by SqlBase source plugin: + * + * Additional custom keys/values that are not part of field storage + * definition can be added as shown below. The most common setting + * passed along to the ID definition is 'alias', used by the SqlBase source + * plugin in order to distinguish between ambiguous column names - for + * example, when a SQL source query joins two tables with the same column + * names. * @code * return [ * 'nid' => [ diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/Migration.php --- a/core/modules/migrate/src/Plugin/Migration.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/Migration.php Fri Feb 23 15:52:07 2018 +0000 @@ -621,7 +621,7 @@ if ($plugin_configuration['plugin'] == 'migration') { $return = array_merge($return, (array) $plugin_configuration['migration']); } - if ($plugin_configuration['plugin'] == 'iterator') { + if ($plugin_configuration['plugin'] == 'sub_process') { $return = array_merge($return, $this->findMigrationDependencies($plugin_configuration['process'])); } } diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/migrate/destination/Entity.php --- a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php Fri Feb 23 15:52:07 2018 +0000 @@ -45,9 +45,9 @@ * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param MigrationInterface $migration + * @param \Drupal\migrate\Plugin\MigrationInterface $migration * The migration. - * @param EntityStorageInterface $storage + * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The storage for this entity type. * @param array $bundles * The list of bundles this entity type has. diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/migrate/destination/EntityFieldInstance.php --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldInstance.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldInstance.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,7 +3,43 @@ namespace Drupal\migrate\Plugin\migrate\destination; /** - * Provides entity field instance plugin. + * Provides destination plugin for field_config configuration entities. + * + * The Field API defines two primary data structures, FieldStorage and Field. + * A FieldStorage defines a particular type of data that can be attached to + * entities as a Field instance. + * + * The example below adds an instance of 'field_text_example' to 'article' + * bundle (node content type). The example uses the EmptySource source plugin + * and constant source values for the sake of simplicity. For an example on how + * the FieldStorage 'field_text_example' can be migrated, refer to + * \Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig. + * @code + * id: field_instance_example + * label: Field instance example + * source: + * plugin: empty + * constants: + * entity_type: node + * field_name: field_text_example + * bundle: article + * label: Text field example + * translatable: true + * process: + * entity_type: constants/entity_type + * field_name: constants/field_name + * bundle: constants/bundle + * label: constants/label + * translatable: constants/translatable + * destination: + * plugin: entity:field_config + * migration_dependencies: + * required: + * - field_storage_example + * @endcode + * + * @see \Drupal\field\Entity\FieldConfig + * @see \Drupal\field\Entity\FieldConfigBase * * @MigrateDestination( * id = "entity:field_config" diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,7 +3,48 @@ namespace Drupal\migrate\Plugin\migrate\destination; /** - * Provides entity field storage configuration plugin. + * Provides destination plugin for field_storage_config configuration entities. + * + * The Field API defines two primary data structures, FieldStorage and Field. + * A FieldStorage defines a particular type of data that can be attached to + * entities as a Field instance. + * + * The example below creates a storage for a simple text field. The example uses + * the EmptySource source plugin and constant source values for the sake of + * simplicity. + * @code + * id: field_storage_example + * label: Field storage example + * source: + * plugin: empty + * constants: + * entity_type: node + * id: node.field_text_example + * field_name: field_text_example + * type: string + * cardinality: 1 + * settings: + * max_length: 10 + * langcode: en + * translatable: true + * process: + * entity_type: constants/entity_type + * id: constants/id + * field_name: constants/field_name + * type: constants/type + * cardinality: constants/cardinality + * settings: constants/settings + * langcode: constants/langcode + * translatable: constants/translatable + * destination: + * plugin: entity:field_storage_config + * @endcode + * + * For a full list of the properties of a FieldStorage configuration entity, + * refer to \Drupal\field\Entity\FieldStorageConfig. + * + * For an example on how to migrate a Field instance of this FieldStorage, + * refer to \Drupal\migrate\Plugin\migrate\destination\EntityFieldInstance. * * @MigrateDestination( * id = "entity:field_storage_config" diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/migrate/process/SubProcess.php --- a/core/modules/migrate/src/Plugin/migrate/process/SubProcess.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/migrate/process/SubProcess.php Fri Feb 23 15:52:07 2018 +0000 @@ -94,7 +94,7 @@ * * process: * filters: - * plugin: iterator + * plugin: sub_process * source: filters * key: "@id" * process: diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php --- a/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -27,7 +27,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return 1; } diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/migrate/source/EmptySource.php --- a/core/modules/migrate/src/Plugin/migrate/source/EmptySource.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/migrate/source/EmptySource.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,9 +3,20 @@ namespace Drupal\migrate\Plugin\migrate\source; /** - * Source returning an empty row. + * Source returning a row based on the constants provided. * - * This is generally useful when needing to create a field using a migration.. + * Example: + * + * @code + * source: + * plugin: empty + * constants: + * entity_type: user + * field_name: image + * @endcode + * + * This will return a single row containing 'entity_type' and 'field_name' + * elements, with values of 'user' and 'image', respectively. * * @MigrateSource( * id = "empty" diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php --- a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -436,7 +436,10 @@ * Returns -1 if the source is not countable. * * @param bool $refresh - * (optional) Whether or not to refresh the count. Defaults to FALSE. + * (optional) Whether or not to refresh the count. Defaults to FALSE. Not + * all implementations support the reset flag. In such instances this + * parameter is ignored and the result of calling the method will always be + * up to date. * * @return int * The count. diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/src/Plugin/migrate/source/SqlBase.php --- a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,35 +17,48 @@ /** * Sources whose data may be fetched via a database connection. * - * Database configuration, which may appear either within the source plugin - * configuration or in state, is structured as follows: + * Available configuration keys: + * - database_state_key: (optional) Name of the state key which contains an + * array with database connection information. + * - key: (optional) The database key name. Defaults to 'migrate'. + * - target: (optional) The database target name. Defaults to 'default'. + * - batch_size: (optional) Number of records to fetch from the database during + * each batch. If omitted, all records are fetched in a single query. + * - ignore_map: (optional) Source data is joined to the map table by default. + * If set to TRUE, the map table will not be joined. * - * 'key' - The database key name (defaults to 'migrate'). - * 'target' - The database target name (defaults to 'default'). - * 'database' - Database connection information as accepted by - * Database::addConnectionInfo(). If not present, the key/target is assumed - * to already be defined (e.g., in settings.php). + * For other optional configuration keys inherited from the parent class, refer + * to \Drupal\migrate\Plugin\migrate\source\SourcePluginBase. * - * This configuration info is obtained in the following order: + * About the source database determination: + * - If the source plugin configuration contains 'database_state_key', its value + * is taken as the name of a state key which contains an array with the + * database configuration. + * - Otherwise, if the source plugin configuration contains 'key', the database + * configuration with that name is used. + * - If both 'database_state_key' and 'key' are omitted in the source plugin + * configuration, the database connection named 'migrate' is used by default. + * - If all of the above steps fail, RequirementsException is thrown. * - * 1. If the source plugin configuration contains a key 'database_state_key', - * its value is taken as the name of a state key which contains an array - * with the above database configuration. - * 2. Otherwise, if the source plugin configuration contains 'key', the above - * database configuration is obtained directly from the plugin configuration. - * 3. Otherwise, if the state 'migrate.fallback_state_key' exists, its value is - * taken as the name of a state key which contains an array with the above - * database configuration. - * 4. Otherwise, if a connection named 'migrate' exists, that is used as the - * database connection. - * 5. Otherwise, RequirementsException is thrown. + * Drupal Database API supports multiple database connections. The connection + * parameters are defined in $databases array in settings.php or + * settings.local.php. It is also possible to modify the $databases array in + * runtime. For example, Migrate Drupal, which provides the migrations from + * Drupal 6 / 7, asks for the source database connection parameters in the UI + * and then adds the $databases['migrate'] connection in runtime before the + * migrations are executed. * - * It is strongly recommended that database connections be explicitly defined - * via 'database_state_key' or in the source plugin configuration. Defining - * migrate.fallback_state_key or a 'migrate' connection affects not only any - * migrations intended to use that particular connection, but all - * SqlBase-derived source plugins which do not have explicit database - * configuration. + * As described above, the default source database is $databases['migrate']. If + * the source plugin needs another source connection, the database connection + * parameters should be added to the $databases array as, for instance, + * $databases['foo']. The source plugin can then use this connection by setting + * 'key' to 'foo' in its configuration. + * + * For a complete example on migrating data from an SQL source, refer to + * https://www.drupal.org/docs/8/api/migrate-api/migrating-data-from-sql-source + * + * @see https://www.drupal.org/docs/8/api/database-api + * @see \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase */ abstract class SqlBase extends SourcePluginBase implements ContainerFactoryPluginInterface, RequirementsInterface { @@ -365,7 +378,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return $this->query()->countQuery()->execute()->fetchField(); } diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php --- a/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -66,7 +66,7 @@ // Import and validate the term entity was created with the correct bundle. $term_executable = new MigrateExecutable($term_migration, $this); $term_executable->import(); - /** @var Term $term */ + /** @var \Drupal\taxonomy\Entity\Term $term */ $term = Term::load(1); $this->assertEquals($term->bundle(), 'categories'); } @@ -104,7 +104,7 @@ // Import and validate the term entities were created with the correct bundle. $term_executable = new MigrateExecutable($term_migration, $this); $term_executable->import(); - /** @var Term $term */ + /** @var \Drupal\taxonomy\Entity\Term $term */ $term = Term::load(1); $this->assertEquals($term->bundle(), 'categories'); $term = Term::load(2); @@ -146,7 +146,7 @@ // Import and validate the term entities were created with the correct bundle. $term_executable = new MigrateExecutable($term_migration, $this); $term_executable->import(); - /** @var Term $term */ + /** @var \Drupal\taxonomy\Entity\Term $term */ $term = Term::load(1); $this->assertEquals($term->bundle(), 'categories'); $term = Term::load(2); diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php --- a/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -69,7 +69,7 @@ $vocabulary_executable = new MigrateExecutable($vocabulary_migration, $this); $vocabulary_executable->import(); foreach ($vocabulary_data_rows as $row) { - /** @var Vocabulary $vocabulary */ + /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */ $vocabulary = Vocabulary::load($row['id']); $this->assertTrue($vocabulary); $map_row = $vocabulary_id_map->getRowBySource(['id' => $row['id']]); @@ -122,7 +122,7 @@ $map_row['source_row_status'], MigrateIdMapInterface::ROLLBACK_PRESERVE); foreach ($term_data_rows as $row) { - /** @var Term $term */ + /** @var \Drupal\taxonomy\Entity\Term $term */ $term = Term::load($row['id']); $this->assertTrue($term); $map_row = $term_id_map->getRowBySource(['id' => $row['id']]); diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php --- a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,7 +20,7 @@ /** * The mocked migration. * - * @var MigrationInterface|\Prophecy\Prophecy\ObjectProphecy + * @var \Drupal\migrate\Plugin\MigrationInterface|\Prophecy\Prophecy\ObjectProphecy */ protected $migration; diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php --- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -42,7 +42,7 @@ 'migration' => 'm1' ], 'f3' => [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'process' => [ 'target_id' => [ 'plugin' => 'migration', diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/tests/src/Kernel/QueryBatchTest.php --- a/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -19,7 +19,7 @@ /** * The mocked migration. * - * @var MigrationInterface|\Prophecy\Prophecy\ObjectProphecy + * @var \Drupal\migrate\Plugin\MigrationInterface|\Prophecy\Prophecy\ObjectProphecy */ protected $migration; diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php --- a/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,7 +15,7 @@ /** * A plugin manager. * - * @param \Drupal\migrate\Plugin\MigrationPluginManager $pluginManager + * @var \Drupal\migrate\Plugin\MigrationPluginManager */ protected $pluginManager; diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php --- a/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php Fri Feb 23 15:52:07 2018 +0000 @@ -43,7 +43,7 @@ * The plugin implementation definition. * @param \Drupal\migrate\Plugin\MigrationInterface $migration * The migration. - * @param EntityStorageInterface $storage + * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The storage for this entity type. * @param array $bundles * The list of bundles this entity type has. diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php --- a/core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,7 +20,7 @@ */ public function processFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => [ diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal/src/Plugin/migrate/field/UserReference.php --- a/core/modules/migrate_drupal/src/Plugin/migrate/field/UserReference.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal/src/Plugin/migrate/field/UserReference.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,7 +20,7 @@ */ public function processFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => [ diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,10 +13,19 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * A base source class for Drupal migrate sources. + * A base class for source plugins using a Drupal database as a source. * - * Mainly to let children retrieve information from the origin system in an - * easier way. + * Provides general purpose helper methods that are commonly needed + * when writing source plugins that use a Drupal database as a source, for + * example: + * - Check if the given module exists in the source database. + * - Read Drupal configuration variables from the source database. + * + * For a full list, refer to the methods of this class. + * + * For available configuration keys, refer to the parent classes: + * @see \Drupal\migrate\Plugin\migrate\source\SqlBase + * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase */ abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginInterface, DependentPluginInterface { @@ -52,7 +61,7 @@ } /** - * Retrieves all system data information from origin system. + * Retrieves all system data information from the source Drupal database. * * @return array * List of system table information keyed by type and name. @@ -109,7 +118,7 @@ } /** - * Get a module schema_version value in the source installation. + * Retrieves a module schema_version from the source Drupal database. * * @param string $module * Name of module. @@ -124,7 +133,7 @@ } /** - * Check to see if a given module is enabled in the source installation. + * Checks if a given module is enabled in the source Drupal database. * * @param string $module * Name of module to check. @@ -138,7 +147,7 @@ } /** - * Read a variable from a Drupal database. + * Reads a variable from a source Drupal database. * * @param $name * Name of the variable. diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php Fri Feb 23 15:52:07 2018 +0000 @@ -58,7 +58,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return intval($this->query()->countQuery()->execute()->fetchField() > 0); } diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal/src/Plugin/migrate/source/d6/VariableTranslation.php --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/VariableTranslation.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/VariableTranslation.php Fri Feb 23 15:52:07 2018 +0000 @@ -68,7 +68,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return $this->initializeIterator()->count(); } diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal/tests/fixtures/drupal7.php --- a/core/modules/migrate_drupal/tests/fixtures/drupal7.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal/tests/fixtures/drupal7.php Fri Feb 23 15:52:07 2018 +0000 @@ -3576,6 +3576,36 @@ 'translatable' => '0', 'deleted' => '0', )) +->values(array( + 'id' => '35', + 'field_name' => 'field_datetime_without_time', + 'type' => 'datetime', + 'module' => 'date', + 'active' => '1', + 'storage_type' => 'field_sql_storage', + 'storage_module' => 'field_sql_storage', + 'storage_active' => '1', + 'locked' => '0', + 'data' => 'a:7:{s:12:"translatable";s:1:"0";s:12:"entity_types";a:0:{}s:8:"settings";a:6:{s:11:"granularity";a:6:{s:5:"month";s:5:"month";s:3:"day";s:3:"day";s:4:"hour";i:0;s:6:"minute";i:0;s:4:"year";s:4:"year";s:6:"second";i:0;}s:11:"tz_handling";s:4:"site";s:11:"timezone_db";s:3:"UTC";s:13:"cache_enabled";i:0;s:11:"cache_count";s:1:"4";s:6:"todate";s:0:"";}s:7:"storage";a:5:{s:4:"type";s:17:"field_sql_storage";s:8:"settings";a:0:{}s:6:"module";s:17:"field_sql_storage";s:6:"active";s:1:"1";s:7:"details";a:1:{s:3:"sql";a:2:{s:18:"FIELD_LOAD_CURRENT";a:1:{s:38:"field_data_field_datetime_without_time";a:1:{s:5:"value";s:33:"field_datetime_without_time_value";}}s:19:"FIELD_LOAD_REVISION";a:1:{s:42:"field_revision_field_datetime_without_time";a:1:{s:5:"value";s:33:"field_datetime_without_time_value";}}}}}s:12:"foreign keys";a:0:{}s:7:"indexes";a:0:{}s:2:"id";s:1:"9";}', + 'cardinality' => '1', + 'translatable' => '0', + 'deleted' => '0', +)) +->values(array( + 'id' => '36', + 'field_name' => 'field_date_without_time', + 'type' => 'date', + 'module' => 'date', + 'active' => '1', + 'storage_type' => 'field_sql_storage', + 'storage_module' => 'field_sql_storage', + 'storage_active' => '1', + 'locked' => '0', + 'data' => 'a:7:{s:12:"translatable";s:1:"0";s:12:"entity_types";a:0:{}s:8:"settings";a:6:{s:11:"granularity";a:6:{s:5:"month";s:5:"month";s:3:"day";s:3:"day";s:4:"hour";i:0;s:6:"minute";i:0;s:4:"year";s:4:"year";s:6:"second";i:0;}s:11:"tz_handling";s:4:"site";s:11:"timezone_db";s:3:"UTC";s:13:"cache_enabled";i:0;s:11:"cache_count";s:1:"4";s:6:"todate";s:0:"";}s:7:"storage";a:5:{s:4:"type";s:17:"field_sql_storage";s:8:"settings";a:0:{}s:6:"module";s:17:"field_sql_storage";s:6:"active";s:1:"1";s:7:"details";a:1:{s:3:"sql";a:2:{s:18:"FIELD_LOAD_CURRENT";a:1:{s:34:"field_data_field_date_without_time";a:1:{s:5:"value";s:29:"field_date_without_time_value";}}s:19:"FIELD_LOAD_REVISION";a:1:{s:38:"field_revision_field_date_without_time";a:1:{s:5:"value";s:29:"field_date_without_time_value";}}}}}s:12:"foreign keys";a:0:{}s:7:"indexes";a:0:{}s:2:"id";s:1:"9";}', + 'cardinality' => '1', + 'translatable' => '0', + 'deleted' => '0', +)) ->execute(); $connection->schema()->createTable('field_config_instance', array( @@ -4158,6 +4188,24 @@ 'data' => 'a:7:{s:5:"label";s:31:"Text summary plain and filtered";s:6:"widget";a:5:{s:6:"weight";s:2:"14";s:4:"type";s:26:"text_textarea_with_summary";s:6:"module";s:4:"text";s:6:"active";i:1;s:8:"settings";a:2:{s:4:"rows";s:2:"20";s:12:"summary_rows";i:5;}}s:8:"settings";a:3:{s:15:"text_processing";s:1:"1";s:15:"display_summary";i:0;s:18:"user_register_form";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"text_default";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"weight";i:9;}}s:8:"required";i:0;s:11:"description";s:0:"";s:13:"default_value";N;}', 'deleted' => '0', )) +->values(array( + 'id' => '61', + 'field_id' => '35', + 'field_name' => 'field_datetime_without_time', + 'entity_type' => 'node', + 'bundle' => 'test_content_type', + 'data' => 'a:6:{s:5:"label";s:21:"Datetime without time";s:6:"widget";a:5:{s:6:"weight";s:1:"2";s:4:"type";s:11:"date_select";s:6:"module";s:4:"date";s:6:"active";i:1;s:8:"settings";a:6:{s:12:"input_format";s:13:"m/d/Y - H:i:s";s:19:"input_format_custom";s:0:"";s:10:"year_range";s:5:"-3:+3";s:9:"increment";s:2:"15";s:14:"label_position";s:5:"above";s:10:"text_parts";a:0:{}}}s:8:"settings";a:5:{s:13:"default_value";s:3:"now";s:18:"default_value_code";s:0:"";s:14:"default_value2";s:4:"same";s:19:"default_value_code2";s:0:"";s:18:"user_register_form";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"date_default";s:6:"weight";s:1:"3";s:8:"settings";a:5:{s:11:"format_type";s:4:"long";s:15:"multiple_number";s:0:"";s:13:"multiple_from";s:0:"";s:11:"multiple_to";s:0:"";s:6:"fromto";s:4:"both";}s:6:"module";s:4:"date";}}s:8:"required";i:0;s:11:"description";s:0:"";}', + 'deleted' => '0', +)) +->values(array( + 'id' => '62', + 'field_id' => '36', + 'field_name' => 'field_date_without_time', + 'entity_type' => 'node', + 'bundle' => 'test_content_type', + 'data' => 'a:6:{s:5:"label";s:17:"Date without time";s:6:"widget";a:5:{s:6:"weight";s:1:"2";s:4:"type";s:11:"date_select";s:6:"module";s:4:"date";s:6:"active";i:1;s:8:"settings";a:6:{s:12:"input_format";s:13:"m/d/Y - H:i:s";s:19:"input_format_custom";s:0:"";s:10:"year_range";s:5:"-3:+3";s:9:"increment";s:2:"15";s:14:"label_position";s:5:"above";s:10:"text_parts";a:0:{}}}s:8:"settings";a:5:{s:13:"default_value";s:3:"now";s:18:"default_value_code";s:0:"";s:14:"default_value2";s:4:"same";s:19:"default_value_code2";s:0:"";s:18:"user_register_form";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"date_default";s:6:"weight";s:1:"3";s:8:"settings";a:5:{s:11:"format_type";s:4:"long";s:15:"multiple_number";s:0:"";s:13:"multiple_from";s:0:"";s:11:"multiple_to";s:0:"";s:6:"fromto";s:4:"both";}s:6:"module";s:4:"date";}}s:8:"required";i:0;s:11:"description";s:0:"";}', + 'deleted' => '0', +)) ->execute(); $connection->schema()->createTable('field_data_body', array( @@ -4615,6 +4663,174 @@ )) ->execute(); +$connection->schema()->createTable('field_data_field_datetime_without_time', array( + 'fields' => array( + 'entity_type' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'bundle' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'deleted' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'default' => '0', + ), + 'entity_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'revision_id' => array( + 'type' => 'int', + 'not null' => FALSE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'language' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '32', + 'default' => '', + ), + 'delta' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'field_datetime_without_time_value' => array( + 'mysql_type' => 'datetime', + 'pgsql_type' => 'timestamp without time zone', + 'sqlite_type' => 'varchar', + 'sqlsrv_type' => 'smalldatetime', + 'not null' => FALSE, + ), + ), + 'primary key' => array( + 'entity_type', + 'deleted', + 'entity_id', + 'language', + 'delta', + ), + 'mysql_character_set' => 'utf8', +)); + +$connection->insert('field_data_field_datetime_without_time') +->fields(array( + 'entity_type', + 'bundle', + 'deleted', + 'entity_id', + 'revision_id', + 'language', + 'delta', + 'field_datetime_without_time_value', +)) +->values(array( + 'entity_type' => 'node', + 'bundle' => 'test_content_type', + 'deleted' => '0', + 'entity_id' => '1', + 'revision_id' => '1', + 'language' => 'und', + 'delta' => '0', + 'field_datetime_without_time_value' => '2015-01-20 00:00:00', +)) +->execute(); + +$connection->schema()->createTable('field_data_field_date_without_time', array( + 'fields' => array( + 'entity_type' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'bundle' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'deleted' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'default' => '0', + ), + 'entity_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'revision_id' => array( + 'type' => 'int', + 'not null' => FALSE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'language' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '32', + 'default' => '', + ), + 'delta' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'field_date_without_time_value' => array( + 'type' => 'varchar', + 'not null' => FALSE, + 'length' => '100', + ), + ), + 'primary key' => array( + 'entity_type', + 'deleted', + 'entity_id', + 'language', + 'delta', + ), + 'mysql_character_set' => 'utf8', +)); + +$connection->insert('field_data_field_date_without_time') +->fields(array( + 'entity_type', + 'bundle', + 'deleted', + 'entity_id', + 'revision_id', + 'language', + 'delta', + 'field_date_without_time_value', +)) +->values(array( + 'entity_type' => 'node', + 'bundle' => 'test_content_type', + 'deleted' => '0', + 'entity_id' => '1', + 'revision_id' => '1', + 'language' => 'und', + 'delta' => '0', + 'field_date_without_time_value' => '2015-01-20T00:00:00', +)) +->execute(); + $connection->schema()->createTable('field_data_field_email', array( 'fields' => array( 'entity_type' => array( @@ -7801,6 +8017,176 @@ )) ->execute(); +$connection->schema()->createTable('field_revision_field_datetime_without_time', array( + 'fields' => array( + 'entity_type' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'bundle' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'deleted' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'default' => '0', + ), + 'entity_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'revision_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'language' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '32', + 'default' => '', + ), + 'delta' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'field_datetime_without_time_value' => array( + 'mysql_type' => 'datetime', + 'pgsql_type' => 'timestamp without time zone', + 'sqlite_type' => 'varchar', + 'sqlsrv_type' => 'smalldatetime', + 'not null' => FALSE, + ), + ), + 'primary key' => array( + 'entity_type', + 'deleted', + 'entity_id', + 'revision_id', + 'language', + 'delta', + ), + 'mysql_character_set' => 'utf8', +)); + +$connection->insert('field_revision_field_datetime_without_time') +->fields(array( + 'entity_type', + 'bundle', + 'deleted', + 'entity_id', + 'revision_id', + 'language', + 'delta', + 'field_datetime_without_time_value', +)) +->values(array( + 'entity_type' => 'node', + 'bundle' => 'test_content_type', + 'deleted' => '0', + 'entity_id' => '1', + 'revision_id' => '1', + 'language' => 'und', + 'delta' => '0', + 'field_datetime_without_time_value' => '2015-01-20 00:00:00', +)) +->execute(); + +$connection->schema()->createTable('field_revision_field_date_without_time', array( + 'fields' => array( + 'entity_type' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'bundle' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'deleted' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'default' => '0', + ), + 'entity_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'revision_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'language' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '32', + 'default' => '', + ), + 'delta' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'field_date_without_time_value' => array( + 'type' => 'varchar', + 'not null' => FALSE, + 'length' => '100', + ), + ), + 'primary key' => array( + 'entity_type', + 'deleted', + 'entity_id', + 'revision_id', + 'language', + 'delta', + ), + 'mysql_character_set' => 'utf8', +)); + +$connection->insert('field_revision_field_date_without_time') +->fields(array( + 'entity_type', + 'bundle', + 'deleted', + 'entity_id', + 'revision_id', + 'language', + 'delta', + 'field_date_without_time_value', +)) +->values(array( + 'entity_type' => 'node', + 'bundle' => 'test_content_type', + 'deleted' => '0', + 'entity_id' => '1', + 'revision_id' => '1', + 'language' => 'und', + 'delta' => '0', + 'field_date_without_time_value' => '2015-01-20T00:00:00', +)) +->execute(); + $connection->schema()->createTable('field_revision_field_email', array( 'fields' => array( 'entity_type' => array( diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal_ui/migrate_drupal_ui.install --- a/core/modules/migrate_drupal_ui/migrate_drupal_ui.install Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal_ui/migrate_drupal_ui.install Fri Feb 23 15:52:07 2018 +0000 @@ -11,6 +11,6 @@ * Implements hook_install(). */ function migrate_drupal_ui_install() { - $url = Url::fromUri('base:upgrade')->toString(); + $url = Url::fromRoute('migrate_drupal_ui.upgrade')->toString(); drupal_set_message(t('The Migrate Drupal UI module has been enabled. Proceed to the upgrade form.', [':url' => $url])); } diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -236,7 +236,6 @@ $default_options = []; - $form['version'] = [ '#type' => 'radios', '#default_value' => 7, diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php --- a/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,6 +20,8 @@ /** * Use the Standard profile to test help implementations of many core modules. + * + * @var string */ protected $profile = 'standard'; diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,6 +15,8 @@ /** * Use the Standard profile to test help implementations of many core modules. + * + * @var string */ protected $profile = 'standard'; diff -r bfffd8d7479a -r 7a779792577d core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,8 +52,8 @@ 'configurable_language' => 4, 'contact_form' => 3, 'editor' => 2, - 'field_config' => 61, - 'field_storage_config' => 44, + 'field_config' => 63, + 'field_storage_config' => 46, 'file' => 3, 'filter_format' => 7, 'image_style' => 6, diff -r bfffd8d7479a -r 7a779792577d core/modules/node/node.install --- a/core/modules/node/node.install Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/node.install Fri Feb 23 15:52:07 2018 +0000 @@ -255,3 +255,15 @@ $schema['fields']['realm']['description'] = 'The realm in which the user must possess the grant ID. Modules can define one or more realms by implementing hook_node_grants().'; Database::getConnection()->schema()->changeField('node_access', 'realm', 'realm', $schema['fields']['realm']); } + +/** + * Run a node access rebuild, if required. + */ +function node_update_8401() { + // Get the list of node access modules. + $modules = \Drupal::moduleHandler()->getImplementations('node_grants'); + // If multilingual usage, then rebuild node access. + if (count($modules) > 0 && \Drupal::languageManager()->isMultilingual()) { + node_access_needs_rebuild(TRUE); + } +} diff -r bfffd8d7479a -r 7a779792577d core/modules/node/node.module --- a/core/modules/node/node.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/node.module Fri Feb 23 15:52:07 2018 +0000 @@ -133,7 +133,7 @@ case 'entity.entity_form_display.node.default': case 'entity.entity_form_display.node.form_mode': $type = $route_match->getParameter('node_type'); - return '

' . t('Content items can be edited using different form modes. Here, you can define which fields are shown and hidden when %type content is edited in each form mode, and define how the field form widgets are displayed in each form mode.', ['%type' => $type->label()]) . '

' ; + return '

' . t('Content items can be edited using different form modes. Here, you can define which fields are shown and hidden when %type content is edited in each form mode, and define how the field form widgets are displayed in each form mode.', ['%type' => $type->label()]) . '

'; case 'entity.entity_view_display.node.default': case 'entity.entity_view_display.node.view_mode': diff -r bfffd8d7479a -r 7a779792577d core/modules/node/src/NodeGrantDatabaseStorage.php --- a/core/modules/node/src/NodeGrantDatabaseStorage.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/src/NodeGrantDatabaseStorage.php Fri Feb 23 15:52:07 2018 +0000 @@ -211,6 +211,7 @@ $query = $this->database->insert('node_access')->fields(['nid', 'langcode', 'fallback', 'realm', 'gid', 'grant_view', 'grant_update', 'grant_delete']); // If we have defined a granted langcode, use it. But if not, add a grant // for every language this node is translated to. + $fallback_langcode = $node->getUntranslated()->language()->getId(); foreach ($grants as $grant) { if ($realm && $realm != $grant['realm']) { continue; @@ -227,7 +228,7 @@ $grant['nid'] = $node->id(); $grant['langcode'] = $grant_langcode; // The record with the original langcode is used as the fallback. - if ($grant['langcode'] == $node->language()->getId()) { + if ($grant['langcode'] == $fallback_langcode) { $grant['fallback'] = 1; } else { diff -r bfffd8d7479a -r 7a779792577d core/modules/node/src/NodeTranslationHandler.php --- a/core/modules/node/src/NodeTranslationHandler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/src/NodeTranslationHandler.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,10 +39,8 @@ } } if (isset($status_translatable)) { - foreach (['publish', 'unpublish', 'submit'] as $button) { - if (isset($form['actions'][$button])) { - $form['actions'][$button]['#value'] .= ' ' . ($status_translatable ? t('(this translation)') : t('(all translations)')); - } + if (isset($form['actions']['submit'])) { + $form['actions']['submit']['#value'] .= ' ' . ($status_translatable ? t('(this translation)') : t('(all translations)')); } } } diff -r bfffd8d7479a -r 7a779792577d core/modules/node/src/Plugin/Action/DeleteNode.php --- a/core/modules/node/src/Plugin/Action/DeleteNode.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/src/Plugin/Action/DeleteNode.php Fri Feb 23 15:52:07 2018 +0000 @@ -45,7 +45,7 @@ * The plugin implementation definition. * @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory * The tempstore factory. - * @param AccountInterface $current_user + * @param \Drupal\Core\Session\AccountInterface $current_user * Current user. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, PrivateTempStoreFactory $temp_store_factory, AccountInterface $current_user) { diff -r bfffd8d7479a -r 7a779792577d core/modules/node/src/Plugin/migrate/source/d6/ViewModeBase.php --- a/core/modules/node/src/Plugin/migrate/source/d6/ViewModeBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/src/Plugin/migrate/source/d6/ViewModeBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,7 +12,7 @@ /** * {@inheritdoc} */ - public function count() { + public function count($refresh = FALSE) { return count($this->initializeIterator()); } diff -r bfffd8d7479a -r 7a779792577d core/modules/node/src/Plugin/views/argument/Nid.php --- a/core/modules/node/src/Plugin/views/argument/Nid.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/src/Plugin/views/argument/Nid.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,7 +29,7 @@ * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param NodeStorageInterface $node_storage + * @param \Drupal\node\NodeStorageInterface $node_storage */ public function __construct(array $configuration, $plugin_id, $plugin_definition, NodeStorageInterface $node_storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); diff -r bfffd8d7479a -r 7a779792577d core/modules/node/src/Plugin/views/wizard/Node.php --- a/core/modules/node/src/Plugin/views/wizard/Node.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/src/Plugin/views/wizard/Node.php Fri Feb 23 15:52:07 2018 +0000 @@ -22,6 +22,8 @@ /** * Set the created column. + * + * @var string */ protected $createdColumn = 'node_field_data-created'; diff -r bfffd8d7479a -r 7a779792577d core/modules/node/src/Plugin/views/wizard/NodeRevision.php --- a/core/modules/node/src/Plugin/views/wizard/NodeRevision.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/src/Plugin/views/wizard/NodeRevision.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,6 +21,8 @@ /** * Set the created column. + * + * @var string */ protected $createdColumn = 'changed'; diff -r bfffd8d7479a -r 7a779792577d core/modules/node/src/Tests/NodeRevisionsTest.php --- a/core/modules/node/src/Tests/NodeRevisionsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/src/Tests/NodeRevisionsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -166,7 +166,6 @@ $expected = '
  • Delete
  • '; $this->assertTrue(strstr($json[$ids[0]], $expected), 'The "Delete" contextual link is shown for the default revision.'); - // Confirm that revisions revert properly. $this->drupalPostForm("node/" . $node->id() . "/revisions/" . $nodes[1]->getRevisionid() . "/revert", [], t('Revert')); $this->assertRaw(t('@type %title has been reverted to the revision from %revision-date.', [ @@ -191,7 +190,6 @@ $this->assertFalse(strstr($json[$ids[0]], '
  • '), 'The "Edit" contextual link is not shown for a non-default revision.'); $this->assertFalse(strstr($json[$ids[0]], '
  • '), 'The "Delete" contextual link is not shown for a non-default revision.'); - // Confirm revisions delete properly. $this->drupalPostForm("node/" . $node->id() . "/revisions/" . $nodes[1]->getRevisionId() . "/delete", [], t('Delete')); $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.', [ diff -r bfffd8d7479a -r 7a779792577d core/modules/node/tests/modules/node_access_test/node_access_test.module --- a/core/modules/node/tests/modules/node_access_test/node_access_test.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/node/tests/modules/node_access_test/node_access_test.module Fri Feb 23 15:52:07 2018 +0000 @@ -152,6 +152,12 @@ // Make all Catalan content secret. return AccessResult::forbidden()->setCacheMaxAge(0); } + + // Grant access if a specific user is specified. + if (\Drupal::state()->get('node_access_test.allow_uid') === $account->id()) { + return AccessResult::allowed(); + } + // No opinion. return AccessResult::neutral()->setCacheMaxAge(0); } diff -r bfffd8d7479a -r 7a779792577d core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,131 @@ +save(); + ConfigurableLanguage::createFromLangcode('ca')->save(); + ConfigurableLanguage::createFromLangcode('af')->save(); + + // Enable content translation for the current entity type. + \Drupal::service('content_translation.manager')->setEnabled('node', 'page', TRUE); + } + + /** + * Tests node access fallback handling with multiple node languages. + */ + public function testNodeAccessLanguageFallback() { + // The node_access_test module allows nodes to be marked private. We need to + // ensure that system honors the fallback system of node access properly. + // Note that node_access_test_language is language-sensitive and does not + // apply to the fallback test. + + // Create one node in Hungarian and marked as private. + $node = $this->drupalCreateNode([ + 'body' => [[]], + 'langcode' => 'hu', + 'private' => [['value' => 1]], + 'status' => 1, + ]); + + // There should be one entry in node_access, with fallback set to hu. + $this->checkRecords(1, 'hu'); + + // Create a translation user. + $admin = $this->drupalCreateUser([ + 'bypass node access', + 'administer nodes', + 'translate any entity', + 'administer content translation', + ]); + $this->drupalLogin($admin); + $this->drupalGet('node/' . $node->id() . '/translations'); + $this->assertSession()->statusCodeEquals(200); + + // Create a Catalan translation through the UI. + $url_options = ['language' => \Drupal::languageManager()->getLanguage('ca')]; + $this->drupalGet('node/' . $node->id() . '/translations/add/hu/ca', $url_options); + $this->assertSession()->statusCodeEquals(200); + // Save the form. + $this->getSession()->getPage()->pressButton('Save (this translation)'); + $this->assertSession()->statusCodeEquals(200); + + // Check the node access table. + $this->checkRecords(2, 'hu'); + + // Programmatically create a translation. This process lets us check that + // both forms and code behave in the same way. + $storage = \Drupal::entityTypeManager()->getStorage('node'); + // Reload the node. + $node = $storage->load(1); + // Create an Afrikaans translation. + $translation = $node->addTranslation('af'); + $translation->title->value = $this->randomString(); + $translation->status = 1; + $node->save(); + + // Check the node access table. + $this->checkRecords(3, 'hu'); + + // For completeness, edit the Catalan version again. + $this->drupalGet('node/' . $node->id() . '/edit', $url_options); + $this->assertSession()->statusCodeEquals(200); + // Save the form. + $this->getSession()->getPage()->pressButton('Save (this translation)'); + $this->assertSession()->statusCodeEquals(200); + // Check the node access table. + $this->checkRecords(3, 'hu'); + } + + /** + * Queries the node_access table and checks for proper storage. + * + * @param int $count + * The number of rows expected by the query (equal to the translation + * count). + * @param $langcode + * The expected language code set as the fallback property. + */ + public function checkRecords($count, $langcode = 'hu') { + $select = \Drupal::database() + ->select('node_access', 'na') + ->fields('na', ['nid', 'fallback', 'langcode', 'grant_view']) + ->condition('na.realm', 'node_access_test', '=') + ->condition('na.gid', 8888, '='); + $records = $select->execute()->fetchAll(); + // Check that the expected record count is returned. + $this->assertEquals(count($records), $count); + // The fallback value is 'hu' and should be set to 1. For other languages, + // it should be set to 0. Casting to boolean lets us run that comparison. + foreach ($records as $record) { + $this->assertEquals((bool) $record->fallback, $record->langcode === $langcode); + } + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/path/src/Form/DeleteForm.php --- a/core/modules/path/src/Form/DeleteForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/path/src/Form/DeleteForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,7 +16,7 @@ /** * The alias storage service. * - * @var AliasStorageInterface + * @var \Drupal\Core\Path\AliasStorageInterface */ protected $aliasStorage; diff -r bfffd8d7479a -r 7a779792577d core/modules/path/src/Form/PathFormBase.php --- a/core/modules/path/src/Form/PathFormBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/path/src/Form/PathFormBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -191,7 +191,6 @@ } } - if (!$this->pathValidator->isValid(trim($source, '/'))) { $form_state->setErrorByName('source', t("The path '@link_path' is either invalid or you do not have access to it.", ['@link_path' => $source])); } diff -r bfffd8d7479a -r 7a779792577d core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php --- a/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php Fri Feb 23 15:52:07 2018 +0000 @@ -5,12 +5,42 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Field\FieldItemList; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\TypedData\ComputedItemListTrait; /** * Represents a configurable entity path field. */ class PathFieldItemList extends FieldItemList { + use ComputedItemListTrait; + + /** + * {@inheritdoc} + */ + protected function computeValue() { + // Default the langcode to the current language if this is a new entity or + // there is no alias for an existent entity. + // @todo Set the langcode to not specified for untranslatable fields + // in https://www.drupal.org/node/2689459. + $value = ['langcode' => $this->getLangcode()]; + + $entity = $this->getEntity(); + if (!$entity->isNew()) { + // @todo Support loading languge neutral aliases in + // https://www.drupal.org/node/2511968. + $alias = \Drupal::service('path.alias_storage')->load([ + 'source' => '/' . $entity->toUrl()->getInternalPath(), + 'langcode' => $this->getLangcode(), + ]); + + if ($alias) { + $value = $alias; + } + } + + $this->list[0] = $this->createItem(0, $value); + } + /** * {@inheritdoc} */ @@ -34,42 +64,4 @@ \Drupal::service('path.alias_storage')->delete($conditions); } - /** - * {@inheritdoc} - */ - public function getValue($include_computed = FALSE) { - $this->ensureLoaded(); - return parent::getValue($include_computed); - } - - /** - * {@inheritdoc} - */ - public function isEmpty() { - $this->ensureLoaded(); - return parent::isEmpty(); - } - - /** - * {@inheritdoc} - */ - public function getIterator() { - $this->ensureLoaded(); - return parent::getIterator(); - } - - /** - * Automatically create the first item for computed fields. - * - * This ensures that ::getValue() and ::isEmpty() calls will behave like a - * non-computed field. - * - * @todo: Move this to the base class in https://www.drupal.org/node/2392845. - */ - protected function ensureLoaded() { - if (!isset($this->list[0]) && $this->definition->isComputed()) { - $this->list[0] = $this->createItem(0); - } - } - } diff -r bfffd8d7479a -r 7a779792577d core/modules/path/src/Plugin/Field/FieldType/PathItem.php --- a/core/modules/path/src/Plugin/Field/FieldType/PathItem.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/path/src/Plugin/Field/FieldType/PathItem.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,20 +24,6 @@ class PathItem extends FieldItemBase { /** - * Whether the alias has been loaded from the alias storage service yet. - * - * @var bool - */ - protected $isLoaded = FALSE; - - /** - * Whether the alias is currently being set. - * - * @var bool - */ - protected $isLoading = FALSE; - - /** * {@inheritdoc} */ public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { @@ -53,14 +39,6 @@ /** * {@inheritdoc} */ - public function __get($name) { - $this->ensureLoaded(); - return parent::__get($name); - } - - /** - * {@inheritdoc} - */ public static function schema(FieldStorageDefinitionInterface $field_definition) { return []; } @@ -68,73 +46,17 @@ /** * {@inheritdoc} */ - public function getValue() { - $this->ensureLoaded(); - return parent::getValue(); - } - - /** - * {@inheritdoc} - */ public function isEmpty() { - $this->ensureLoaded(); - return parent::isEmpty(); - } - - /** - * {@inheritdoc} - */ - public function getIterator() { - $this->ensureLoaded(); - return parent::getIterator(); + return ($this->alias === NULL || $this->alias === '') && ($this->pid === NULL || $this->pid === '') && ($this->langcode === NULL || $this->langcode === ''); } /** * {@inheritdoc} */ public function preSave() { - $this->alias = trim($this->alias); - } - - /** - * {@inheritdoc} - */ - public function __set($name, $value) { - // Also ensure that existing values are loaded when setting a value, this - // ensures that it is possible to set a new value immediately after loading - // an entity. - $this->ensureLoaded(); - parent::__set($name, $value); - } - - /** - * {@inheritdoc} - */ - public function set($property_name, $value, $notify = TRUE) { - // Also ensure that existing values are loaded when setting a value, this - // ensures that it is possible to set a new value immediately after loading - // an entity. - $this->ensureLoaded(); - return parent::set($property_name, $value, $notify); - } - - /** - * {@inheritdoc} - */ - public function get($property_name) { - $this->ensureLoaded(); - return parent::get($property_name); - } - - /** - * {@inheritdoc} - */ - public function setValue($values, $notify = TRUE) { - // Also ensure that existing values are loaded when setting a value, this - // ensures that it is possible to set a new value immediately after loading - // an entity. - $this->ensureLoaded(); - return parent::setValue($values, $notify); + if ($this->alias !== NULL) { + $this->alias = trim($this->alias); + } } /** @@ -178,42 +100,4 @@ return 'alias'; } - /** - * Ensures the alias properties are loaded if available. - * - * This ensures that the properties will always be loaded and act like - * non-computed fields when calling ::__get() and getValue(). - * - * @todo: Determine if this should be moved to the base class in - * https://www.drupal.org/node/2392845. - */ - protected function ensureLoaded() { - // Make sure to avoid a infinite loop if setValue() has be called from this - // block which calls ensureLoaded(). - if (!$this->isLoaded && !$this->isLoading) { - $entity = $this->getEntity(); - if (!$entity->isNew()) { - // @todo Support loading languge neutral aliases in - // https://www.drupal.org/node/2511968. - $alias = \Drupal::service('path.alias_storage')->load([ - 'source' => '/' . $entity->toUrl()->getInternalPath(), - 'langcode' => $this->getLangcode(), - ]); - if ($alias) { - $this->isLoading = TRUE; - $this->setValue($alias); - $this->isLoading = FALSE; - } - else { - // If there is no existing alias, default the langcode to the current - // language. - // @todo Set the langcode to not specified for untranslatable fields - // in https://www.drupal.org/node/2689459. - $this->langcode = $this->getLangcode(); - } - } - $this->isLoaded = TRUE; - } - } - } diff -r bfffd8d7479a -r 7a779792577d core/modules/path/tests/src/Kernel/PathItemTest.php --- a/core/modules/path/tests/src/Kernel/PathItemTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/path/tests/src/Kernel/PathItemTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -171,6 +171,24 @@ $this->assertEquals('/foobar', $loaded_node->get('path')->alias); $stored_alias = $alias_storage->lookupPathAlias('/' . $node->toUrl()->getInternalPath(), $node->language()->getId()); $this->assertEquals('/foobar', $stored_alias); + + // Check that \Drupal\Core\Field\FieldItemList::equals() for the path field + // type. + $node = Node::create([ + 'title' => $this->randomString(), + 'type' => 'foo', + 'path' => ['alias' => '/foo'], + ]); + $second_node = Node::create([ + 'title' => $this->randomString(), + 'type' => 'foo', + 'path' => ['alias' => '/foo'], + ]); + $this->assertTrue($node->get('path')->equals($second_node->get('path'))); + + // Change the alias for the second node to a different one and try again. + $second_node->get('path')->alias = '/foobar'; + $this->assertFalse($node->get('path')->equals($second_node->get('path'))); } } diff -r bfffd8d7479a -r 7a779792577d core/modules/quickedit/quickedit.module --- a/core/modules/quickedit/quickedit.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/quickedit/quickedit.module Fri Feb 23 15:52:07 2018 +0000 @@ -180,18 +180,16 @@ * @internal */ function _quickedit_entity_is_latest_revision(ContentEntityInterface $entity) { - $entity_type_manager = \Drupal::entityTypeManager(); - $entity_definition = $entity_type_manager->getDefinition($entity->getEntityTypeId()); - if (!$entity_definition->isRevisionable()) { + if (!$entity->getEntityType()->isRevisionable() || $entity->isNew()) { return TRUE; } - $revision_ids = $entity_type_manager + + $latest_revision = \Drupal::entityTypeManager() ->getStorage($entity->getEntityTypeId()) ->getQuery() - ->allRevisions() - ->condition($entity_definition->getKey('id'), $entity->id()) - ->sort($entity_definition->getKey('revision'), 'DESC') - ->range(0, 1) + ->latestRevision() + ->condition($entity->getEntityType()->getKey('id'), $entity->id()) ->execute(); - return $entity->getLoadedRevisionId() == array_keys($revision_ids)[0]; + + return !empty($latest_revision) && $entity->getLoadedRevisionId() == key($latest_revision) ? TRUE : FALSE; } diff -r bfffd8d7479a -r 7a779792577d core/modules/quickedit/src/Tests/QuickEditLoadingTest.php --- a/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -330,6 +330,13 @@ public function testWithPendingRevision() { $this->drupalLogin($this->editorUser); + // Verify that the preview is loaded correctly. + $this->drupalPostForm('node/add/article', ['title[0][value]' => 'foo'], 'Preview'); + $this->assertResponse(200); + // Verify that quickedit is not active on preview. + $this->assertNoRaw('data-quickedit-entity-id="node/' . $this->testNode->id() . '"'); + $this->assertNoRaw('data-quickedit-field-id="node/' . $this->testNode->id() . '/title/' . $this->testNode->language()->getId() . '/full"'); + $this->drupalGet('node/' . $this->testNode->id()); $this->assertRaw('data-quickedit-entity-id="node/' . $this->testNode->id() . '"'); $this->assertRaw('data-quickedit-field-id="node/' . $this->testNode->id() . '/title/' . $this->testNode->language()->getId() . '/full"'); @@ -340,6 +347,7 @@ $this->testNode->save(); $this->drupalGet('node/' . $this->testNode->id()); + $this->assertResponse(200); $this->assertNoRaw('data-quickedit-entity-id="node/' . $this->testNode->id() . '"'); $this->assertNoRaw('data-quickedit-field-id="node/' . $this->testNode->id() . '/title/' . $this->testNode->language()->getId() . '/full"'); } diff -r bfffd8d7479a -r 7a779792577d core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php --- a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,7 +32,7 @@ class ResponsiveImageFormatter extends ImageFormatterBase implements ContainerFactoryPluginInterface { /** - * @var EntityStorageInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $responsiveImageStyleStorage; diff -r bfffd8d7479a -r 7a779792577d core/modules/rest/src/Plugin/Type/ResourcePluginManager.php --- a/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -43,7 +43,7 @@ * * @see https://www.drupal.org/node/2874934 */ - public function getInstance(array $options){ + public function getInstance(array $options) { if (isset($options['id'])) { return $this->createInstance($options['id']); } diff -r bfffd8d7479a -r 7a779792577d core/modules/rest/src/RequestHandler.php --- a/core/modules/rest/src/RequestHandler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/rest/src/RequestHandler.php Fri Feb 23 15:52:07 2018 +0000 @@ -74,7 +74,6 @@ $method = strtolower($route_match->getRouteObject()->getMethods()[0]); assert(count($route_match->getRouteObject()->getMethods()) === 1); - $resource_config_id = $route_match->getRouteObject()->getDefault('_rest_resource_config'); /** @var \Drupal\rest\RestResourceConfigInterface $resource_config */ $resource_config = $this->resourceStorage->load($resource_config_id); diff -r bfffd8d7479a -r 7a779792577d core/modules/rest/tests/src/Functional/AnonResourceTestTrait.php --- a/core/modules/rest/tests/src/Functional/AnonResourceTestTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/rest/tests/src/Functional/AnonResourceTestTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,6 +31,7 @@ /** * {@inheritdoc} */ - protected function assertAuthenticationEdgeCases($method, Url $url, array $request_options) {} + protected function assertAuthenticationEdgeCases($method, Url $url, array $request_options) { + } } diff -r bfffd8d7479a -r 7a779792577d core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php --- a/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,6 +38,7 @@ /** * {@inheritdoc} */ - protected function assertAuthenticationEdgeCases($method, Url $url, array $request_options) {} + protected function assertAuthenticationEdgeCases($method, Url $url, array $request_options) { + } } diff -r bfffd8d7479a -r 7a779792577d core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php --- a/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -109,23 +109,18 @@ return; } - unset($request_options[RequestOptions::HEADERS]['X-CSRF-Token']); - // DX: 403 when missing X-CSRF-Token request header. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(403, 'X-CSRF-Token request header is missing', $response); - $request_options[RequestOptions::HEADERS]['X-CSRF-Token'] = 'this-is-not-the-token-you-are-looking-for'; - // DX: 403 when invalid X-CSRF-Token request header. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(403, 'X-CSRF-Token request header is invalid', $response); - $request_options[RequestOptions::HEADERS]['X-CSRF-Token'] = $this->csrfToken; } diff -r bfffd8d7479a -r 7a779792577d core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -301,17 +301,14 @@ $url = $this->getEntityResourceUrl(); $request_options = []; - // DX: 404 when resource not provisioned, 403 if canonical route. HTML // response because missing ?_format query string. $response = $this->request('GET', $url, $request_options); $this->assertSame($has_canonical_url ? 403 : 404, $response->getStatusCode()); $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); - $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when resource not provisioned, 403 if canonical route. Non-HTML // response because ?_format query string is present. $response = $this->request('GET', $url, $request_options); @@ -322,12 +319,10 @@ $this->assertResourceErrorResponse(404, 'No route found for "GET ' . str_replace($this->baseUrl, '', $this->getEntityResourceUrl()->setAbsolute()->toString()) . '"', $response); } - $this->provisionEntityResource(); // Simulate the developer again forgetting the ?_format query string. $url->setOption('query', []); - // DX: 406 when ?_format is missing, except when requesting a canonical HTML // route. $response = $this->request('GET', $url, $request_options); @@ -338,10 +333,8 @@ $this->assert406Response($response); } - $url->setOption('query', ['_format' => static::$format]); - // DX: forgetting authentication: authentication provider-specific error // response. if (static::$auth) { @@ -365,16 +358,13 @@ unset($request_options[RequestOptions::HEADERS]['REST-test-auth-global']); $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('GET')); - // DX: 403 when unauthorized. $response = $this->request('GET', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('GET'), $response); $this->assertArrayNotHasKey('Link', $response->getHeaders()); - $this->setUpAuthorization('GET'); - // 200 for well-formed HEAD request. $response = $this->request('HEAD', $url, $request_options); $this->assertResourceResponse(200, '', $response); @@ -508,11 +498,9 @@ // PrimitiveDataNormalizer. $this->rebuildAll(); - $response = $this->request('GET', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - // Again do an identical comparison, but this time transform the expected // normalized entity's values to strings. This ensures the BC layer for // bc_primitives_as_strings works as expected. @@ -542,11 +530,9 @@ // TimestampItemNormalizer. $this->rebuildAll(); - $response = $this->request('GET', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - // This ensures the BC layer for bc_timestamp_normalizer_unix works as // expected. This method should be using // ::formatExpectedTimestampValue() to generate the timestamp value. This @@ -564,75 +550,59 @@ $this->rebuildAll(); } - // BC: rest_update_8203(). $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); - // DX: 403 when unauthorized. $response = $this->request('GET', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('GET'), $response); - $this->grantPermissionsToTestedRole(['restful get entity:' . static::$entityTypeId]); - // 200 for well-formed request. $response = $this->request('GET', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - $this->resourceConfigStorage->load(static::$resourceConfigId)->disable()->save(); $this->refreshTestStateAfterRestConfigChange(); - // DX: upon disabling a resource, it's immediately no longer available. $this->assertResourceNotAvailable($url, $request_options); - $this->resourceConfigStorage->load(static::$resourceConfigId)->enable()->save(); $this->refreshTestStateAfterRestConfigChange(); - // DX: upon re-enabling a resource, immediate 200. $response = $this->request('GET', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - $this->resourceConfigStorage->load(static::$resourceConfigId)->delete(); $this->refreshTestStateAfterRestConfigChange(); - // DX: upon deleting a resource, it's immediately no longer available. $this->assertResourceNotAvailable($url, $request_options); - $this->provisionEntityResource(); $url->setOption('query', ['_format' => 'non_existing_format']); - // DX: 406 when requesting unsupported format. $response = $this->request('GET', $url, $request_options); $this->assert406Response($response); $this->assertSame(['text/plain; charset=UTF-8'], $response->getHeader('Content-Type')); - $request_options[RequestOptions::HEADERS]['Accept'] = static::$mimeType; - // DX: 406 when requesting unsupported format but specifying Accept header: // should result in a text/plain response. $response = $this->request('GET', $url, $request_options); $this->assert406Response($response); $this->assertSame(['text/plain; charset=UTF-8'], $response->getHeader('Content-Type')); - $url = Url::fromRoute('rest.entity.' . static::$entityTypeId . '.GET.' . static::$format); $url->setRouteParameter(static::$entityTypeId, 987654321); $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when GETting non-existing entity. $response = $this->request('GET', $url, $request_options); $path = str_replace('987654321', '{' . static::$entityTypeId . '}', $url->setAbsolute()->setOptions(['base_url' => '', 'query' => []])->toString()); @@ -714,27 +684,22 @@ $url = $this->getEntityResourcePostUrl(); $request_options = []; - // DX: 404 when resource not provisioned. HTML response because missing // ?_format query string. $response = $this->request('POST', $url, $request_options); $this->assertSame(404, $response->getStatusCode()); $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); - $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when resource not provisioned. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(404, 'No route found for "POST ' . str_replace($this->baseUrl, '', $this->getEntityResourcePostUrl()->setAbsolute()->toString()) . '"', $response); - $this->provisionEntityResource(); // Simulate the developer again forgetting the ?_format query string. $url->setOption('query', []); - // DX: 415 when no Content-Type request header. HTML response because // missing ?_format query string. $response = $this->request('POST', $url, $request_options); @@ -742,34 +707,26 @@ $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); $this->assertContains('A client error happened', (string) $response->getBody()); - $url->setOption('query', ['_format' => static::$format]); - // DX: 415 when no Content-Type request header. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(415, 'No "Content-Type" request header specified', $response); - $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType; - // DX: 400 when no request body. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(400, 'No entity content received.', $response); - $request_options[RequestOptions::BODY] = $unparseable_request_body; - // DX: 400 when unparseable request body. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(400, 'Syntax error', $response); - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body; - if (static::$auth) { // DX: forgetting authentication: authentication provider-specific error // response. @@ -777,28 +734,22 @@ $this->assertResponseWhenMissingAuthentication($response); } - $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('POST')); - // DX: 403 when unauthorized. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('POST'), $response); - $this->setUpAuthorization('POST'); - // DX: 422 when invalid entity: multiple values sent for single-value field. $response = $this->request('POST', $url, $request_options); $label_field = $this->entity->getEntityType()->hasKey('label') ? $this->entity->getEntityType()->getKey('label') : static::$labelFieldName; $label_field_capitalized = $this->entity->getFieldDefinition($label_field)->getLabel(); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\n$label_field: $label_field_capitalized: this field cannot hold more than 1 values.\n", $response); - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body_2; - // DX: 422 when invalid entity: UUID field too long. // @todo Fix this in https://www.drupal.org/node/2149851. if ($this->entity->getEntityType()->hasKey('uuid')) { @@ -806,35 +757,27 @@ $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nuuid.0.value: UUID: may not be longer than 128 characters.\n", $response); } - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body_3; - // DX: 403 when entity contains field without 'edit' access. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(403, "Access denied on creating field 'field_rest_test'.", $response); - $request_options[RequestOptions::BODY] = $parseable_valid_request_body; - // Before sending a well-formed request, allow the normalization and // authentication provider edge cases to also be tested. $this->assertNormalizationEdgeCases('POST', $url, $request_options); $this->assertAuthenticationEdgeCases('POST', $url, $request_options); - $request_options[RequestOptions::HEADERS]['Content-Type'] = 'text/xml'; - // DX: 415 when request body in existing but not allowed format. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(415, 'No route found that matches "Content-Type: text/xml"', $response); - $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType; - // 201 for well-formed request. $response = $this->request('POST', $url, $request_options); $this->assertResourceResponse(201, FALSE, $response); @@ -866,20 +809,16 @@ } } - $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); $request_options[RequestOptions::BODY] = $parseable_valid_request_body_2; - // DX: 403 when unauthorized. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('POST'), $response); - $this->grantPermissionsToTestedRole(['restful post entity:' . static::$entityTypeId]); - // 201 for well-formed request. // Delete the first created entity in case there is a uniqueness constraint. $this->entityStorage->load(static::$firstCreatedEntityId)->delete(); @@ -934,7 +873,6 @@ $url = $this->getEntityResourceUrl(); $request_options = []; - // DX: 404 when resource not provisioned, 405 if canonical route. Plain text // or HTML response because missing ?_format query string. $response = $this->request('PATCH', $url, $request_options); @@ -949,10 +887,8 @@ $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); } - $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when resource not provisioned, 405 if canonical route. $response = $this->request('PATCH', $url, $request_options); if ($has_canonical_url) { @@ -962,46 +898,36 @@ $this->assertResourceErrorResponse(404, 'No route found for "PATCH ' . str_replace($this->baseUrl, '', $this->getEntityResourceUrl()->setAbsolute()->toString()) . '"', $response); } - $this->provisionEntityResource(); // Simulate the developer again forgetting the ?_format query string. $url->setOption('query', []); - // DX: 415 when no Content-Type request header. $response = $this->request('PATCH', $url, $request_options); $this->assertSame(415, $response->getStatusCode()); $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); $this->assertContains('A client error happened', (string) $response->getBody()); - $url->setOption('query', ['_format' => static::$format]); - // DX: 415 when no Content-Type request header. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(415, 'No "Content-Type" request header specified', $response); - $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType; - // DX: 400 when no request body. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(400, 'No entity content received.', $response); - $request_options[RequestOptions::BODY] = $unparseable_request_body; - // DX: 400 when unparseable request body. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(400, 'Syntax error', $response); - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body; - if (static::$auth) { // DX: forgetting authentication: authentication provider-specific error // response. @@ -1009,33 +935,26 @@ $this->assertResponseWhenMissingAuthentication($response); } - $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('PATCH')); - // DX: 403 when unauthorized. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('PATCH'), $response); - $this->setUpAuthorization('PATCH'); - // DX: 422 when invalid entity: multiple values sent for single-value field. $response = $this->request('PATCH', $url, $request_options); $label_field = $this->entity->getEntityType()->hasKey('label') ? $this->entity->getEntityType()->getKey('label') : static::$labelFieldName; $label_field_capitalized = $this->entity->getFieldDefinition($label_field)->getLabel(); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\n$label_field: $label_field_capitalized: this field cannot hold more than 1 values.\n", $response); - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body_2; - // DX: 403 when entity contains field without 'edit' access. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(403, "Access denied on updating field 'field_rest_test'.", $response); - // DX: 403 when sending PATCH request with read-only fields. // First send all fields (the "maximum normalization"). Assert the expected // error message for the first PATCH-protected field. Remove that field from @@ -1055,27 +974,21 @@ $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - $request_options[RequestOptions::BODY] = $parseable_valid_request_body; - // Before sending a well-formed request, allow the normalization and // authentication provider edge cases to also be tested. $this->assertNormalizationEdgeCases('PATCH', $url, $request_options); $this->assertAuthenticationEdgeCases('PATCH', $url, $request_options); - $request_options[RequestOptions::HEADERS]['Content-Type'] = 'text/xml'; - // DX: 415 when request body in existing but not allowed format. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(415, 'No route found that matches "Content-Type: text/xml"', $response); - $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType; - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); @@ -1100,20 +1013,16 @@ // is not sent in the PATCH request. $this->assertSame('All the faith he had had had had no effect on the outcome of his life.', $updated_entity->get('field_rest_test')->value); - $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); $request_options[RequestOptions::BODY] = $parseable_valid_request_body_2; - // DX: 403 when unauthorized. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('PATCH'), $response); - $this->grantPermissionsToTestedRole(['restful patch entity:' . static::$entityTypeId]); - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); @@ -1141,7 +1050,6 @@ $url = $this->getEntityResourceUrl(); $request_options = []; - // DX: 404 when resource not provisioned, but 405 if canonical route. Plain // text or HTML response because missing ?_format query string. $response = $this->request('DELETE', $url, $request_options); @@ -1156,10 +1064,8 @@ $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); } - $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when resource not provisioned, 405 if canonical route. $response = $this->request('DELETE', $url, $request_options); if ($has_canonical_url) { @@ -1172,7 +1078,6 @@ $this->provisionEntityResource(); - if (static::$auth) { // DX: forgetting authentication: authentication provider-specific error // response. @@ -1180,23 +1085,18 @@ $this->assertResponseWhenMissingAuthentication($response); } - $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('PATCH')); - // DX: 403 when unauthorized. $response = $this->request('DELETE', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('DELETE'), $response); - $this->setUpAuthorization('DELETE'); - // Before sending a well-formed request, allow the authentication provider's // edge cases to also be tested. $this->assertAuthenticationEdgeCases('DELETE', $url, $request_options); - // 204 for well-formed request. $response = $this->request('DELETE', $url, $request_options); $this->assertSame(204, $response->getStatusCode()); @@ -1208,21 +1108,17 @@ $this->assertSame('', (string) $response->getBody()); $this->assertFalse($response->hasHeader('X-Drupal-Cache')); - $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); $this->entity = $this->createEntity(); $url = $this->getEntityResourceUrl()->setOption('query', $url->getOption('query')); - // DX: 403 when unauthorized. $response = $this->request('DELETE', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('DELETE'), $response); - $this->grantPermissionsToTestedRole(['restful delete entity:' . static::$entityTypeId]); - // 204 for well-formed request. $response = $this->request('DELETE', $url, $request_options); $this->assertSame(204, $response->getStatusCode()); @@ -1249,17 +1145,14 @@ $normalization[$bundle_field_name] = 'bad_bundle_name'; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when incorrect entity type bundle is specified. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(422, '"bad_bundle_name" is not a valid bundle type for denormalization.', $response); } - unset($normalization[$bundle_field_name]); $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when no entity type bundle is specified. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(422, sprintf('Could not determine entity type bundle: "%s" field is missing.', $bundle_field_name), $response); diff -r bfffd8d7479a -r 7a779792577d core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php --- a/core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -144,7 +144,6 @@ // @todo Remove the array_diff_key() call in https://www.drupal.org/node/2821077. $original_normalization = array_diff_key($this->serializer->normalize($user, static::$format), ['created' => TRUE, 'changed' => TRUE, 'name' => TRUE]); - // Since this test must be performed by the user that is being modified, // we cannot use $this->getUrl(). $url = $user->toUrl()->setOption('query', ['_format' => static::$format]); @@ -153,18 +152,15 @@ ]; $request_options = array_merge_recursive($request_options, $this->getAuthenticationRequestOptions('PATCH')); - // Test case 1: changing email. $normalization = $original_normalization; $normalization['mail'] = [['value' => 'new-email@example.com']]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when changing email without providing the password. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nmail: Your current password is missing or incorrect; it's required to change the Email.\n", $response); - $normalization['pass'] = [['existing' => 'wrong']]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); @@ -172,41 +168,33 @@ $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nmail: Your current password is missing or incorrect; it's required to change the Email.\n", $response); - $normalization['pass'] = [['existing' => $this->account->passRaw]]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - // Test case 2: changing password. $normalization = $original_normalization; $new_password = $this->randomString(); $normalization['pass'] = [['value' => $new_password]]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when changing password without providing the current password. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\npass: Your current password is missing or incorrect; it's required to change the Password.\n", $response); - $normalization['pass'][0]['existing'] = $this->account->pass_raw; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - // Verify that we can log in with the new password. $this->assertRpcLogin($user->getAccountName(), $new_password); - // Update password in $this->account, prepare for future requests. $this->account->passRaw = $new_password; $this->initAuthentication(); @@ -215,21 +203,17 @@ ]; $request_options = array_merge_recursive($request_options, $this->getAuthenticationRequestOptions('PATCH')); - // Test case 3: changing name. $normalization = $original_normalization; $normalization['name'] = [['value' => 'Cooler Llama']]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 403 when modifying username without required permission. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(403, "Access denied on updating field 'name'.", $response); - $this->grantPermissionsToTestedRole(['change own username']); - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); diff -r bfffd8d7479a -r 7a779792577d core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php --- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -124,7 +124,6 @@ $this->assertIdentical($actual_json, json_encode($expected), 'The expected JSON output was found.'); - // Test that the rendered output and the preview output are the same. $view->destroy(); $view->setDisplay('rest_export_1'); diff -r bfffd8d7479a -r 7a779792577d core/modules/search/search.module --- a/core/modules/search/search.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/search/search.module Fri Feb 23 15:52:07 2018 +0000 @@ -107,6 +107,13 @@ } /** + * Implements hook_theme_suggestions_HOOK(). + */ +function search_theme_suggestions_search_result(array $variables) { + return ['search_result__' . $variables['plugin_id']]; +} + +/** * Implements hook_preprocess_HOOK() for block templates. */ function search_preprocess_block(&$variables) { diff -r bfffd8d7479a -r 7a779792577d core/modules/search/search.pages.inc --- a/core/modules/search/search.pages.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/search/search.pages.inc Fri Feb 23 15:52:07 2018 +0000 @@ -9,13 +9,6 @@ use Drupal\Core\Language\LanguageInterface; /** - * Implements hook_theme_suggestions_HOOK(). - */ -function search_theme_suggestions_search_result(array $variables) { - return ['search_result__' . $variables['plugin_id']]; -} - -/** * Prepares variables for individual search result templates. * * Default template: search-result.html.twig diff -r bfffd8d7479a -r 7a779792577d core/modules/search/src/Plugin/views/filter/Search.php --- a/core/modules/search/src/Plugin/views/filter/Search.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/search/src/Plugin/views/filter/Search.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,6 +34,8 @@ /** * TRUE if the search query has been parsed. + * + * @var bool */ protected $parsed = FALSE; diff -r bfffd8d7479a -r 7a779792577d core/modules/search/src/SearchQuery.php --- a/core/modules/search/src/SearchQuery.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/search/src/SearchQuery.php Fri Feb 23 15:52:07 2018 +0000 @@ -571,7 +571,6 @@ } } - // Add arguments for the keyword relevance normalization number. $normalization = 1.0 / $this->normalize; for ($i = 0; $i < $this->relevance_count; $i++) { diff -r bfffd8d7479a -r 7a779792577d core/modules/search/src/Tests/SearchPageCacheTagsTest.php --- a/core/modules/search/src/Tests/SearchPageCacheTagsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/search/src/Tests/SearchPageCacheTagsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -122,7 +122,6 @@ $this->container->get('module_installer')->install(['field_ui', 'entity_reference']); $this->resetAll(); - // Creates a new content type that will have an entity reference. $type_name = 'entity_reference_test'; $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]); diff -r bfffd8d7479a -r 7a779792577d core/modules/serialization/serialization.install --- a/core/modules/serialization/serialization.install Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/serialization/serialization.install Fri Feb 23 15:52:07 2018 +0000 @@ -33,7 +33,8 @@ /** * @see hal_update_8301() */ -function serialization_update_8301() {} +function serialization_update_8301() { +} /** * Add serialization.settings::bc_primitives_as_strings configuration. diff -r bfffd8d7479a -r 7a779792577d core/modules/serialization/src/Encoder/XmlEncoder.php --- a/core/modules/serialization/src/Encoder/XmlEncoder.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/serialization/src/Encoder/XmlEncoder.php Fri Feb 23 15:52:07 2018 +0000 @@ -56,7 +56,7 @@ /** * {@inheritdoc} */ - public function encode($data, $format, array $context = []){ + public function encode($data, $format, array $context = []) { return $this->getBaseEncoder()->encode($data, $format, $context); } @@ -70,7 +70,7 @@ /** * {@inheritdoc} */ - public function decode($data, $format, array $context = []){ + public function decode($data, $format, array $context = []) { return $this->getBaseEncoder()->decode($data, $format, $context); } diff -r bfffd8d7479a -r 7a779792577d core/modules/serialization/src/Normalizer/FieldNormalizer.php --- a/core/modules/serialization/src/Normalizer/FieldNormalizer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/serialization/src/Normalizer/FieldNormalizer.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,7 +35,7 @@ throw new InvalidArgumentException('The field passed in via $context[\'target_instance\'] must have a parent set.'); } - /** @var FieldItemListInterface $items */ + /** @var \Drupal\Core\Field\FieldItemListInterface $items */ $items = $context['target_instance']; $item_class = $items->getItemDefinition()->getClass(); diff -r bfffd8d7479a -r 7a779792577d core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php --- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -241,7 +241,6 @@ ->willReturn('field_reference') ->shouldBeCalled(); - $this->assertDenormalize($data); } @@ -261,7 +260,6 @@ ->willReturn('field_reference') ->shouldBeCalled(); - $this->assertDenormalize($data); } diff -r bfffd8d7479a -r 7a779792577d core/modules/settings_tray/css/off-canvas.base.css --- a/core/modules/settings_tray/css/off-canvas.base.css Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/settings_tray/css/off-canvas.base.css Fri Feb 23 15:52:07 2018 +0000 @@ -149,7 +149,7 @@ #drupal-off-canvas ol li { display: block; } -#drupal-off-canvas quote, +#drupal-off-canvas blockquote, #drupal-off-canvas code { margin: 20px 0; } diff -r bfffd8d7479a -r 7a779792577d core/modules/settings_tray/js/settings_tray.es6.js --- a/core/modules/settings_tray/js/settings_tray.es6.js Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/settings_tray/js/settings_tray.es6.js Fri Feb 23 15:52:07 2018 +0000 @@ -175,9 +175,9 @@ */ Drupal.attachBehaviors(data.$el[0]); /** - * Bind a listener to all 'Quick edit' links for blocks. Click "Edit" button - * in toolbar to force Contextual Edit which starts Settings Tray edit - * mode also. + * Bind a listener to all 'Quick edit' links for blocks. Click "Edit" + * button in toolbar to force Contextual Edit which starts Settings Tray + * edit mode also. */ data.$el.find(blockConfigureSelector) .on('click.settingstray', () => { @@ -202,7 +202,8 @@ }); /** - * Toggle the js-settings-tray-edit-mode class on items that we want to disable while in edit mode. + * Toggle the js-settings-tray-edit-mode class on items that we want to + * disable while in edit mode. * * @type {Drupal~behavior} * diff -r bfffd8d7479a -r 7a779792577d core/modules/settings_tray/src/Form/SystemBrandingOffCanvasForm.php --- a/core/modules/settings_tray/src/Form/SystemBrandingOffCanvasForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/settings_tray/src/Form/SystemBrandingOffCanvasForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -6,6 +6,7 @@ use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\PluginFormBase; +use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -32,13 +33,23 @@ protected $configFactory; /** + * The current user. + * + * @var \Drupal\Core\Session\AccountInterface + */ + protected $currentUser; + + /** * SystemBrandingOffCanvasForm constructor. * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. + * @param \Drupal\Core\Session\AccountInterface $current_user + * The current user. */ - public function __construct(ConfigFactoryInterface $config_factory) { + public function __construct(ConfigFactoryInterface $config_factory, AccountInterface $current_user) { $this->configFactory = $config_factory; + $this->currentUser = $current_user; } /** @@ -46,7 +57,8 @@ */ public static function create(ContainerInterface $container) { return new static( - $container->get('config.factory') + $container->get('config.factory'), + $container->get('current_user') ); } @@ -67,6 +79,7 @@ '#type' => 'details', '#title' => t('Site details'), '#open' => TRUE, + '#access' => $this->currentUser->hasPermission('administer site configuration'), ]; $form['site_information']['site_name'] = [ '#type' => 'textfield', diff -r bfffd8d7479a -r 7a779792577d core/modules/settings_tray/src/Form/SystemMenuOffCanvasForm.php --- a/core/modules/settings_tray/src/Form/SystemMenuOffCanvasForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/settings_tray/src/Form/SystemMenuOffCanvasForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -87,6 +87,7 @@ '#type' => 'details', '#title' => $this->t('Edit menu %label', ['%label' => $this->menu->label()]), '#open' => TRUE, + '#access' => $this->menu->access('edit'), ]; $form['entity_form'] += $this->getEntityForm($this->menu)->buildForm([], $form_state); diff -r bfffd8d7479a -r 7a779792577d core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php --- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -5,10 +5,13 @@ use Drupal\block\Entity\Block; use Drupal\block_content\Entity\BlockContent; use Drupal\block_content\Entity\BlockContentType; +use Drupal\menu_link_content\Entity\MenuLinkContent; use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationIsClassBlock; use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationNoneBlock; +use Drupal\system\Entity\Menu; use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait; use Drupal\user\Entity\Role; +use Drupal\user\RoleInterface; /** * Testing opening and saving block forms in the off-canvas dialog. @@ -34,7 +37,6 @@ 'toolbar', 'contextual', 'settings_tray', - 'quickedit', 'search', 'block_content', 'settings_tray_test', @@ -42,6 +44,8 @@ // cause test failures. 'settings_tray_test_css', 'settings_tray_test', + 'menu_link_content', + 'menu_ui', ]; /** @@ -57,7 +61,6 @@ 'access contextual links', 'access toolbar', 'administer nodes', - 'access in-place editing', 'search content', ]); $this->drupalLogin($user); @@ -69,7 +72,11 @@ * * @dataProvider providerTestBlocks */ - public function testBlocks($theme, $block_plugin, $new_page_text, $element_selector, $label_selector, $button_text, $toolbar_item) { + public function testBlocks($theme, $block_plugin, $new_page_text, $element_selector, $label_selector, $button_text, $toolbar_item, $permissions) { + if ($permissions) { + $this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), $permissions); + } + $web_assert = $this->assertSession(); $page = $this->getSession()->getPage(); $this->enableTheme($theme); @@ -170,6 +177,7 @@ 'label_selector' => 'h2', 'button_text' => 'Save Powered by Drupal', 'toolbar_item' => '#toolbar-item-user', + NULL, ], "$theme: block-branding" => [ 'theme' => $theme, @@ -179,6 +187,7 @@ 'label_selector' => "a[rel='home']:last-child", 'button_text' => 'Save Site branding', 'toolbar_item' => '#toolbar-item-administration', + ['administer site configuration'], ], "$theme: block-search" => [ 'theme' => $theme, @@ -188,6 +197,7 @@ 'label_selector' => 'h2', 'button_text' => 'Save Search form', 'toolbar_item' => NULL, + NULL, ], // This is the functional JS test coverage accompanying // \Drupal\Tests\settings_tray\Functional\SettingsTrayTest::testPossibleAnnotations(). @@ -199,6 +209,7 @@ 'label_selector' => NULL, 'button_text' => NULL, 'toolbar_item' => NULL, + NULL, ], // This is the functional JS test coverage accompanying // \Drupal\Tests\settings_tray\Functional\SettingsTrayTest::testPossibleAnnotations(). @@ -210,6 +221,7 @@ 'label_selector' => NULL, 'button_text' => NULL, 'toolbar_item' => NULL, + NULL, ], ]; } @@ -289,6 +301,8 @@ * Tests QuickEdit links behavior. */ public function testQuickEditLinks() { + $this->container->get('module_installer')->install(['quickedit']); + $this->grantPermissions(Role::load(RoleInterface::AUTHENTICATED_ID), ['access in-place editing']); $quick_edit_selector = '#quickedit-entity-toolbar'; $node_selector = '[data-quickedit-entity-id="node/1"]'; $body_selector = '[data-quickedit-field-id="node/1/body/en/full"]'; @@ -506,6 +520,8 @@ * "Quick edit settings" is settings_tray.module link. */ public function testCustomBlockLinks() { + $this->container->get('module_installer')->install(['quickedit']); + $this->grantPermissions(Role::load(RoleInterface::AUTHENTICATED_ID), ['access in-place editing']); $this->drupalGet('user'); $page = $this->getSession()->getPage(); $links = $page->findAll('css', "#block-custom .contextual-links li a"); @@ -544,6 +560,72 @@ } /** + * Tests access to block forms with related configuration is correct. + */ + public function testBlockConfigAccess() { + $page = $this->getSession()->getPage(); + $web_assert = $this->assertSession(); + + // Confirm that System Branding block does not expose Site Name field + // without permission. + $block = $this->placeBlock('system_branding_block'); + $this->drupalGet('user'); + $this->enableEditMode(); + $this->openBlockForm($this->getBlockSelector($block)); + // The site name field should not appear because the user doesn't have + // permission. + $web_assert->fieldNotExists('settings[site_information][site_name]'); + $page->pressButton('Save Site branding'); + $this->assertElementVisibleAfterWait('css', 'div:contains(The block configuration has been saved)'); + $web_assert->assertWaitOnAjaxRequest(); + // Confirm we did not save changes to the configuration. + $this->assertEquals('Drupal', \Drupal::configFactory()->getEditable('system.site')->get('name')); + + $this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), ['administer site configuration']); + $this->drupalGet('user'); + $this->openBlockForm($this->getBlockSelector($block)); + // The site name field should appear because the user does have permission. + $web_assert->fieldExists('settings[site_information][site_name]'); + + // Confirm that the Menu block does not expose menu configuration without + // permission. + // Add a link or the menu will not render. + $menu_link_content = MenuLinkContent::create([ + 'title' => 'This is on the menu', + 'menu_name' => 'main', + 'link' => ['uri' => 'route:'], + ]); + $menu_link_content->save(); + $this->assertNotEmpty($menu_link_content->isEnabled()); + $menu_without_overrides = \Drupal::configFactory()->getEditable('system.menu.main')->get(); + $block = $this->placeBlock('system_menu_block:main'); + $this->drupalGet('user'); + $web_assert->pageTextContains('This is on the menu'); + $this->openBlockForm($this->getBlockSelector($block)); + // Edit menu form should not appear because the user doesn't have + // permission. + $web_assert->pageTextNotContains('Edit menu'); + $page->pressButton('Save Main navigation'); + $this->assertElementVisibleAfterWait('css', 'div:contains(The block configuration has been saved)'); + $web_assert->assertWaitOnAjaxRequest(); + // Confirm we did not save changes to the menu or the menu link. + $this->assertEquals($menu_without_overrides, \Drupal::configFactory()->getEditable('system.menu.main')->get()); + $menu_link_content = MenuLinkContent::load($menu_link_content->id()); + $this->assertNotEmpty($menu_link_content->isEnabled()); + // Confirm menu is still on the page. + $this->drupalGet('user'); + $web_assert->pageTextContains('This is on the menu'); + + + $this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), ['administer menu']); + $this->drupalGet('user'); + $web_assert->pageTextContains('This is on the menu'); + $this->openBlockForm($this->getBlockSelector($block)); + // Edit menu form should appear because the user does have permission. + $web_assert->pageTextContains('Edit menu'); + } + + /** * Test that validation errors appear in the off-canvas dialog. */ public function testValidationMessages() { diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/BlockCreationTrait.php --- a/core/modules/simpletest/src/BlockCreationTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/BlockCreationTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -10,7 +10,7 @@ * This trait is meant to be used only by test classes. * * @deprecated in Drupal 8.4.x. Will be removed before Drupal 9.0.0. Use - * Drupal\Tests\AssertHelperTrait instead. + * \Drupal\Tests\block\Traits\BlockCreationTrait instead. * * @see https://www.drupal.org/node/2884454 */ diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/ContentTypeCreationTrait.php --- a/core/modules/simpletest/src/ContentTypeCreationTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/ContentTypeCreationTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -10,7 +10,7 @@ * This trait is meant to be used only by test classes. * * @deprecated in Drupal 8.4.x. Will be removed before Drupal 9.0.0. Use - * Drupal\Tests\ContentTypeCreationTrait instead. + * \Drupal\Tests\node\Traits\ContentTypeCreationTrait instead. * * @see https://www.drupal.org/node/2884454 */ diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/KernelTestBase.php --- a/core/modules/simpletest/src/KernelTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/KernelTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -226,7 +226,6 @@ $this->kernel->shutdown(); $this->kernel->boot(); - // Save the original site directory path, so that extensions in the // site-specific directory can still be discovered in the test site // environment. diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/NodeCreationTrait.php --- a/core/modules/simpletest/src/NodeCreationTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/NodeCreationTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -10,7 +10,7 @@ * This trait is meant to be used only by test classes. * * @deprecated in Drupal 8.4.x. Will be removed before Drupal 9.0.0. Use - * Drupal\Tests\NodeCreationTrait instead. + * \Drupal\Tests\node\Traits\NodeCreationTrait instead. * * @see https://www.drupal.org/node/2884454 */ diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/RouteProvider.php --- a/core/modules/simpletest/src/RouteProvider.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/RouteProvider.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,7 +49,7 @@ /** * {@inheritdoc} */ - public function preLoadRoutes($names){ + public function preLoadRoutes($names) { return $this->lazyLoadItself()->preLoadRoutes($names); } diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/TestBase.php --- a/core/modules/simpletest/src/TestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/TestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -45,6 +45,8 @@ /** * Time limit for the test. + * + * @var int */ protected $timeLimit = 500; diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php --- a/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,6 +36,8 @@ * contained in the Testing profile. * * @see \Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest + * + * @var string */ protected $profile = 'testing'; diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/UserCreationTrait.php --- a/core/modules/simpletest/src/UserCreationTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/UserCreationTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,7 +12,7 @@ * \Drupal\simpletest\TestBase. * * @deprecated in Drupal 8.4.x. Will be removed before Drupal 9.0.0. Use - * Drupal\Tests\UserCreationTrait instead. + * \Drupal\Tests\user\Traits\UserCreationTrait instead. * * @see https://www.drupal.org/node/2884454 */ diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/src/WebTestBase.php --- a/core/modules/simpletest/src/WebTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/src/WebTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -96,7 +96,7 @@ /** * The headers of the page currently loaded in the internal browser. * - * @var Array + * @var array */ protected $headers; @@ -168,6 +168,8 @@ /** * The maximum number of redirects to follow when handling responses. + * + * @var int */ protected $maximumRedirects = 5; diff -r bfffd8d7479a -r 7a779792577d core/modules/simpletest/tests/src/Functional/OtherInstallationProfileTestsTest.php --- a/core/modules/simpletest/tests/src/Functional/OtherInstallationProfileTestsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/simpletest/tests/src/Functional/OtherInstallationProfileTestsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,6 +28,8 @@ * The Standard profile contains \Drupal\standard\Tests\StandardTest, which * should be found. * + * @var string + * * @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest * @see \Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest */ diff -r bfffd8d7479a -r 7a779792577d core/modules/system/config/install/system.site.yml --- a/core/modules/system/config/install/system.site.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/config/install/system.site.yml Fri Feb 23 15:52:07 2018 +0000 @@ -1,5 +1,5 @@ uuid: '' -name: 'Drupal' +name: '' mail: '' slogan: '' page: diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Controller/TimezoneController.php --- a/core/modules/system/src/Controller/TimezoneController.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Controller/TimezoneController.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,7 +24,7 @@ * Daylight saving time indicator. If abbr does not exist then the time * zone is searched solely by offset and isdst. * - * @return JsonResponse + * @return \Symfony\Component\HttpFoundation\JsonResponse * The timezone name in JsonResponse object. */ public function getTimezone($abbreviation = '', $offset = -1, $is_daylight_saving_time = NULL) { diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/SystemConfigSubscriber.php --- a/core/modules/system/src/SystemConfigSubscriber.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/SystemConfigSubscriber.php Fri Feb 23 15:52:07 2018 +0000 @@ -68,7 +68,7 @@ * This event listener checks that the system.site:uuid's in the source and * target match. * - * @param ConfigImporterEvent $event + * @param \Drupal\Core\Config\ConfigImporterEvent $event * The config import event. */ public function onConfigImporterValidateSiteUUID(ConfigImporterEvent $event) { diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php --- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -415,7 +415,6 @@ $cid = $this->createCacheId($cache_keys, $entity_cache_contexts); $this->verifyRenderCache($cid, $non_referencing_entity_cache_tags); - $this->pass("Test listing of referencing entities.", 'Debug'); // Prime the page cache for the listing of referencing entities. $this->verifyPageCache($listing_url, 'MISS'); @@ -434,7 +433,6 @@ $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); - $this->pass("Test listing containing referenced entity.", 'Debug'); // Prime the page cache for the listing containing the referenced entity. $this->verifyPageCache($nonempty_entity_listing_url, 'MISS', $nonempty_entity_listing_cache_tags); @@ -444,7 +442,6 @@ $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); - // Verify that after modifying the referenced entity, there is a cache miss // for every route except the one for the non-referencing entity. $this->pass("Test modification of referenced entity.", 'Debug'); @@ -461,7 +458,6 @@ $this->verifyPageCache($empty_entity_listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - // Verify that after modifying the referencing entity, there is a cache miss // for every route except the ones for the non-referencing entity and the // empty entity listing. @@ -478,7 +474,6 @@ $this->verifyPageCache($listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - // Verify that after modifying the non-referencing entity, there is a cache // miss only for the non-referencing entity route. $this->pass("Test modification of non-referencing entity.", 'Debug'); @@ -492,7 +487,6 @@ // Verify cache hits. $this->verifyPageCache($non_referencing_entity_url, 'HIT'); - if ($this->entity->getEntityType()->hasHandlerClass('view_builder')) { // Verify that after modifying the entity's display, there is a cache miss // for both the referencing entity, and the listing of referencing @@ -512,7 +506,6 @@ $this->verifyPageCache($listing_url, 'HIT'); } - if ($bundle_entity_type_id = $this->entity->getEntityType()->getBundleEntityType()) { // Verify that after modifying the corresponding bundle entity, there is a // cache miss for both the referencing entity, and the listing of @@ -546,7 +539,6 @@ } } - if ($this->entity->getEntityType()->get('field_ui_base_route')) { // Verify that after modifying a configurable field on the entity, there // is a cache miss. @@ -564,7 +556,6 @@ $this->verifyPageCache($referencing_entity_url, 'HIT'); $this->verifyPageCache($listing_url, 'HIT'); - // Verify that after modifying a configurable field on the entity, there // is a cache miss. $this->pass("Test modification of referenced entity's configurable field.", 'Debug'); @@ -582,7 +573,6 @@ $this->verifyPageCache($listing_url, 'HIT'); } - // Verify that after invalidating the entity's cache tag directly, there is // a cache miss for every route except the ones for the non-referencing // entity and the empty entity listing. @@ -614,7 +604,6 @@ $this->verifyPageCache($empty_entity_listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - if (!empty($view_cache_tag)) { // Verify that after invalidating the generic entity type's view cache tag // directly, there is a cache miss for both the referencing entity, and the diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php --- a/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,7 +34,6 @@ $view_cache_tag = \Drupal::entityManager()->getViewBuilder($entity_type)->getCacheTags(); $render_cache_tag = 'rendered'; - $this->pass("Test entity.", 'Debug'); $this->verifyPageCache($entity_url, 'MISS'); @@ -65,7 +64,6 @@ // Verify a cache hit. $this->verifyPageCache($entity_url, 'HIT'); - // Verify that after modifying the entity's display, there is a cache miss. $this->pass("Test modification of entity's '$view_mode' display.", 'Debug'); $entity_display = entity_get_display($entity_type, $this->entity->bundle(), $view_mode); @@ -75,7 +73,6 @@ // Verify a cache hit. $this->verifyPageCache($entity_url, 'HIT'); - if ($bundle_entity_type_id = $this->entity->getEntityType()->getBundleEntityType()) { // Verify that after modifying the corresponding bundle entity, there is a // cache miss. @@ -90,7 +87,6 @@ $this->verifyPageCache($entity_url, 'HIT'); } - if ($this->entity->getEntityType()->get('field_ui_base_route')) { // Verify that after modifying a configurable field on the entity, there // is a cache miss. @@ -115,7 +111,6 @@ $this->verifyPageCache($entity_url, 'HIT'); } - // Verify that after invalidating the entity's cache tag directly, there is // a cache miss. $this->pass("Test invalidation of entity's cache tag.", 'Debug'); @@ -125,7 +120,6 @@ // Verify a cache hit. $this->verifyPageCache($entity_url, 'HIT'); - // Verify that after invalidating the generic entity type's view cache tag // directly, there is a cache miss. $this->pass("Test invalidation of entity's 'view' cache tag.", 'Debug'); @@ -135,7 +129,6 @@ // Verify a cache hit. $this->verifyPageCache($entity_url, 'HIT'); - // Verify that after deleting the entity, there is a cache miss. $this->pass('Test deletion of entity.', 'Debug'); $this->entity->delete(); diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Installer/DistributionProfileTest.php --- a/core/modules/system/src/Tests/Installer/DistributionProfileTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/Installer/DistributionProfileTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -46,6 +46,8 @@ protected function setUpLanguage() { // Verify that the distribution name appears. $this->assertRaw($this->info['distribution']['name']); + // Verify that the distribution name is used in the site title. + $this->assertTitle('Choose language | ' . $this->info['distribution']['name']); // Verify that the requested theme is used. $this->assertRaw($this->info['distribution']['install']['theme']); // Verify that the "Choose profile" step does not appear. diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Installer/InstallerTranslationMultipleLanguageTest.php --- a/core/modules/system/src/Tests/Installer/InstallerTranslationMultipleLanguageTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/Installer/InstallerTranslationMultipleLanguageTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,13 +51,29 @@ msgid "Language" msgstr "Language $langcode" + +#: Testing site name configuration during the installer. +msgid "Drupal" +msgstr "Drupal" ENDPO; } /** + * {@inheritdoc} + */ + protected function installParameters() { + $params = parent::installParameters(); + $params['forms']['install_configure_form']['site_name'] = 'SITE_NAME_' . $this->langcode; + return $params; + } + + /** * Tests that translations ended up at the expected places. */ public function testTranslationsLoaded() { + // Ensure the title is correct. + $this->assertEqual('SITE_NAME_' . $this->langcode, \Drupal::config('system.site')->get('name')); + // Verify German and Spanish were configured. $this->drupalGet('admin/config/regional/language'); $this->assertText('German'); diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Module/DependencyTest.php --- a/core/modules/system/src/Tests/Module/DependencyTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ - TRUE, - ]; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - // Enable module with project namespace to ensure nothing breaks. - $edit = [ - 'modules[system_project_namespace_test][enable]' => TRUE, - ]; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - $this->assertModules(['system_project_namespace_test'], TRUE); - } - - /** - * Attempts to enable the Content Translation module without Language enabled. - */ - public function testEnableWithoutDependency() { - // Attempt to enable Content Translation without Language enabled. - $edit = []; - $edit['modules[content_translation][enable]'] = 'content_translation'; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - $this->assertText(t('Some required modules must be enabled'), 'Dependency required.'); - - $this->assertModules(['content_translation', 'language'], FALSE); - - // Assert that the language tables weren't enabled. - $this->assertTableCount('language', FALSE); - - $this->drupalPostForm(NULL, NULL, t('Continue')); - $this->assertText(t('2 modules have been enabled: Content Translation, Language.'), 'Modules status has been updated.'); - $this->assertModules(['content_translation', 'language'], TRUE); - - // Assert that the language YAML files were created. - $storage = $this->container->get('config.storage'); - $this->assertTrue(count($storage->listAll('language.entity.')) > 0, 'Language config entity files exist.'); - } - - /** - * Attempts to enable a module with a missing dependency. - */ - public function testMissingModules() { - // Test that the system_dependencies_test module is marked - // as missing a dependency. - $this->drupalGet('admin/modules'); - $this->assertRaw(t('@module (missing)', ['@module' => Unicode::ucfirst('_missing_dependency')]), 'A module with missing dependencies is marked as such.'); - $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_dependencies_test][enable]"]'); - $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); - } - - /** - * Tests enabling a module that depends on an incompatible version of a module. - */ - public function testIncompatibleModuleVersionDependency() { - // Test that the system_incompatible_module_version_dependencies_test is - // marked as having an incompatible dependency. - $this->drupalGet('admin/modules'); - $this->assertRaw(t('@module (incompatible with version @version)', [ - '@module' => 'System incompatible module version test (>2.0)', - '@version' => '1.0', - ]), 'A module that depends on an incompatible version of a module is marked as such.'); - $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_incompatible_module_version_dependencies_test][enable]"]'); - $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); - } - - /** - * Tests enabling a module that depends on a module with an incompatible core version. - */ - public function testIncompatibleCoreVersionDependency() { - // Test that the system_incompatible_core_version_dependencies_test is - // marked as having an incompatible dependency. - $this->drupalGet('admin/modules'); - $this->assertRaw(t('@module (incompatible with this version of Drupal core)', [ - '@module' => 'System incompatible core version test', - ]), 'A module that depends on a module with an incompatible core version is marked as such.'); - $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_incompatible_core_version_dependencies_test][enable]"]'); - $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); - } - - /** - * Tests failing PHP version requirements. - */ - public function testIncompatiblePhpVersionDependency() { - $this->drupalGet('admin/modules'); - $this->assertRaw('This module requires PHP version 6502.* and is incompatible with PHP version ' . phpversion() . '.', 'User is informed when the PHP dependency requirement of a module is not met.'); - $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_incompatible_php_version_test][enable]"]'); - $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); - } - - /** - * Tests enabling a module that depends on a module which fails hook_requirements(). - */ - public function testEnableRequirementsFailureDependency() { - \Drupal::service('module_installer')->install(['comment']); - - $this->assertModules(['requirements1_test'], FALSE); - $this->assertModules(['requirements2_test'], FALSE); - - // Attempt to install both modules at the same time. - $edit = []; - $edit['modules[requirements1_test][enable]'] = 'requirements1_test'; - $edit['modules[requirements2_test][enable]'] = 'requirements2_test'; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - - // Makes sure the modules were NOT installed. - $this->assertText(t('Requirements 1 Test failed requirements'), 'Modules status has been updated.'); - $this->assertModules(['requirements1_test'], FALSE); - $this->assertModules(['requirements2_test'], FALSE); - - // Makes sure that already enabled modules the failing modules depend on - // were not disabled. - $this->assertModules(['comment'], TRUE); - } - - /** - * Tests that module dependencies are enabled in the correct order in the UI. - * - * Dependencies should be enabled before their dependents. - */ - public function testModuleEnableOrder() { - \Drupal::service('module_installer')->install(['module_test'], FALSE); - $this->resetAll(); - $this->assertModules(['module_test'], TRUE); - \Drupal::state()->set('module_test.dependency', 'dependency'); - // module_test creates a dependency chain: - // - color depends on config - // - config depends on help - $expected_order = ['help', 'config', 'color']; - - // Enable the modules through the UI, verifying that the dependency chain - // is correct. - $edit = []; - $edit['modules[color][enable]'] = 'color'; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - $this->assertModules(['color'], FALSE); - // Note that dependencies are sorted alphabetically in the confirmation - // message. - $this->assertText(t('You must enable the Configuration Manager, Help modules to install Color.')); - - $edit['modules[config][enable]'] = 'config'; - $edit['modules[help][enable]'] = 'help'; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - $this->assertModules(['color', 'config', 'help'], TRUE); - - // Check the actual order which is saved by module_test_modules_enabled(). - $module_order = \Drupal::state()->get('module_test.install_order') ?: []; - $this->assertIdentical($module_order, $expected_order); - } - - /** - * Tests attempting to uninstall a module that has installed dependents. - */ - public function testUninstallDependents() { - // Enable the forum module. - $edit = ['modules[forum][enable]' => 'forum']; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - $this->drupalPostForm(NULL, [], t('Continue')); - $this->assertModules(['forum'], TRUE); - - // Check that the comment module cannot be uninstalled. - $this->drupalGet('admin/modules/uninstall'); - $checkbox = $this->xpath('//input[@type="checkbox" and @name="uninstall[comment]" and @disabled="disabled"]'); - $this->assert(count($checkbox) == 1, 'Checkbox for uninstalling the comment module is disabled.'); - - // Delete any forum terms. - $vid = $this->config('forum.settings')->get('vocabulary'); - // Ensure taxonomy has been loaded into the test-runner after forum was - // enabled. - \Drupal::moduleHandler()->load('taxonomy'); - $terms = entity_load_multiple_by_properties('taxonomy_term', ['vid' => $vid]); - foreach ($terms as $term) { - $term->delete(); - } - // Uninstall the forum module, and check that taxonomy now can also be - // uninstalled. - $edit = ['uninstall[forum]' => 'forum']; - $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); - $this->drupalPostForm(NULL, NULL, t('Uninstall')); - $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); - - // Uninstall comment module. - $edit = ['uninstall[comment]' => 'comment']; - $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); - $this->drupalPostForm(NULL, NULL, t('Uninstall')); - $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Module/HookRequirementsTest.php --- a/core/modules/system/src/Tests/Module/HookRequirementsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -assertModules(['requirements1_test'], FALSE); - - // Attempt to install the requirements1_test module. - $edit = []; - $edit['modules[requirements1_test][enable]'] = 'requirements1_test'; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - - // Makes sure the module was NOT installed. - $this->assertText(t('Requirements 1 Test failed requirements'), 'Modules status has been updated.'); - $this->assertModules(['requirements1_test'], FALSE); - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Module/InstallUninstallTest.php --- a/core/modules/system/src/Tests/Module/InstallUninstallTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,351 +0,0 @@ -container->get('state')->set('system_test.verbose_module_hooks', TRUE); - - // Install and uninstall module_test to ensure hook_preinstall_module and - // hook_preuninstall_module are fired as expected. - $this->container->get('module_installer')->install(['module_test']); - $this->assertEqual($this->container->get('state')->get('system_test_preinstall_module'), 'module_test'); - $this->container->get('module_installer')->uninstall(['module_test']); - $this->assertEqual($this->container->get('state')->get('system_test_preuninstall_module'), 'module_test'); - $this->resetAll(); - - $all_modules = system_rebuild_module_data(); - - // Test help on required modules, but do not test uninstalling. - $required_modules = array_filter($all_modules, function ($module) { - if (!empty($module->info['required']) || $module->status == TRUE) { - if ($module->info['package'] != 'Testing' && empty($module->info['hidden'])) { - return TRUE; - } - } - return FALSE; - }); - - $required_modules['help'] = $all_modules['help']; - - // Test uninstalling without hidden, required, and already enabled modules. - $all_modules = array_filter($all_modules, function ($module) { - if (!empty($module->info['hidden']) || !empty($module->info['required']) || $module->status == TRUE || $module->info['package'] == 'Testing') { - return FALSE; - } - return TRUE; - }); - - // Install the Help module, and verify it installed successfully. - unset($all_modules['help']); - $this->assertModuleNotInstalled('help'); - $edit = []; - $edit["modules[help][enable]"] = TRUE; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - $this->assertText('has been enabled', 'Modules status has been updated.'); - $this->assertText(t('hook_modules_installed fired for help')); - $this->assertModuleSuccessfullyInstalled('help'); - - // Test help for the required modules. - foreach ($required_modules as $name => $module) { - $this->assertHelp($name, $module->info['name']); - } - - // Go through each module in the list and try to install and uninstall - // it with its dependencies. - while (list($name, $module) = each($all_modules)) { - $was_installed_list = \Drupal::moduleHandler()->getModuleList(); - - // Start a list of modules that we expect to be installed this time. - $modules_to_install = [$name]; - foreach (array_keys($module->requires) as $dependency) { - if (isset($all_modules[$dependency])) { - $modules_to_install[] = $dependency; - } - } - - // Check that each module is not yet enabled and does not have any - // database tables yet. - foreach ($modules_to_install as $module_to_install) { - $this->assertModuleNotInstalled($module_to_install); - } - - // Install the module. - $edit = []; - $package = $module->info['package']; - $edit['modules[' . $name . '][enable]'] = TRUE; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - - // Handle experimental modules, which require a confirmation screen. - if ($package == 'Core (Experimental)') { - $this->assertText('Are you sure you wish to enable experimental modules?'); - if (count($modules_to_install) > 1) { - // When there are experimental modules, needed dependencies do not - // result in the same page title, but there will be expected text - // indicating they need to be enabled. - $this->assertText('You must enable'); - } - $this->drupalPostForm(NULL, [], t('Continue')); - } - // Handle the case where modules were installed along with this one and - // where we therefore hit a confirmation screen. - elseif (count($modules_to_install) > 1) { - // Verify that we are on the correct form and that the expected text - // about enabling dependencies appears. - $this->assertText('Some required modules must be enabled'); - $this->assertText('You must enable'); - $this->drupalPostForm(NULL, [], t('Continue')); - } - - // List the module display names to check the confirmation message. - $module_names = []; - foreach ($modules_to_install as $module_to_install) { - $module_names[] = $all_modules[$module_to_install]->info['name']; - } - $expected_text = \Drupal::translation()->formatPlural(count($module_names), 'Module @name has been enabled.', '@count modules have been enabled: @names.', [ - '@name' => $module_names[0], - '@names' => implode(', ', $module_names), - ]); - $this->assertText($expected_text, 'Modules status has been updated.'); - - // Check that hook_modules_installed() was invoked with the expected list - // of modules, that each module's database tables now exist, and that - // appropriate messages appear in the logs. - foreach ($modules_to_install as $module_to_install) { - $this->assertText(t('hook_modules_installed fired for @module', ['@module' => $module_to_install])); - $this->assertLogMessage('system', "%module module installed.", ['%module' => $module_to_install], RfcLogLevel::INFO); - $this->assertInstallModuleUpdates($module_to_install); - $this->assertModuleSuccessfullyInstalled($module_to_install); - } - - // Verify the help page. - $this->assertHelp($name, $module->info['name']); - - // Uninstall the original module, plus everything else that was installed - // with it. - if ($name == 'forum') { - // Forum has an extra step to be able to uninstall it. - $this->preUninstallForum(); - } - - $now_installed_list = \Drupal::moduleHandler()->getModuleList(); - $added_modules = array_diff(array_keys($now_installed_list), array_keys($was_installed_list)); - while ($added_modules) { - $initial_count = count($added_modules); - foreach ($added_modules as $to_uninstall) { - // See if we can currently uninstall this module (if its dependencies - // have been uninstalled), and do so if we can. - $this->drupalGet('admin/modules/uninstall'); - $field_name = "uninstall[$to_uninstall]"; - $has_checkbox = $this->xpath('//input[@type="checkbox" and @name="' . $field_name . '"]'); - $disabled = $this->xpath('//input[@type="checkbox" and @name="' . $field_name . '" and @disabled="disabled"]'); - - if (!empty($has_checkbox) && empty($disabled)) { - // This one is eligible for being uninstalled. - $package = $all_modules[$to_uninstall]->info['package']; - $this->assertSuccessfulUninstall($to_uninstall, $package); - $added_modules = array_diff($added_modules, [$to_uninstall]); - } - } - - // If we were not able to find a module to uninstall, fail and exit the - // loop. - $final_count = count($added_modules); - if ($initial_count == $final_count) { - $this->fail('Remaining modules could not be uninstalled for ' . $name); - break; - } - } - } - - // Uninstall the help module and put it back into the list of modules. - $all_modules['help'] = $required_modules['help']; - $this->assertSuccessfulUninstall('help', $required_modules['help']->info['package']); - - // Now that all modules have been tested, go back and try to enable them - // all again at once. This tests two things: - // - That each module can be successfully enabled again after being - // uninstalled. - // - That enabling more than one module at the same time does not lead to - // any errors. - $edit = []; - $experimental = FALSE; - foreach ($all_modules as $name => $module) { - $edit['modules[' . $name . '][enable]'] = TRUE; - // Track whether there is at least one experimental module. - if ($module->info['package'] == 'Core (Experimental)') { - $experimental = TRUE; - } - } - $this->drupalPostForm('admin/modules', $edit, t('Install')); - - // If there are experimental modules, click the confirm form. - if ($experimental) { - $this->assertText('Are you sure you wish to enable experimental modules?'); - $this->drupalPostForm(NULL, [], t('Continue')); - } - // The string tested here is translatable but we are only using a part of it - // so using a translated string is wrong. Doing so would create a new string - // to translate. - $this->assertText(new FormattableMarkup('@count modules have been enabled: ', ['@count' => count($all_modules)]), 'Modules status has been updated.'); - } - - /** - * Asserts that a module is not yet installed. - * - * @param string $name - * Name of the module to check. - */ - protected function assertModuleNotInstalled($name) { - $this->assertModules([$name], FALSE); - $this->assertModuleTablesDoNotExist($name); - } - - /** - * Asserts that a module was successfully installed. - * - * @param string $name - * Name of the module to check. - */ - protected function assertModuleSuccessfullyInstalled($name) { - $this->assertModules([$name], TRUE); - $this->assertModuleTablesExist($name); - $this->assertModuleConfig($name); - } - - /** - * Uninstalls a module and asserts that it was done correctly. - * - * @param string $module - * The name of the module to uninstall. - * @param string $package - * (optional) The package of the module to uninstall. Defaults - * to 'Core'. - */ - protected function assertSuccessfulUninstall($module, $package = 'Core') { - $edit = []; - $edit['uninstall[' . $module . ']'] = TRUE; - $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); - $this->drupalPostForm(NULL, NULL, t('Uninstall')); - $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); - $this->assertModules([$module], FALSE); - - // Check that the appropriate hook was fired and the appropriate log - // message appears. (But don't check for the log message if the dblog - // module was just uninstalled, since the {watchdog} table won't be there - // anymore.) - $this->assertText(t('hook_modules_uninstalled fired for @module', ['@module' => $module])); - $this->assertLogMessage('system', "%module module uninstalled.", ['%module' => $module], RfcLogLevel::INFO); - - // Check that the module's database tables no longer exist. - $this->assertModuleTablesDoNotExist($module); - // Check that the module's config files no longer exist. - $this->assertNoModuleConfig($module); - $this->assertUninstallModuleUpdates($module); - } - - /** - * Asserts the module post update functions after install. - * - * @param string $module - * The module that got installed. - */ - protected function assertInstallModuleUpdates($module) { - /** @var \Drupal\Core\Update\UpdateRegistry $post_update_registry */ - $post_update_registry = \Drupal::service('update.post_update_registry'); - $all_update_functions = $post_update_registry->getPendingUpdateFunctions(); - $empty_result = TRUE; - foreach ($all_update_functions as $function) { - list($function_module,) = explode('_post_update_', $function); - if ($module === $function_module) { - $empty_result = FALSE; - break; - } - } - $this->assertTrue($empty_result, 'Ensures that no pending post update functions are available.'); - - $existing_updates = \Drupal::keyValue('post_update')->get('existing_updates', []); - switch ($module) { - case 'block': - $this->assertFalse(array_diff(['block_post_update_disable_blocks_with_missing_contexts'], $existing_updates)); - break; - case 'update_test_postupdate': - $this->assertFalse(array_diff(['update_test_postupdate_post_update_first', 'update_test_postupdate_post_update_second', 'update_test_postupdate_post_update_test1', 'update_test_postupdate_post_update_test0'], $existing_updates)); - break; - } - } - - /** - * Asserts the module post update functions after uninstall. - * - * @param string $module - * The module that got installed. - */ - protected function assertUninstallModuleUpdates($module) { - /** @var \Drupal\Core\Update\UpdateRegistry $post_update_registry */ - $post_update_registry = \Drupal::service('update.post_update_registry'); - $all_update_functions = $post_update_registry->getPendingUpdateFunctions(); - - switch ($module) { - case 'block': - $this->assertFalse(array_intersect(['block_post_update_disable_blocks_with_missing_contexts'], $all_update_functions), 'Asserts that no pending post update functions are available.'); - - $existing_updates = \Drupal::keyValue('post_update')->get('existing_updates', []); - $this->assertFalse(array_intersect(['block_post_update_disable_blocks_with_missing_contexts'], $existing_updates), 'Asserts that no post update functions are stored in keyvalue store.'); - break; - } - } - - /** - * Verifies a module's help. - * - * Verifies that the module help page from hook_help() exists and can be - * displayed, and that it contains the phrase "Foo Bar module", where "Foo - * Bar" is the name of the module from the .info.yml file. - * - * @param string $module - * Machine name of the module to verify. - * @param string $name - * Human-readable name of the module to verify. - */ - protected function assertHelp($module, $name) { - $this->drupalGet('admin/help/' . $module); - $this->assertResponse(200, "Help for $module displayed successfully"); - $this->assertText($name . ' module', "'$name module' is on the help page for $module"); - $this->assertLink('online documentation for the ' . $name . ' module', 0, "Correct online documentation link is in the help page for $module"); - } - - /** - * Deletes forum taxonomy terms, so Forum can be uninstalled. - */ - protected function preUninstallForum() { - // There only should be a 'General discussion' term in the 'forums' - // vocabulary, but just delete any terms there in case the name changes. - $query = \Drupal::entityQuery('taxonomy_term'); - $query->condition('vid', 'forums'); - $ids = $query->execute(); - $storage = \Drupal::entityManager()->getStorage('taxonomy_term'); - $terms = $storage->loadMultiple($ids); - $storage->delete($terms); - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Module/PrepareUninstallTest.php --- a/core/modules/system/src/Tests/Module/PrepareUninstallTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -drupalCreateUser(['administer modules']); - $this->drupalLogin($admin_user); - - // Create 10 nodes. - for ($i = 1; $i <= 5; $i++) { - $this->nodes[] = $this->drupalCreateNode(['type' => 'page']); - $this->nodes[] = $this->drupalCreateNode(['type' => 'article']); - } - - // Create 3 top-level taxonomy terms, each with 11 children. - $vocabulary = $this->createVocabulary(); - for ($i = 1; $i <= 3; $i++) { - $term = $this->createTerm($vocabulary); - $this->terms[] = $term; - for ($j = 1; $j <= 11; $j++) { - $this->terms[] = $this->createTerm($vocabulary, ['parent' => ['target_id' => $term->id()]]); - } - } - } - - /** - * Tests that Node and Taxonomy can be uninstalled. - */ - public function testUninstall() { - // Check that Taxonomy cannot be uninstalled yet. - $this->drupalGet('admin/modules/uninstall'); - $this->assertText('Remove content items'); - $this->assertLinkByHref('admin/modules/uninstall/entity/taxonomy_term'); - - // Delete Taxonomy term data. - $this->drupalGet('admin/modules/uninstall/entity/taxonomy_term'); - $term_count = count($this->terms); - for ($i = 1; $i < 11; $i++) { - $this->assertText($this->terms[$term_count - $i]->label()); - } - $term_count = $term_count - 10; - $this->assertText("And $term_count more taxonomy term entities."); - $this->assertText('This action cannot be undone.'); - $this->assertText('Make a backup of your database if you want to be able to restore these items.'); - $this->drupalPostForm(NULL, [], t('Delete all taxonomy term entities')); - - // Check that we are redirected to the uninstall page and data has been - // removed. - $this->assertUrl('admin/modules/uninstall', []); - $this->assertText('All taxonomy term entities have been deleted.'); - - // Check that there is no more data to be deleted, Taxonomy is ready to be - // uninstalled. - $this->assertText('Enables the categorization of content.'); - $this->assertNoLinkByHref('admin/modules/uninstall/entity/taxonomy_term'); - - // Uninstall the Taxonomy module. - $this->drupalPostForm('admin/modules/uninstall', ['uninstall[taxonomy]' => TRUE], t('Uninstall')); - $this->drupalPostForm(NULL, [], t('Uninstall')); - $this->assertText('The selected modules have been uninstalled.'); - $this->assertNoText('Enables the categorization of content.'); - - // Check Node cannot be uninstalled yet, there is content to be removed. - $this->drupalGet('admin/modules/uninstall'); - $this->assertText('Remove content items'); - $this->assertLinkByHref('admin/modules/uninstall/entity/node'); - - // Delete Node data. - $this->drupalGet('admin/modules/uninstall/entity/node'); - // All 10 nodes should be listed. - foreach ($this->nodes as $node) { - $this->assertText($node->label()); - } - - // Ensures there is no more count when not necessary. - $this->assertNoText('And 0 more content'); - $this->assertText('This action cannot be undone.'); - $this->assertText('Make a backup of your database if you want to be able to restore these items.'); - - // Create another node so we have 11. - $this->nodes[] = $this->drupalCreateNode(['type' => 'page']); - $this->drupalGet('admin/modules/uninstall/entity/node'); - // Ensures singular case is used when a single entity is left after listing - // the first 10's labels. - $this->assertText('And 1 more content item.'); - - // Create another node so we have 12. - $this->nodes[] = $this->drupalCreateNode(['type' => 'article']); - $this->drupalGet('admin/modules/uninstall/entity/node'); - // Ensures singular case is used when a single entity is left after listing - // the first 10's labels. - $this->assertText('And 2 more content items.'); - - $this->drupalPostForm(NULL, [], t('Delete all content items')); - - // Check we are redirected to the uninstall page and data has been removed. - $this->assertUrl('admin/modules/uninstall', []); - $this->assertText('All content items have been deleted.'); - - // Check there is no more data to be deleted, Node is ready to be - // uninstalled. - $this->assertText('Allows content to be submitted to the site and displayed on pages.'); - $this->assertNoLinkByHref('admin/modules/uninstall/entity/node'); - - // Uninstall Node module. - $this->drupalPostForm('admin/modules/uninstall', ['uninstall[node]' => TRUE], t('Uninstall')); - $this->drupalPostForm(NULL, [], t('Uninstall')); - $this->assertText('The selected modules have been uninstalled.'); - $this->assertNoText('Allows content to be submitted to the site and displayed on pages.'); - - // Ensure the proper response when accessing a non-existent entity type. - $this->drupalGet('admin/modules/uninstall/entity/node'); - $this->assertResponse(404, 'Entity types that do not exist result in a 404.'); - - // Test an entity type which does not have any existing entities. - $this->drupalGet('admin/modules/uninstall/entity/entity_test_no_label'); - $this->assertText('There are 0 entity test without label entities to delete.'); - $button_xpath = '//input[@type="submit"][@value="Delete all entity test without label entities"]'; - $this->assertNoFieldByXPath($button_xpath, NULL, 'Button with value "Delete all entity test without label entities" not found'); - - // Test an entity type without a label. - /** @var \Drupal\Core\Entity\EntityStorageInterface $storage */ - $storage = $this->container->get('entity.manager') - ->getStorage('entity_test_no_label'); - $storage->create([ - 'id' => Unicode::strtolower($this->randomMachineName()), - 'name' => $this->randomMachineName(), - ])->save(); - $this->drupalGet('admin/modules/uninstall/entity/entity_test_no_label'); - $this->assertText('This will delete 1 entity test without label.'); - $this->assertFieldByXPath($button_xpath, NULL, 'Button with value "Delete all entity test without label entities" found'); - $storage->create([ - 'id' => Unicode::strtolower($this->randomMachineName()), - 'name' => $this->randomMachineName(), - ])->save(); - $this->drupalGet('admin/modules/uninstall/entity/entity_test_no_label'); - $this->assertText('This will delete 2 entity test without label entities.'); - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Module/RequiredTest.php --- a/core/modules/system/src/Tests/Module/RequiredTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -drupalGet('admin/modules'); - foreach ($module_info as $module => $info) { - // Check to make sure the checkbox for each required module is disabled - // and checked (or absent from the page if the module is also hidden). - if (!empty($info['required'])) { - $field_name = 'modules[' . $module . '][enable]'; - if (empty($info['hidden'])) { - $this->assertFieldByXPath("//input[@name='$field_name' and @disabled='disabled' and @checked='checked']", '', format_string('Field @name was disabled and checked.', ['@name' => $field_name])); - } - else { - $this->assertNoFieldByName($field_name); - } - } - } - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Module/VersionTest.php --- a/core/modules/system/src/Tests/Module/VersionTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -2.x)', - // Another branch compatibility. - 'common_test (<=2.x)', - // Another branch incompatibility. - 'common_test (<2.x)', - // Another branch compatibility. - 'common_test (>=2.x)', - // Nonsense, misses a dash. Incompatible with everything. - 'common_test (=8.x2.x, >=2.4)', - // Core version is optional. Compatible. - 'common_test (=8.x-2.x, >=2.4-alpha2)', - // Test !=, explicitly incompatible. - 'common_test (=2.x, !=2.4-beta3)', - // Three operations. Compatible. - 'common_test (=2.x, !=2.3, <2.5)', - // Testing extra version. Incompatible. - 'common_test (<=2.4-beta2)', - // Testing extra version. Compatible. - 'common_test (>2.4-beta2)', - // Testing extra version. Incompatible. - 'common_test (>2.4-rc0)', - ]; - \Drupal::state()->set('system_test.dependencies', $dependencies); - $n = count($dependencies); - for ($i = 0; $i < $n; $i++) { - $this->drupalGet('admin/modules'); - $checkbox = $this->xpath('//input[@id="edit-modules-module-test-enable"]'); - $this->assertEqual(!empty($checkbox[0]['disabled']), $i % 2, $dependencies[$i]); - } - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Routing/MockRouteProvider.php --- a/core/modules/system/src/Tests/Routing/MockRouteProvider.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/Routing/MockRouteProvider.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,7 +15,7 @@ /** * A collection of routes for this route provider. * - * @var RouteCollection + * @var \Symfony\Component\Routing\RouteCollection */ protected $routes; diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Routing/RouterTest.php --- a/core/modules/system/src/Tests/Routing/RouterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/Routing/RouterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -53,7 +53,6 @@ // a page inception style. This test verifies that is not happening. $this->assertNoPattern('#.*#s', 'There was no double-page effect from a misrendered subrequest.'); - // Confirm that route-level access check's cacheability is applied to the // X-Drupal-Cache-Contexts and X-Drupal-Cache-Tags headers. // 1. controller result: render array, globally cacheable route access. diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/System/UncaughtExceptionTest.php --- a/core/modules/system/src/Tests/System/UncaughtExceptionTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/System/UncaughtExceptionTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -199,7 +199,6 @@ $this->drupalGet(''); $this->assertResponse(500); - $this->assertRaw('The website encountered an unexpected error'); $this->assertRaw($this->expectedExceptionMessage); $this->assertErrorLogged($this->expectedExceptionMessage); diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Theme/EngineTwigTest.php --- a/core/modules/system/src/Tests/Theme/EngineTwigTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/Theme/EngineTwigTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -76,7 +76,6 @@ /** @var \Drupal\Core\Utility\LinkGenerator $link_generator */ $link_generator = $this->container->get('link_generator'); - $generated_url = Url::fromRoute('user.register', [], ['absolute' => TRUE])->toString(TRUE)->getGeneratedUrl(); $expected = [ 'link via the linkgenerator: ' . $link_generator->generate('register', new Url('user.register', [], ['absolute' => TRUE])), diff -r bfffd8d7479a -r 7a779792577d core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php --- a/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -72,7 +72,7 @@ /** * A string containing markup and JS. * - * @string + * @var string */ protected $xssLabel = "string with HTML and "; diff -r bfffd8d7479a -r 7a779792577d core/modules/system/system.module --- a/core/modules/system/system.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/system.module Fri Feb 23 15:52:07 2018 +0000 @@ -1064,7 +1064,6 @@ _system_rebuild_module_data_ensure_required($module, $modules); } - if ($profile && isset($modules[$profile])) { // The installation profile is required, if it's a valid module. $modules[$profile]->info['required'] = TRUE; diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/fixtures/update/drupal-8.entity-test-initial.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/fixtures/update/drupal-8.entity-test-initial.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,24 @@ +select('key_value') + ->fields('key_value', ['value']) + ->condition('collection', 'entity.storage_schema.sql') + ->condition('name', 'entity_test_update.field_schema_data.name') + ->execute() + ->fetchField(); + +$schema = unserialize($schema); +$schema['entity_test_update']['fields']['name']['initial'] = 'test'; + +$connection->update('key_value') + ->fields(['value' => serialize($schema)]) + ->condition('collection', 'entity.storage_schema.sql') + ->condition('name', 'entity_test_update.field_schema_data.name') + ->execute(); diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,7 +52,6 @@ '#suffix' => '
    Append inside this div
    ', ]; - // Shows the 'before' command. $form['before_command_example'] = [ '#value' => $this->t("AJAX 'before': Click to put something before the div"), @@ -91,7 +90,6 @@ '#suffix' => '
    box
    ', ]; - // Shows the Ajax 'data' command. But there is no use of this information, // as this would require a javascript client to use the data. $form['data_command_example'] = [ diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -109,7 +109,6 @@ '#title' => $this->t('Another AJAX checkbox in a nested group'), ]; - return $form; } diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/dialog_renderer_test/src/Render/MainContent/WideModalRenderer.php --- a/core/modules/system/tests/modules/dialog_renderer_test/src/Render/MainContent/WideModalRenderer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/modules/dialog_renderer_test/src/Render/MainContent/WideModalRenderer.php Fri Feb 23 15:52:07 2018 +0000 @@ -70,7 +70,6 @@ break; } - $response->addCommand(new OpenModalDialogCommand($title, $content, $options)); return $response; } diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/entity_test/src/EntityTestPermissions.php --- a/core/modules/system/tests/modules/entity_test/src/EntityTestPermissions.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/modules/entity_test/src/EntityTestPermissions.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,7 +32,7 @@ /** * Returns a list of entity test permissions for a given entity test bundle. * - * @param EntityTestBundle $type + * @param \Drupal\entity_test\Entity\EntityTestBundle $type * The entity test bundle. * * @return array diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestFieldItemList.php --- a/core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestFieldItemList.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestFieldItemList.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,7 @@ namespace Drupal\entity_test\Plugin\Field; +use Drupal\Core\TypedData\ComputedItemListTrait; use Drupal\Core\Field\FieldItemList; /** @@ -9,29 +10,20 @@ */ class ComputedTestFieldItemList extends FieldItemList { + use ComputedItemListTrait; + /** * Compute the list property from state. */ - protected function computedListProperty() { + protected function computeValue() { + // Count the number of times this method has been executed during the + // lifecycle of an entity. + $execution_count = \Drupal::state()->get('computed_test_field_execution', 0); + \Drupal::state()->set('computed_test_field_execution', ++$execution_count); + foreach (\Drupal::state()->get('entity_test_computed_field_item_list_value', []) as $delta => $item) { $this->list[$delta] = $this->createItem($delta, $item); } } - /** - * {@inheritdoc} - */ - public function get($index) { - $this->computedListProperty(); - return isset($this->list[$index]) ? $this->list[$index] : NULL; - } - - /** - * {@inheritdoc} - */ - public function getIterator() { - $this->computedListProperty(); - return parent::getIterator(); - } - } diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -146,7 +146,6 @@ '#date_timezone' => 'Europe/Berlin', ]; - // Try to hijack the email field with a valid email. $form['disabled_container']['disabled_container_email'] = [ '#type' => 'email', diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.info.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.info.yml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,6 @@ +name: 'Lazy route provider install test' +description: 'Helps test a bug triggered by the url_generator maintaining a stale route provider.' +type: module +package: Testing +version: VERSION +core: 8.x diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.module --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.module Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,21 @@ +get(__FUNCTION__, 'success'); + try { + // Ensure that calling this does not cause a recursive rebuild. + \Drupal::service('router.route_provider')->getAllRoutes(); + } + catch (\RuntimeException $e) { + $message = 'failed'; + } + \Drupal::state()->set(__FUNCTION__, $message); +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.services.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/modules/lazy_route_provider_install_test/lazy_route_provider_install_test.services.yml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,5 @@ +services: + plugin.manager.lazy_route_provider_install_test: + class: '\Drupal\lazy_route_provider_install_test\PluginManager' + parent: default_plugin_manager + arguments: ['@url_generator'] diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,39 @@ +set(__CLASS__, Url::fromRoute('system.admin')->toString()); + parent::__construct('Plugin/LazyRouteProviderInstallTest', $namespaces, $module_handler, NULL, PluginID::class); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/module_cachebin/module_cachebin.info.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/modules/module_cachebin/module_cachebin.info.yml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,7 @@ +name: module cache bin tests +type: module +description: Test cache bins defined by modules. +package: Testing +version: VERSION +core: 8.x +hidden: true diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/module_cachebin/module_cachebin.services.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/modules/module_cachebin/module_cachebin.services.yml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,7 @@ +services: + module_cachebin.cache_bin: + class: Drupal\Core\Cache\CacheBackendInterface + tags: + - { name: cache.bin } + factory: cache.backend.database:get + arguments: [module_cachebin] diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/modules/router_test_directory/router_test.install --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/modules/router_test_directory/router_test.install Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,17 @@ +set(__FUNCTION__, Url::fromRoute('router_test.1')->toString()); +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php --- a/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -412,7 +412,6 @@ $cid = $this->createCacheId($cache_keys, $entity_cache_contexts); $this->verifyRenderCache($cid, $non_referencing_entity_cache_tags); - $this->pass("Test listing of referencing entities.", 'Debug'); // Prime the page cache for the listing of referencing entities. $this->verifyPageCache($listing_url, 'MISS'); @@ -431,7 +430,6 @@ $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); - $this->pass("Test listing containing referenced entity.", 'Debug'); // Prime the page cache for the listing containing the referenced entity. $this->verifyPageCache($nonempty_entity_listing_url, 'MISS', $nonempty_entity_listing_cache_tags); @@ -441,7 +439,6 @@ $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); - // Verify that after modifying the referenced entity, there is a cache miss // for every route except the one for the non-referencing entity. $this->pass("Test modification of referenced entity.", 'Debug'); @@ -458,7 +455,6 @@ $this->verifyPageCache($empty_entity_listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - // Verify that after modifying the referencing entity, there is a cache miss // for every route except the ones for the non-referencing entity and the // empty entity listing. @@ -475,7 +471,6 @@ $this->verifyPageCache($listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - // Verify that after modifying the non-referencing entity, there is a cache // miss only for the non-referencing entity route. $this->pass("Test modification of non-referencing entity.", 'Debug'); @@ -489,7 +484,6 @@ // Verify cache hits. $this->verifyPageCache($non_referencing_entity_url, 'HIT'); - if ($this->entity->getEntityType()->hasHandlerClass('view_builder')) { // Verify that after modifying the entity's display, there is a cache miss // for both the referencing entity, and the listing of referencing @@ -509,7 +503,6 @@ $this->verifyPageCache($listing_url, 'HIT'); } - if ($bundle_entity_type_id = $this->entity->getEntityType()->getBundleEntityType()) { // Verify that after modifying the corresponding bundle entity, there is a // cache miss for both the referencing entity, and the listing of @@ -543,7 +536,6 @@ } } - if ($this->entity->getEntityType()->get('field_ui_base_route')) { // Verify that after modifying a configurable field on the entity, there // is a cache miss. @@ -561,7 +553,6 @@ $this->verifyPageCache($referencing_entity_url, 'HIT'); $this->verifyPageCache($listing_url, 'HIT'); - // Verify that after modifying a configurable field on the entity, there // is a cache miss. $this->pass("Test modification of referenced entity's configurable field.", 'Debug'); @@ -579,7 +570,6 @@ $this->verifyPageCache($listing_url, 'HIT'); } - // Verify that after invalidating the entity's cache tag directly, there is // a cache miss for every route except the ones for the non-referencing // entity and the empty entity listing. @@ -611,7 +601,6 @@ $this->verifyPageCache($empty_entity_listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - if (!empty($view_cache_tag)) { // Verify that after invalidating the generic entity type's view cache tag // directly, there is a cache miss for both the referencing entity, and the diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php --- a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -159,4 +159,50 @@ $this->assertNoText('pending revision - en'); } + /** + * Tests manual revert of the revision ID value. + * + * @covers \Drupal\Core\Entity\ContentEntityBase::getRevisionId + * @covers \Drupal\Core\Entity\ContentEntityBase::getLoadedRevisionId + * @covers \Drupal\Core\Entity\ContentEntityBase::setNewRevision + * @covers \Drupal\Core\Entity\ContentEntityBase::isNewRevision + */ + public function testNewRevisionRevert() { + $entity = EntityTestMulRev::create(['name' => 'EntityLoadedRevisionTest']); + $entity->save(); + + // Check that revision ID field is reset while the loaded revision ID is + // preserved when flagging a new revision. + $revision_id = $entity->getRevisionId(); + $entity->setNewRevision(); + $this->assertNull($entity->getRevisionId()); + $this->assertEquals($revision_id, $entity->getLoadedRevisionId()); + $this->assertTrue($entity->isNewRevision()); + + // Check that after manually restoring the original revision ID, the entity + // is stored without creating a new revision. + $key = $entity->getEntityType()->getKey('revision'); + $entity->set($key, $revision_id); + $entity->save(); + $this->assertEquals($revision_id, $entity->getRevisionId()); + $this->assertEquals($revision_id, $entity->getLoadedRevisionId()); + + // Check that manually restoring the original revision ID causes the "new + // revision" state to be reverted. + $entity->setNewRevision(); + $this->assertNull($entity->getRevisionId()); + $this->assertEquals($revision_id, $entity->getLoadedRevisionId()); + $this->assertTrue($entity->isNewRevision()); + $entity->set($key, $revision_id); + $this->assertFalse($entity->isNewRevision()); + $this->assertEquals($revision_id, $entity->getRevisionId()); + $this->assertEquals($revision_id, $entity->getLoadedRevisionId()); + + // Check that flagging a new revision again works correctly. + $entity->setNewRevision(); + $this->assertNull($entity->getRevisionId()); + $this->assertEquals($revision_id, $entity->getLoadedRevisionId()); + $this->assertTrue($entity->isNewRevision()); + } + } diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php --- a/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -65,7 +65,6 @@ $this->assertEqual($entity_rev_second->getRevisionLogMessage(), 'second revision'); $this->assertEqual($entity_rev_second->getRevisionCreationTime(), '1476268518'); - // Test that the views using revision metadata fields are updated // properly. $view = View::load($entity_type_id . '_for_2248983'); diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/File/ConfigTest.php --- a/core/modules/system/tests/src/Functional/File/ConfigTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/File/ConfigTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -11,7 +11,7 @@ */ class ConfigTest extends BrowserTestBase { - protected function setUp(){ + protected function setUp() { parent::setUp(); $this->drupalLogin($this->drupalCreateUser(['administer site configuration'])); } diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php --- a/core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,6 +16,8 @@ /** * This is for testing the CopyRecursive logic. + * + * @var bool */ public $shouldIsDirectoryReturnTrue = FALSE; diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Form/RedirectTest.php --- a/core/modules/system/tests/src/Functional/Form/RedirectTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/Form/RedirectTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,7 +34,6 @@ $this->drupalPostForm($path, $edit, t('Submit')); $this->assertUrl($edit['destination'], [], 'Basic redirection works.'); - // Test without redirection. $edit = [ 'redirection' => FALSE, diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Mail/MailTest.php --- a/core/modules/system/tests/src/Functional/Mail/MailTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/Mail/MailTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,7 @@ namespace Drupal\Tests\system\Functional\Mail; +use Drupal\Component\Utility\Unicode; use Drupal\Core\Mail\Plugin\Mail\TestMailCollector; use Drupal\Tests\BrowserTestBase; use Drupal\system_mail_failure_test\Plugin\Mail\TestPhpMailFailure; @@ -90,11 +91,15 @@ $this->assertEqual($reply_email, $sent_message['headers']['Reply-to'], 'Message reply-to headers are set.'); $this->assertFalse(isset($sent_message['headers']['Errors-To']), 'Errors-to header must not be set, it is deprecated.'); + // Test that long site names containing characters that need MIME encoding + // works as expected. + $this->config('system.site')->set('name', 'Drépal this is a very long test sentence to test what happens with very long site names')->save(); // Send an email and check that the From-header contains the site name. \Drupal::service('plugin.manager.mail')->mail('simpletest', 'from_test', 'from_test@example.com', $language); $captured_emails = \Drupal::state()->get('system.test_mail_collector'); $sent_message = end($captured_emails); - $this->assertEqual($from_email, $sent_message['headers']['From'], 'Message is sent from the site email account.'); + $this->assertEquals('=?UTF-8?B?RHLDqXBhbCB0aGlzIGlzIGEgdmVyeSBsb25nIHRlc3Qgc2VudGVuY2UgdG8gdGU=?= ', $sent_message['headers']['From'], 'From header is correctly encoded.'); + $this->assertEquals('Drépal this is a very long test sentence to te ', Unicode::mimeHeaderDecode($sent_message['headers']['From']), 'From header is correctly encoded.'); $this->assertFalse(isset($sent_message['headers']['Reply-to']), 'Message reply-to is not set if not specified.'); $this->assertFalse(isset($sent_message['headers']['Errors-To']), 'Errors-to header must not be set, it is deprecated.'); } diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php --- a/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,6 +39,8 @@ /** * Test paths in the Standard profile. + * + * @var string */ protected $profile = 'standard'; diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php --- a/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,6 +13,8 @@ /** * The expected result from calling the module-provided class' method. + * + * @var string */ protected $expected = 'Drupal\\module_autoload_test\\SomeClass::testMethod() was invoked.'; diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Module/DependencyTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/src/Functional/Module/DependencyTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,202 @@ + TRUE, + ]; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + // Enable module with project namespace to ensure nothing breaks. + $edit = [ + 'modules[system_project_namespace_test][enable]' => TRUE, + ]; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + $this->assertModules(['system_project_namespace_test'], TRUE); + } + + /** + * Attempts to enable the Content Translation module without Language enabled. + */ + public function testEnableWithoutDependency() { + // Attempt to enable Content Translation without Language enabled. + $edit = []; + $edit['modules[content_translation][enable]'] = 'content_translation'; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + $this->assertText(t('Some required modules must be enabled'), 'Dependency required.'); + + $this->assertModules(['content_translation', 'language'], FALSE); + + // Assert that the language tables weren't enabled. + $this->assertTableCount('language', FALSE); + + $this->drupalPostForm(NULL, NULL, t('Continue')); + $this->assertText(t('2 modules have been enabled: Content Translation, Language.'), 'Modules status has been updated.'); + $this->assertModules(['content_translation', 'language'], TRUE); + + // Assert that the language YAML files were created. + $storage = $this->container->get('config.storage'); + $this->assertTrue(count($storage->listAll('language.entity.')) > 0, 'Language config entity files exist.'); + } + + /** + * Attempts to enable a module with a missing dependency. + */ + public function testMissingModules() { + // Test that the system_dependencies_test module is marked + // as missing a dependency. + $this->drupalGet('admin/modules'); + $this->assertRaw(t('@module (missing)', ['@module' => Unicode::ucfirst('_missing_dependency')]), 'A module with missing dependencies is marked as such.'); + $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_dependencies_test][enable]"]'); + $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); + } + + /** + * Tests enabling a module that depends on an incompatible version of a module. + */ + public function testIncompatibleModuleVersionDependency() { + // Test that the system_incompatible_module_version_dependencies_test is + // marked as having an incompatible dependency. + $this->drupalGet('admin/modules'); + $this->assertRaw(t('@module (incompatible with version @version)', [ + '@module' => 'System incompatible module version test (>2.0)', + '@version' => '1.0', + ]), 'A module that depends on an incompatible version of a module is marked as such.'); + $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_incompatible_module_version_dependencies_test][enable]"]'); + $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); + } + + /** + * Tests enabling a module that depends on a module with an incompatible core version. + */ + public function testIncompatibleCoreVersionDependency() { + // Test that the system_incompatible_core_version_dependencies_test is + // marked as having an incompatible dependency. + $this->drupalGet('admin/modules'); + $this->assertRaw(t('@module (incompatible with this version of Drupal core)', [ + '@module' => 'System incompatible core version test', + ]), 'A module that depends on a module with an incompatible core version is marked as such.'); + $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_incompatible_core_version_dependencies_test][enable]"]'); + $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); + } + + /** + * Tests failing PHP version requirements. + */ + public function testIncompatiblePhpVersionDependency() { + $this->drupalGet('admin/modules'); + $this->assertRaw('This module requires PHP version 6502.* and is incompatible with PHP version ' . phpversion() . '.', 'User is informed when the PHP dependency requirement of a module is not met.'); + $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_incompatible_php_version_test][enable]"]'); + $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); + } + + /** + * Tests enabling a module that depends on a module which fails hook_requirements(). + */ + public function testEnableRequirementsFailureDependency() { + \Drupal::service('module_installer')->install(['comment']); + + $this->assertModules(['requirements1_test'], FALSE); + $this->assertModules(['requirements2_test'], FALSE); + + // Attempt to install both modules at the same time. + $edit = []; + $edit['modules[requirements1_test][enable]'] = 'requirements1_test'; + $edit['modules[requirements2_test][enable]'] = 'requirements2_test'; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + + // Makes sure the modules were NOT installed. + $this->assertText(t('Requirements 1 Test failed requirements'), 'Modules status has been updated.'); + $this->assertModules(['requirements1_test'], FALSE); + $this->assertModules(['requirements2_test'], FALSE); + + // Makes sure that already enabled modules the failing modules depend on + // were not disabled. + $this->assertModules(['comment'], TRUE); + } + + /** + * Tests that module dependencies are enabled in the correct order in the UI. + * + * Dependencies should be enabled before their dependents. + */ + public function testModuleEnableOrder() { + \Drupal::service('module_installer')->install(['module_test'], FALSE); + $this->resetAll(); + $this->assertModules(['module_test'], TRUE); + \Drupal::state()->set('module_test.dependency', 'dependency'); + // module_test creates a dependency chain: + // - color depends on config + // - config depends on help + $expected_order = ['help', 'config', 'color']; + + // Enable the modules through the UI, verifying that the dependency chain + // is correct. + $edit = []; + $edit['modules[color][enable]'] = 'color'; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + $this->assertModules(['color'], FALSE); + // Note that dependencies are sorted alphabetically in the confirmation + // message. + $this->assertText(t('You must enable the Configuration Manager, Help modules to install Color.')); + + $edit['modules[config][enable]'] = 'config'; + $edit['modules[help][enable]'] = 'help'; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + $this->assertModules(['color', 'config', 'help'], TRUE); + + // Check the actual order which is saved by module_test_modules_enabled(). + $module_order = \Drupal::state()->get('module_test.install_order') ?: []; + $this->assertIdentical($module_order, $expected_order); + } + + /** + * Tests attempting to uninstall a module that has installed dependents. + */ + public function testUninstallDependents() { + // Enable the forum module. + $edit = ['modules[forum][enable]' => 'forum']; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + $this->drupalPostForm(NULL, [], t('Continue')); + $this->assertModules(['forum'], TRUE); + + // Check that the comment module cannot be uninstalled. + $this->drupalGet('admin/modules/uninstall'); + $checkbox = $this->xpath('//input[@type="checkbox" and @name="uninstall[comment]" and @disabled="disabled"]'); + $this->assert(count($checkbox) == 1, 'Checkbox for uninstalling the comment module is disabled.'); + + // Delete any forum terms. + $vid = $this->config('forum.settings')->get('vocabulary'); + // Ensure taxonomy has been loaded into the test-runner after forum was + // enabled. + \Drupal::moduleHandler()->load('taxonomy'); + $terms = entity_load_multiple_by_properties('taxonomy_term', ['vid' => $vid]); + foreach ($terms as $term) { + $term->delete(); + } + // Uninstall the forum module, and check that taxonomy now can also be + // uninstalled. + $edit = ['uninstall[forum]' => 'forum']; + $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); + $this->drupalPostForm(NULL, NULL, t('Uninstall')); + $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); + + // Uninstall comment module. + $edit = ['uninstall[comment]' => 'comment']; + $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); + $this->drupalPostForm(NULL, NULL, t('Uninstall')); + $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,27 @@ +assertModules(['requirements1_test'], FALSE); + + // Attempt to install the requirements1_test module. + $edit = []; + $edit['modules[requirements1_test][enable]'] = 'requirements1_test'; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + + // Makes sure the module was NOT installed. + $this->assertText(t('Requirements 1 Test failed requirements'), 'Modules status has been updated.'); + $this->assertModules(['requirements1_test'], FALSE); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,351 @@ +container->get('state')->set('system_test.verbose_module_hooks', TRUE); + + // Install and uninstall module_test to ensure hook_preinstall_module and + // hook_preuninstall_module are fired as expected. + $this->container->get('module_installer')->install(['module_test']); + $this->assertEqual($this->container->get('state')->get('system_test_preinstall_module'), 'module_test'); + $this->container->get('module_installer')->uninstall(['module_test']); + $this->assertEqual($this->container->get('state')->get('system_test_preuninstall_module'), 'module_test'); + $this->resetAll(); + + $all_modules = system_rebuild_module_data(); + + // Test help on required modules, but do not test uninstalling. + $required_modules = array_filter($all_modules, function ($module) { + if (!empty($module->info['required']) || $module->status == TRUE) { + if ($module->info['package'] != 'Testing' && empty($module->info['hidden'])) { + return TRUE; + } + } + return FALSE; + }); + + $required_modules['help'] = $all_modules['help']; + + // Test uninstalling without hidden, required, and already enabled modules. + $all_modules = array_filter($all_modules, function ($module) { + if (!empty($module->info['hidden']) || !empty($module->info['required']) || $module->status == TRUE || $module->info['package'] == 'Testing') { + return FALSE; + } + return TRUE; + }); + + // Install the Help module, and verify it installed successfully. + unset($all_modules['help']); + $this->assertModuleNotInstalled('help'); + $edit = []; + $edit["modules[help][enable]"] = TRUE; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + $this->assertText('has been enabled', 'Modules status has been updated.'); + $this->assertText(t('hook_modules_installed fired for help')); + $this->assertModuleSuccessfullyInstalled('help'); + + // Test help for the required modules. + foreach ($required_modules as $name => $module) { + $this->assertHelp($name, $module->info['name']); + } + + // Go through each module in the list and try to install and uninstall + // it with its dependencies. + while (list($name, $module) = each($all_modules)) { + $was_installed_list = \Drupal::moduleHandler()->getModuleList(); + + // Start a list of modules that we expect to be installed this time. + $modules_to_install = [$name]; + foreach (array_keys($module->requires) as $dependency) { + if (isset($all_modules[$dependency])) { + $modules_to_install[] = $dependency; + } + } + + // Check that each module is not yet enabled and does not have any + // database tables yet. + foreach ($modules_to_install as $module_to_install) { + $this->assertModuleNotInstalled($module_to_install); + } + + // Install the module. + $edit = []; + $package = $module->info['package']; + $edit['modules[' . $name . '][enable]'] = TRUE; + $this->drupalPostForm('admin/modules', $edit, t('Install')); + + // Handle experimental modules, which require a confirmation screen. + if ($package == 'Core (Experimental)') { + $this->assertText('Are you sure you wish to enable experimental modules?'); + if (count($modules_to_install) > 1) { + // When there are experimental modules, needed dependencies do not + // result in the same page title, but there will be expected text + // indicating they need to be enabled. + $this->assertText('You must enable'); + } + $this->drupalPostForm(NULL, [], t('Continue')); + } + // Handle the case where modules were installed along with this one and + // where we therefore hit a confirmation screen. + elseif (count($modules_to_install) > 1) { + // Verify that we are on the correct form and that the expected text + // about enabling dependencies appears. + $this->assertText('Some required modules must be enabled'); + $this->assertText('You must enable'); + $this->drupalPostForm(NULL, [], t('Continue')); + } + + // List the module display names to check the confirmation message. + $module_names = []; + foreach ($modules_to_install as $module_to_install) { + $module_names[] = $all_modules[$module_to_install]->info['name']; + } + $expected_text = \Drupal::translation()->formatPlural(count($module_names), 'Module @name has been enabled.', '@count modules have been enabled: @names.', [ + '@name' => $module_names[0], + '@names' => implode(', ', $module_names), + ]); + $this->assertText($expected_text, 'Modules status has been updated.'); + + // Check that hook_modules_installed() was invoked with the expected list + // of modules, that each module's database tables now exist, and that + // appropriate messages appear in the logs. + foreach ($modules_to_install as $module_to_install) { + $this->assertText(t('hook_modules_installed fired for @module', ['@module' => $module_to_install])); + $this->assertLogMessage('system', "%module module installed.", ['%module' => $module_to_install], RfcLogLevel::INFO); + $this->assertInstallModuleUpdates($module_to_install); + $this->assertModuleSuccessfullyInstalled($module_to_install); + } + + // Verify the help page. + $this->assertHelp($name, $module->info['name']); + + // Uninstall the original module, plus everything else that was installed + // with it. + if ($name == 'forum') { + // Forum has an extra step to be able to uninstall it. + $this->preUninstallForum(); + } + + $now_installed_list = \Drupal::moduleHandler()->getModuleList(); + $added_modules = array_diff(array_keys($now_installed_list), array_keys($was_installed_list)); + while ($added_modules) { + $initial_count = count($added_modules); + foreach ($added_modules as $to_uninstall) { + // See if we can currently uninstall this module (if its dependencies + // have been uninstalled), and do so if we can. + $this->drupalGet('admin/modules/uninstall'); + $field_name = "uninstall[$to_uninstall]"; + $has_checkbox = $this->xpath('//input[@type="checkbox" and @name="' . $field_name . '"]'); + $disabled = $this->xpath('//input[@type="checkbox" and @name="' . $field_name . '" and @disabled="disabled"]'); + + if (!empty($has_checkbox) && empty($disabled)) { + // This one is eligible for being uninstalled. + $package = $all_modules[$to_uninstall]->info['package']; + $this->assertSuccessfulUninstall($to_uninstall, $package); + $added_modules = array_diff($added_modules, [$to_uninstall]); + } + } + + // If we were not able to find a module to uninstall, fail and exit the + // loop. + $final_count = count($added_modules); + if ($initial_count == $final_count) { + $this->fail('Remaining modules could not be uninstalled for ' . $name); + break; + } + } + } + + // Uninstall the help module and put it back into the list of modules. + $all_modules['help'] = $required_modules['help']; + $this->assertSuccessfulUninstall('help', $required_modules['help']->info['package']); + + // Now that all modules have been tested, go back and try to enable them + // all again at once. This tests two things: + // - That each module can be successfully enabled again after being + // uninstalled. + // - That enabling more than one module at the same time does not lead to + // any errors. + $edit = []; + $experimental = FALSE; + foreach ($all_modules as $name => $module) { + $edit['modules[' . $name . '][enable]'] = TRUE; + // Track whether there is at least one experimental module. + if ($module->info['package'] == 'Core (Experimental)') { + $experimental = TRUE; + } + } + $this->drupalPostForm('admin/modules', $edit, t('Install')); + + // If there are experimental modules, click the confirm form. + if ($experimental) { + $this->assertText('Are you sure you wish to enable experimental modules?'); + $this->drupalPostForm(NULL, [], t('Continue')); + } + // The string tested here is translatable but we are only using a part of it + // so using a translated string is wrong. Doing so would create a new string + // to translate. + $this->assertText(new FormattableMarkup('@count modules have been enabled: ', ['@count' => count($all_modules)]), 'Modules status has been updated.'); + } + + /** + * Asserts that a module is not yet installed. + * + * @param string $name + * Name of the module to check. + */ + protected function assertModuleNotInstalled($name) { + $this->assertModules([$name], FALSE); + $this->assertModuleTablesDoNotExist($name); + } + + /** + * Asserts that a module was successfully installed. + * + * @param string $name + * Name of the module to check. + */ + protected function assertModuleSuccessfullyInstalled($name) { + $this->assertModules([$name], TRUE); + $this->assertModuleTablesExist($name); + $this->assertModuleConfig($name); + } + + /** + * Uninstalls a module and asserts that it was done correctly. + * + * @param string $module + * The name of the module to uninstall. + * @param string $package + * (optional) The package of the module to uninstall. Defaults + * to 'Core'. + */ + protected function assertSuccessfulUninstall($module, $package = 'Core') { + $edit = []; + $edit['uninstall[' . $module . ']'] = TRUE; + $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); + $this->drupalPostForm(NULL, NULL, t('Uninstall')); + $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); + $this->assertModules([$module], FALSE); + + // Check that the appropriate hook was fired and the appropriate log + // message appears. (But don't check for the log message if the dblog + // module was just uninstalled, since the {watchdog} table won't be there + // anymore.) + $this->assertText(t('hook_modules_uninstalled fired for @module', ['@module' => $module])); + $this->assertLogMessage('system', "%module module uninstalled.", ['%module' => $module], RfcLogLevel::INFO); + + // Check that the module's database tables no longer exist. + $this->assertModuleTablesDoNotExist($module); + // Check that the module's config files no longer exist. + $this->assertNoModuleConfig($module); + $this->assertUninstallModuleUpdates($module); + } + + /** + * Asserts the module post update functions after install. + * + * @param string $module + * The module that got installed. + */ + protected function assertInstallModuleUpdates($module) { + /** @var \Drupal\Core\Update\UpdateRegistry $post_update_registry */ + $post_update_registry = \Drupal::service('update.post_update_registry'); + $all_update_functions = $post_update_registry->getPendingUpdateFunctions(); + $empty_result = TRUE; + foreach ($all_update_functions as $function) { + list($function_module,) = explode('_post_update_', $function); + if ($module === $function_module) { + $empty_result = FALSE; + break; + } + } + $this->assertTrue($empty_result, 'Ensures that no pending post update functions are available.'); + + $existing_updates = \Drupal::keyValue('post_update')->get('existing_updates', []); + switch ($module) { + case 'block': + $this->assertFalse(array_diff(['block_post_update_disable_blocks_with_missing_contexts'], $existing_updates)); + break; + case 'update_test_postupdate': + $this->assertFalse(array_diff(['update_test_postupdate_post_update_first', 'update_test_postupdate_post_update_second', 'update_test_postupdate_post_update_test1', 'update_test_postupdate_post_update_test0'], $existing_updates)); + break; + } + } + + /** + * Asserts the module post update functions after uninstall. + * + * @param string $module + * The module that got installed. + */ + protected function assertUninstallModuleUpdates($module) { + /** @var \Drupal\Core\Update\UpdateRegistry $post_update_registry */ + $post_update_registry = \Drupal::service('update.post_update_registry'); + $all_update_functions = $post_update_registry->getPendingUpdateFunctions(); + + switch ($module) { + case 'block': + $this->assertFalse(array_intersect(['block_post_update_disable_blocks_with_missing_contexts'], $all_update_functions), 'Asserts that no pending post update functions are available.'); + + $existing_updates = \Drupal::keyValue('post_update')->get('existing_updates', []); + $this->assertFalse(array_intersect(['block_post_update_disable_blocks_with_missing_contexts'], $existing_updates), 'Asserts that no post update functions are stored in keyvalue store.'); + break; + } + } + + /** + * Verifies a module's help. + * + * Verifies that the module help page from hook_help() exists and can be + * displayed, and that it contains the phrase "Foo Bar module", where "Foo + * Bar" is the name of the module from the .info.yml file. + * + * @param string $module + * Machine name of the module to verify. + * @param string $name + * Human-readable name of the module to verify. + */ + protected function assertHelp($module, $name) { + $this->drupalGet('admin/help/' . $module); + $this->assertResponse(200, "Help for $module displayed successfully"); + $this->assertText($name . ' module', "'$name module' is on the help page for $module"); + $this->assertLink('online documentation for the ' . $name . ' module', 0, "Correct online documentation link is in the help page for $module"); + } + + /** + * Deletes forum taxonomy terms, so Forum can be uninstalled. + */ + protected function preUninstallForum() { + // There only should be a 'General discussion' term in the 'forums' + // vocabulary, but just delete any terms there in case the name changes. + $query = \Drupal::entityQuery('taxonomy_term'); + $query->condition('vid', 'forums'); + $ids = $query->execute(); + $storage = \Drupal::entityManager()->getStorage('taxonomy_term'); + $terms = $storage->loadMultiple($ids); + $storage->delete($terms); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,179 @@ +drupalCreateUser(['administer modules']); + $this->drupalLogin($admin_user); + + // Create 10 nodes. + for ($i = 1; $i <= 5; $i++) { + $this->nodes[] = $this->drupalCreateNode(['type' => 'page']); + $this->nodes[] = $this->drupalCreateNode(['type' => 'article']); + } + + // Create 3 top-level taxonomy terms, each with 11 children. + $vocabulary = $this->createVocabulary(); + for ($i = 1; $i <= 3; $i++) { + $term = $this->createTerm($vocabulary); + $this->terms[] = $term; + for ($j = 1; $j <= 11; $j++) { + $this->terms[] = $this->createTerm($vocabulary, ['parent' => ['target_id' => $term->id()]]); + } + } + } + + /** + * Tests that Node and Taxonomy can be uninstalled. + */ + public function testUninstall() { + // Check that Taxonomy cannot be uninstalled yet. + $this->drupalGet('admin/modules/uninstall'); + $this->assertText('Remove content items'); + $this->assertLinkByHref('admin/modules/uninstall/entity/taxonomy_term'); + + // Delete Taxonomy term data. + $this->drupalGet('admin/modules/uninstall/entity/taxonomy_term'); + $term_count = count($this->terms); + for ($i = 1; $i < 11; $i++) { + $this->assertText($this->terms[$term_count - $i]->label()); + } + $term_count = $term_count - 10; + $this->assertText("And $term_count more taxonomy term entities."); + $this->assertText('This action cannot be undone.'); + $this->assertText('Make a backup of your database if you want to be able to restore these items.'); + $this->drupalPostForm(NULL, [], t('Delete all taxonomy term entities')); + + // Check that we are redirected to the uninstall page and data has been + // removed. + $this->assertUrl('admin/modules/uninstall', []); + $this->assertText('All taxonomy term entities have been deleted.'); + + // Check that there is no more data to be deleted, Taxonomy is ready to be + // uninstalled. + $this->assertText('Enables the categorization of content.'); + $this->assertNoLinkByHref('admin/modules/uninstall/entity/taxonomy_term'); + + // Uninstall the Taxonomy module. + $this->drupalPostForm('admin/modules/uninstall', ['uninstall[taxonomy]' => TRUE], t('Uninstall')); + $this->drupalPostForm(NULL, [], t('Uninstall')); + $this->assertText('The selected modules have been uninstalled.'); + $this->assertNoText('Enables the categorization of content.'); + + // Check Node cannot be uninstalled yet, there is content to be removed. + $this->drupalGet('admin/modules/uninstall'); + $this->assertText('Remove content items'); + $this->assertLinkByHref('admin/modules/uninstall/entity/node'); + + // Delete Node data. + $this->drupalGet('admin/modules/uninstall/entity/node'); + // All 10 nodes should be listed. + foreach ($this->nodes as $node) { + $this->assertText($node->label()); + } + + // Ensures there is no more count when not necessary. + $this->assertNoText('And 0 more content'); + $this->assertText('This action cannot be undone.'); + $this->assertText('Make a backup of your database if you want to be able to restore these items.'); + + // Create another node so we have 11. + $this->nodes[] = $this->drupalCreateNode(['type' => 'page']); + $this->drupalGet('admin/modules/uninstall/entity/node'); + // Ensures singular case is used when a single entity is left after listing + // the first 10's labels. + $this->assertText('And 1 more content item.'); + + // Create another node so we have 12. + $this->nodes[] = $this->drupalCreateNode(['type' => 'article']); + $this->drupalGet('admin/modules/uninstall/entity/node'); + // Ensures singular case is used when a single entity is left after listing + // the first 10's labels. + $this->assertText('And 2 more content items.'); + + $this->drupalPostForm(NULL, [], t('Delete all content items')); + + // Check we are redirected to the uninstall page and data has been removed. + $this->assertUrl('admin/modules/uninstall', []); + $this->assertText('All content items have been deleted.'); + + // Check there is no more data to be deleted, Node is ready to be + // uninstalled. + $this->assertText('Allows content to be submitted to the site and displayed on pages.'); + $this->assertNoLinkByHref('admin/modules/uninstall/entity/node'); + + // Uninstall Node module. + $this->drupalPostForm('admin/modules/uninstall', ['uninstall[node]' => TRUE], t('Uninstall')); + $this->drupalPostForm(NULL, [], t('Uninstall')); + $this->assertText('The selected modules have been uninstalled.'); + $this->assertNoText('Allows content to be submitted to the site and displayed on pages.'); + + // Ensure the proper response when accessing a non-existent entity type. + $this->drupalGet('admin/modules/uninstall/entity/node'); + $this->assertResponse(404, 'Entity types that do not exist result in a 404.'); + + // Test an entity type which does not have any existing entities. + $this->drupalGet('admin/modules/uninstall/entity/entity_test_no_label'); + $this->assertText('There are 0 entity test without label entities to delete.'); + $button_xpath = '//input[@type="submit"][@value="Delete all entity test without label entities"]'; + $this->assertNoFieldByXPath($button_xpath, NULL, 'Button with value "Delete all entity test without label entities" not found'); + + // Test an entity type without a label. + /** @var \Drupal\Core\Entity\EntityStorageInterface $storage */ + $storage = $this->container->get('entity.manager') + ->getStorage('entity_test_no_label'); + $storage->create([ + 'id' => Unicode::strtolower($this->randomMachineName()), + 'name' => $this->randomMachineName(), + ])->save(); + $this->drupalGet('admin/modules/uninstall/entity/entity_test_no_label'); + $this->assertText('This will delete 1 entity test without label.'); + $this->assertFieldByXPath($button_xpath, NULL, 'Button with value "Delete all entity test without label entities" found'); + $storage->create([ + 'id' => Unicode::strtolower($this->randomMachineName()), + 'name' => $this->randomMachineName(), + ])->save(); + $this->drupalGet('admin/modules/uninstall/entity/entity_test_no_label'); + $this->assertText('This will delete 2 entity test without label entities.'); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Module/RequiredTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/src/Functional/Module/RequiredTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,32 @@ +drupalGet('admin/modules'); + foreach ($module_info as $module => $info) { + // Check to make sure the checkbox for each required module is disabled + // and checked (or absent from the page if the module is also hidden). + if (!empty($info['required'])) { + $field_name = 'modules[' . $module . '][enable]'; + if (empty($info['hidden'])) { + $this->assertFieldByXPath("//input[@name='$field_name' and @disabled='disabled' and @checked='checked']", '', format_string('Field @name was disabled and checked.', ['@name' => $field_name])); + } + else { + $this->assertNoFieldByName($field_name); + } + } + } + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Module/VersionTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/src/Functional/Module/VersionTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,56 @@ +2.x)', + // Another branch compatibility. + 'common_test (<=2.x)', + // Another branch incompatibility. + 'common_test (<2.x)', + // Another branch compatibility. + 'common_test (>=2.x)', + // Nonsense, misses a dash. Incompatible with everything. + 'common_test (=8.x2.x, >=2.4)', + // Core version is optional. Compatible. + 'common_test (=8.x-2.x, >=2.4-alpha2)', + // Test !=, explicitly incompatible. + 'common_test (=2.x, !=2.4-beta3)', + // Three operations. Compatible. + 'common_test (=2.x, !=2.3, <2.5)', + // Testing extra version. Incompatible. + 'common_test (<=2.4-beta2)', + // Testing extra version. Compatible. + 'common_test (>2.4-beta2)', + // Testing extra version. Incompatible. + 'common_test (>2.4-rc0)', + ]; + \Drupal::state()->set('system_test.dependencies', $dependencies); + $n = count($dependencies); + for ($i = 0; $i < $n; $i++) { + $this->drupalGet('admin/modules'); + $checkbox = $this->xpath('//input[@id="edit-modules-module-test-enable"]'); + $this->assertEqual(!empty($checkbox[0]->getAttribute('disabled')), $i % 2, $dependencies[$i]); + } + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Update/EntityUpdateInitialTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/tests/src/Functional/Update/EntityUpdateInitialTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,33 @@ +databaseDumpFiles = [ + __DIR__ . '/../../../fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update.php.gz', + __DIR__ . '/../../../fixtures/update/drupal-8.entity-test-initial.php', + ]; + } + + /** + * Tests that a pre-existing initial key in the field schema is not a change. + */ + public function testInitialIsIgnored() { + $this->runUpdates(); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php --- a/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -165,7 +165,6 @@ ]; $entity_type->set('revision_metadata_keys', $revision_metadata_keys); - $entity_type->set('translatable', TRUE); $entity_type->set('data_table', 'entity_test_update_data'); $entity_type->set('revision_table', 'entity_test_update_revision'); diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php --- a/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -96,7 +96,6 @@ ->set('mail', 'simpletest@example.com') ->save(); - // Generate and test tokens. $tests = []; $tests['[site:name]'] = Html::escape($config->get('name')); diff -r bfffd8d7479a -r 7a779792577d core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php --- a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -182,7 +182,6 @@ ], ]; - $data = []; // Empty tree. diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/migration_templates/d6_taxonomy_term_translation.yml --- a/core/modules/taxonomy/migration_templates/d6_taxonomy_term_translation.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -id: d6_taxonomy_term_translation -label: Taxonomy terms -migration_tags: - - Drupal 6 -source: - plugin: d6_taxonomy_term - translations: true -process: - # If you are using this file to build a custom migration consider removing - # the tid field to allow incremental migrations. - tid: tid - langcode: language - vid: - plugin: migration - migration: d6_taxonomy_vocabulary - source: vid - name: name - description: description - weight: weight - # Only attempt to stub real (non-zero) parents. - parent_id: - - - plugin: skip_on_empty - method: process - source: parent - - - plugin: migration - migration: d6_taxonomy_term - parent: - plugin: default_value - default_value: 0 - source: '@parent_id' - changed: timestamp -destination: - plugin: entity:taxonomy_term -migration_dependencies: - required: - - d6_taxonomy_vocabulary - - d6_taxonomy_term diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/src/Plugin/migrate/cckfield/TaxonomyTermReference.php --- a/core/modules/taxonomy/src/Plugin/migrate/cckfield/TaxonomyTermReference.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/src/Plugin/migrate/cckfield/TaxonomyTermReference.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,7 +28,7 @@ */ public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => 'tid', diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php --- a/core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,7 +21,7 @@ */ public function processFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'target_id' => 'tid', diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php --- a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php Fri Feb 23 15:52:07 2018 +0000 @@ -22,7 +22,7 @@ class IndexTidDepth extends ArgumentPluginBase implements ContainerFactoryPluginInterface { /** - * @var EntityStorageInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $termStorage; diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php --- a/core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,7 +17,7 @@ class Taxonomy extends NumericArgument implements ContainerFactoryPluginInterface { /** - * @var EntityStorageInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $termStorage; diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php --- a/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,7 +31,7 @@ * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param VocabularyStorageInterface $vocabulary_storage + * @param \Drupal\taxonomy\VocabularyStorageInterface $vocabulary_storage * The vocabulary storage. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, VocabularyStorageInterface $vocabulary_storage) { diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php --- a/core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -65,7 +65,6 @@ $view = Views::getView('test_argument_validator_term'); $view->initHandlers(); - // Test the single validator for term IDs. $view->argument['tid']->validator->options['type'] = 'tid'; @@ -83,7 +82,6 @@ $view->argument['tid']->validated_title = NULL; $view->argument['tid']->argument_validated = NULL; - // Test the multiple validator for term IDs. $view->argument['tid']->validator->options['type'] = 'tids'; $view->argument['tid']->options['break_phrase'] = TRUE; diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php --- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -92,8 +92,7 @@ $this->assertText($node->label()); \Drupal::service('module_installer')->install(['language', 'content_translation']); - $language = ConfigurableLanguage::createFromLangcode('ur'); - $language->save(); + ConfigurableLanguage::createFromLangcode('ur')->save(); // Enable translation for the article content type and ensure the change is // picked up. \Drupal::service('content_translation.manager')->setEnabled('node', 'article', TRUE); diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -84,7 +84,7 @@ } foreach ($expected_results as $tid => $values) { - /** @var Term $term */ + /** @var \Drupal\taxonomy\Entity\Term $term */ $term = $terms[$tid]; $language = isset($values['language']) ? $values['language'] . ' - ' : ''; $this->assertSame("{$language}term {$tid} of vocabulary {$values['source_vid']}", $term->name->value); diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -installEntitySchema('taxonomy_term'); - $this->installConfig(static::$modules); - $this->executeMigrations([ - 'd6_node_type', - 'd6_field', - 'd6_taxonomy_vocabulary', - 'd6_field_instance', - 'd6_taxonomy_term', - 'd6_taxonomy_term_translation', - ]); - } - - /** - * Validate a migrated term contains the expected values. - * - * @param int $id - * Entity ID to load and check. - * @param string $expected_language - * The language code for this term. - * @param string $expected_label - * The label the migrated entity should have. - * @param string $expected_vid - * The parent vocabulary the migrated entity should have. - * @param string $expected_description - * The description the migrated entity should have. - * @param string $expected_format - * The format the migrated entity should have. - * @param int $expected_weight - * The weight the migrated entity should have. - * @param array $expected_parents - * The parent terms the migrated entity should have. - * @param int $expected_field_integer_value - * The value the migrated entity field should have. - * @param int $expected_term_reference_tid - * The term reference ID the migrated entity field should have. - */ - protected function assertEntity($id, $expected_language, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, $expected_parents = [], $expected_field_integer_value = NULL, $expected_term_reference_tid = NULL) { - /** @var \Drupal\taxonomy\TermInterface $entity */ - $entity = Term::load($id); - $this->assertInstanceOf(TermInterface::class, $entity); - $this->assertSame($expected_language, $entity->language()->getId()); - $this->assertSame($expected_label, $entity->label()); - $this->assertSame($expected_vid, $entity->getVocabularyId()); - $this->assertSame($expected_description, $entity->getDescription()); - $this->assertSame($expected_format, $entity->getFormat()); - $this->assertSame($expected_weight, $entity->getWeight()); - $this->assertHierarchy($expected_vid, $id, $expected_parents); - } - - /** - * Assert that a term is present in the tree storage, with the right parents. - * - * @param string $vid - * Vocabulary ID. - * @param int $tid - * ID of the term to check. - * @param array $parent_ids - * The expected parent term IDs. - */ - protected function assertHierarchy($vid, $tid, array $parent_ids) { - if (!isset($this->treeData[$vid])) { - $tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid); - $this->treeData[$vid] = []; - foreach ($tree as $item) { - $this->treeData[$vid][$item->tid] = $item; - } - } - - $this->assertArrayHasKey($tid, $this->treeData[$vid], "Term $tid exists in taxonomy tree"); - $term = $this->treeData[$vid][$tid]; - $this->assertEquals($parent_ids, array_filter($term->parents), "Term $tid has correct parents in taxonomy tree"); - } - - /** - * Tests the Drupal 6 i18n taxonomy term to Drupal 8 migration. - */ - public function testTranslatedTaxonomyTerms() { - $this->assertEntity(1, 'zu', 'zu - term 1 of vocabulary 1', 'vocabulary_1_i_0_', 'zu - description of term 1 of vocabulary 1', NULL, '0', []); - $this->assertEntity(2, 'fr', 'fr - term 2 of vocabulary 2', 'vocabulary_2_i_1_', 'fr - description of term 2 of vocabulary 2', NULL, '3', []); - $this->assertEntity(3, 'fr', 'fr - term 3 of vocabulary 2', 'vocabulary_2_i_1_', 'fr - description of term 3 of vocabulary 2', NULL, '4', ['2']); - $this->assertEntity(4, 'en', 'term 4 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 4 of vocabulary 3', NULL, '6', []); - $this->assertEntity(5, 'en', 'term 5 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 5 of vocabulary 3', NULL, '7', ['4']); - $this->assertEntity(6, 'en', 'term 6 of vocabulary 3', 'vocabulary_3_i_2_', 'description of term 6 of vocabulary 3', NULL, '8', ['4', '5']); - $this->assertEntity(7, 'fr', 'fr - term 2 of vocabulary 1', 'vocabulary_1_i_0_', 'fr - desc of term 2 vocab 1', NULL, '0', []); - } - -} diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php --- a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,7 +51,7 @@ $this->plugin->processFieldValues($this->migration, 'somefieldname', []); $expected = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => 'somefieldname', 'process' => [ 'target_id' => 'tid', diff -r bfffd8d7479a -r 7a779792577d core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php --- a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,7 +50,7 @@ $this->plugin->processFieldValues($this->migration, 'somefieldname', []); $expected = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => 'somefieldname', 'process' => [ 'target_id' => 'tid', diff -r bfffd8d7479a -r 7a779792577d core/modules/text/src/Plugin/migrate/cckfield/TextField.php --- a/core/modules/text/src/Plugin/migrate/cckfield/TextField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/text/src/Plugin/migrate/cckfield/TextField.php Fri Feb 23 15:52:07 2018 +0000 @@ -98,7 +98,7 @@ } $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => $process, ]; diff -r bfffd8d7479a -r 7a779792577d core/modules/text/src/Plugin/migrate/field/d6/TextField.php --- a/core/modules/text/src/Plugin/migrate/field/d6/TextField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/text/src/Plugin/migrate/field/d6/TextField.php Fri Feb 23 15:52:07 2018 +0000 @@ -90,7 +90,7 @@ } $process = [ - 'plugin' => 'iterator', + 'plugin' => 'sub_process', 'source' => $field_name, 'process' => $process, ]; diff -r bfffd8d7479a -r 7a779792577d core/modules/text/tests/src/Unit/Migrate/TextCckTest.php --- a/core/modules/text/tests/src/Unit/Migrate/TextCckTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/text/tests/src/Unit/Migrate/TextCckTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -55,7 +55,7 @@ $this->plugin->processCckFieldValues($this->migration, 'body', $field_info); $process = $this->migration->getProcess(); - $this->assertSame('iterator', $process['plugin']); + $this->assertSame('sub_process', $process['plugin']); $this->assertSame('body', $process['source']); $this->assertSame('value', $process['process']['value']); diff -r bfffd8d7479a -r 7a779792577d core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php --- a/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -55,7 +55,7 @@ $this->plugin->processFieldValues($this->migration, 'body', $field_info); $process = $this->migration->getProcess(); - $this->assertSame('iterator', $process['plugin']); + $this->assertSame('sub_process', $process['plugin']); $this->assertSame('body', $process['source']); $this->assertSame('value', $process['process']['value']); diff -r bfffd8d7479a -r 7a779792577d core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php --- a/core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -55,7 +55,7 @@ $this->plugin->processCckFieldValues($this->migration, 'body', $field_info); $process = $this->migration->getProcess(); - $this->assertSame('iterator', $process['plugin']); + $this->assertSame('sub_process', $process['plugin']); $this->assertSame('body', $process['source']); $this->assertSame('value', $process['process']['value']); diff -r bfffd8d7479a -r 7a779792577d core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php --- a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,7 +54,7 @@ $this->plugin->processFieldValues($this->migration, 'body', $field_info); $process = $this->migration->getProcess(); - $this->assertSame('iterator', $process['plugin']); + $this->assertSame('sub_process', $process['plugin']); $this->assertSame('body', $process['source']); $this->assertSame('value', $process['process']['value']); diff -r bfffd8d7479a -r 7a779792577d core/modules/toolbar/toolbar.api.php --- a/core/modules/toolbar/toolbar.api.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/toolbar/toolbar.api.php Fri Feb 23 15:52:07 2018 +0000 @@ -152,10 +152,10 @@ /** * Alter the toolbar menu after hook_toolbar() is invoked. * - * This hook is invoked by toolbar_view() immediately after hook_toolbar(). The - * toolbar definitions are passed in by reference. Each element of the $items - * array is one item returned by a module from hook_toolbar(). Additional items - * may be added, or existing items altered. + * This hook is invoked by Toolbar::preRenderToolbar() immediately after + * hook_toolbar(). The toolbar definitions are passed in by reference. Each + * element of the $items array is one item returned by a module from + * hook_toolbar(). Additional items may be added, or existing items altered. * * @param $items * Associative array of toolbar menu definitions returned from hook_toolbar(). diff -r bfffd8d7479a -r 7a779792577d core/modules/tour/tests/src/Functional/TourTestBase.php --- a/core/modules/tour/tests/src/Functional/TourTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/tour/tests/src/Functional/TourTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,14 +50,13 @@ // Check for corresponding page elements. $total = 0; $modals = 0; - $raw_content = $this->getSession()->getPage()->getContent(); foreach ($tips as $tip) { if (!empty($tip['data-id'])) { - $elements = \PHPUnit_Util_XML::cssSelect('#' . $tip['data-id'], TRUE, $raw_content, TRUE); + $elements = $this->getSession()->getPage()->findAll('css', '#' . $tip['data-id']); $this->assertTrue(!empty($elements) && count($elements) === 1, format_string('Found corresponding page element for tour tip with id #%data-id', ['%data-id' => $tip['data-id']])); } elseif (!empty($tip['data-class'])) { - $elements = \PHPUnit_Util_XML::cssSelect('.' . $tip['data-class'], TRUE, $raw_content, TRUE); + $elements = $this->getSession()->getPage()->findAll('css', '.' . $tip['data-class']); $this->assertFalse(empty($elements), format_string('Found corresponding page element for tour tip with class .%data-class', ['%data-class' => $tip['data-class']])); } else { diff -r bfffd8d7479a -r 7a779792577d core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php --- a/core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,7 +41,7 @@ * @param string $version * The version of Drupal core. * - * @return BinaryFileResponse|Response + * @return \Symfony\Component\HttpFoundation\BinaryFileResponse|Response * A BinaryFileResponse object containing the content of the XML release file * for the specified project if one is available; a Response object with no * content otherwise. diff -r bfffd8d7479a -r 7a779792577d core/modules/update/tests/src/Unit/UpdateFetcherTest.php --- a/core/modules/update/tests/src/Unit/UpdateFetcherTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/update/tests/src/Unit/UpdateFetcherTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,7 +28,7 @@ */ protected function setUp() { $config_factory = $this->getConfigFactoryStub(['update.settings' => ['fetch_url' => 'http://www.example.com']]); - $http_client_mock = $this->getMock('\GuzzleHttp\ClientInterface'); + $http_client_mock = $this->createMock('\GuzzleHttp\ClientInterface'); $this->updateFetcher = new UpdateFetcher($config_factory, $http_client_mock); } diff -r bfffd8d7479a -r 7a779792577d core/modules/update/update.install --- a/core/modules/update/update.install Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/update/update.install Fri Feb 23 15:52:07 2018 +0000 @@ -108,15 +108,17 @@ if ($status != UPDATE_CURRENT) { $requirement['reason'] = $status; $requirement['severity'] = REQUIREMENT_ERROR; - // Append the available updates link to the message from - // _update_message_text(), and format the two translated strings together in - // a single paragraph. + // When updates are available, append the available updates link to the + // message from _update_message_text(), and format the two translated + // strings together in a single paragraph. $requirement['description'][] = ['#markup' => _update_message_text($type, $status)]; - if (_update_manager_access()) { - $requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the available updates page for more information and to install your missing updates.', [':available_updates' => \Drupal::url('update.report_update')])]; - } - else { - $requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the available updates page for more information.', [':available_updates' => \Drupal::url('update.status')])]; + if (!in_array($status, [UPDATE_UNKNOWN, UPDATE_NOT_CHECKED, UPDATE_NOT_FETCHED, UPDATE_FETCH_PENDING])) { + if (_update_manager_access()) { + $requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the available updates page for more information and to install your missing updates.', [':available_updates' => \Drupal::url('update.report_update')])]; + } + else { + $requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the available updates page for more information.', [':available_updates' => \Drupal::url('update.status')])]; + } } } switch ($status) { @@ -136,6 +138,7 @@ case UPDATE_UNKNOWN: case UPDATE_NOT_CHECKED: case UPDATE_NOT_FETCHED: + case UPDATE_FETCH_PENDING: $requirement_label = isset($project['reason']) ? $project['reason'] : t('Can not determine status'); $requirement['severity'] = REQUIREMENT_WARNING; break; diff -r bfffd8d7479a -r 7a779792577d core/modules/user/src/Plugin/Action/CancelUser.php --- a/core/modules/user/src/Plugin/Action/CancelUser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/user/src/Plugin/Action/CancelUser.php Fri Feb 23 15:52:07 2018 +0000 @@ -45,7 +45,7 @@ * The plugin implementation definition. * @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory * The tempstore factory. - * @param AccountInterface $current_user + * @param \Drupal\Core\Session\AccountInterface $current_user * Current user. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, PrivateTempStoreFactory $temp_store_factory, AccountInterface $current_user) { diff -r bfffd8d7479a -r 7a779792577d core/modules/user/src/Plugin/Search/UserSearch.php --- a/core/modules/user/src/Plugin/Search/UserSearch.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/user/src/Plugin/Search/UserSearch.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,11 +67,11 @@ /** * Creates a UserSearch object. * - * @param Connection $database + * @param \Drupal\Core\Database\Connection $database * The database connection. * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. - * @param ModuleHandlerInterface $module_handler + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. diff -r bfffd8d7479a -r 7a779792577d core/modules/user/src/Plugin/migrate/destination/EntityUser.php --- a/core/modules/user/src/Plugin/migrate/destination/EntityUser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/user/src/Plugin/migrate/destination/EntityUser.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,7 +39,7 @@ * The plugin implementation definition. * @param \Drupal\migrate\Plugin\MigrationInterface $migration * The migration. - * @param EntityStorageInterface $storage + * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The storage for this entity type. * @param array $bundles * The list of bundles this entity type has. diff -r bfffd8d7479a -r 7a779792577d core/modules/user/src/Plugin/views/wizard/Users.php --- a/core/modules/user/src/Plugin/views/wizard/Users.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/user/src/Plugin/views/wizard/Users.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,6 +21,8 @@ /** * Set the created column. + * + * @var string */ protected $createdColumn = 'created'; diff -r bfffd8d7479a -r 7a779792577d core/modules/user/src/PrivateTempStore.php --- a/core/modules/user/src/PrivateTempStore.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/user/src/PrivateTempStore.php Fri Feb 23 15:52:07 2018 +0000 @@ -68,7 +68,7 @@ /** * Constructs a new object for accessing data from a key/value store. * - * @param KeyValueStoreExpirableInterface $storage + * @param \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface $storage * The key/value storage object used for this data. Each storage object * represents a particular collection of data and will contain any number * of key/value pairs. diff -r bfffd8d7479a -r 7a779792577d core/modules/user/src/SharedTempStore.php --- a/core/modules/user/src/SharedTempStore.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/user/src/SharedTempStore.php Fri Feb 23 15:52:07 2018 +0000 @@ -77,7 +77,7 @@ /** * Constructs a new object for accessing data from a key/value store. * - * @param KeyValueStoreExpirableInterface $storage + * @param \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface $storage * The key/value storage object used for this data. Each storage object * represents a particular collection of data and will contain any number * of key/value pairs. diff -r bfffd8d7479a -r 7a779792577d core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php --- a/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,7 +21,7 @@ * Tests that a user can be assigned a role and that the role can be removed * again. */ - public function testAssignAndRemoveRole() { + public function testAssignAndRemoveRole() { $rid = $this->drupalCreateRole(['administer users']); $account = $this->drupalCreateUser(); diff -r bfffd8d7479a -r 7a779792577d core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php --- a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -77,7 +77,6 @@ $user3->addRole($this->role2->id()); $user3->save(); - /** @var \Drupal\Core\Entity\EntityAutocompleteMatcher $autocomplete */ $autocomplete = \Drupal::service('entity.autocomplete_matcher'); diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Annotation/ViewsDisplay.php --- a/core/modules/views/src/Annotation/ViewsDisplay.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Annotation/ViewsDisplay.php Fri Feb 23 15:52:07 2018 +0000 @@ -111,7 +111,7 @@ /** * The theme function used to render the display's output. * - * @return string + * @var string */ public $theme; diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Annotation/ViewsPager.php --- a/core/modules/views/src/Annotation/ViewsPager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Annotation/ViewsPager.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,7 +50,7 @@ /** * The theme function used to render the pager's output. * - * @return string + * @var string */ public $theme; diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Annotation/ViewsRow.php --- a/core/modules/views/src/Annotation/ViewsRow.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Annotation/ViewsRow.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,7 +50,7 @@ /** * The theme function used to render the row output. * - * @return string + * @var string */ public $theme; diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Element/View.php --- a/core/modules/views/src/Element/View.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Element/View.php Fri Feb 23 15:52:07 2018 +0000 @@ -53,7 +53,6 @@ // possible to manipulate the $element. $view->element['#pre_rendered'] = TRUE; - if (isset($element['#response'])) { $view->setResponse($element['#response']); } diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/ViewsHandlerInterface.php --- a/core/modules/views/src/Plugin/views/ViewsHandlerInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/ViewsHandlerInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -44,7 +44,7 @@ /** * Check whether given user has access to this handler. * - * @param AccountInterface $account + * @param \Drupal\Core\Session\AccountInterface $account * The user account to check. * * @return bool diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/cache/CachePluginBase.php --- a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -292,7 +292,7 @@ /** * Returns the row cache tags. * - * @param ResultRow $row + * @param \Drupal\views\ResultRow $row * A result row. * * @return string[] diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/display/DisplayPluginBase.php --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -164,7 +164,6 @@ } } - $this->setOptionDefaults($this->options, $this->defineOptions()); $this->display = &$display; @@ -1471,7 +1470,7 @@ '#title' => $this->t('Show contextual links'), '#default_value' => $this->getOption('show_admin_links'), ]; - break; + break; case 'use_more': $form['#title'] .= $this->t('Add a more link to the bottom of the display.'); $form['use_more'] = [ @@ -1866,7 +1865,7 @@ if (preg_match('/[^a-zA-Z0-9-_ ]/', $css_class)) { $form_state->setError($form['css_class'], $this->t('CSS classes must be alphanumeric or dashes only.')); } - break; + break; case 'display_id': if ($form_state->getValue('display_id')) { if (preg_match('/[^a-z0-9_]/', $form_state->getValue('display_id'))) { diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/field/FieldPluginBase.php --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -68,6 +68,9 @@ */ const RENDER_TEXT_PHASE_EMPTY = 2; + /** + * @var string + */ public $field_alias = 'unknown'; public $aliases = []; @@ -857,7 +860,6 @@ ], ]; - // Get a list of the available fields and arguments for token replacement. // Setup the tokens for fields. diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/filter/FilterPluginBase.php --- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -53,6 +53,8 @@ /** * Contains the operator which is used on the query. + * + * @var string */ public $operator = '='; @@ -104,7 +106,6 @@ $this->options['expose']['multiple'] = TRUE; } - // If there are relationships in the view, allow empty should be true // so that we can do IS NULL checks on items. Not all filters respect // allow empty, but string and numeric do and that covers enough. diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/pager/SqlBase.php --- a/core/modules/views/src/Plugin/views/pager/SqlBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/pager/SqlBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -132,7 +132,6 @@ ], ]; - $form['expose']['items_per_page_options_all'] = [ '#type' => 'checkbox', '#title' => $this->t('Allow user to display all items'), diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/query/Sql.php --- a/core/modules/views/src/Plugin/views/query/Sql.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/query/Sql.php Fri Feb 23 15:52:07 2018 +0000 @@ -61,6 +61,8 @@ /** * The default operator to use when connecting the WHERE groups. May be * AND or OR. + * + * @var string */ protected $groupOperator = 'AND'; @@ -82,9 +84,14 @@ /** * A flag as to whether or not to make the primary field distinct. + * + * @var bool */ public $distinct = FALSE; + /** + * @var bool + */ protected $hasAggregate = FALSE; /** diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/relationship/EntityReverse.php --- a/core/modules/views/src/Plugin/views/relationship/EntityReverse.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/relationship/EntityReverse.php Fri Feb 23 15:52:07 2018 +0000 @@ -71,7 +71,6 @@ } $first_join = $this->joinManager->createInstance($id, $first); - $this->first_alias = $this->query->addTable($this->definition['field table'], $this->relationship, $first_join); // Second, relate the field table to the entity specified using diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php --- a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php Fri Feb 23 15:52:07 2018 +0000 @@ -115,7 +115,6 @@ '#default_value' => $this->options['subquery_namespace'], ]; - // WIP: This stuff doesn't work yet: namespacing issues. // A list of suitable views to pick one as the subview. $views = ['' => '- None -']; diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/Tests/ViewResultAssertionTrait.php --- a/core/modules/views/src/Tests/ViewResultAssertionTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/Tests/ViewResultAssertionTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -88,7 +88,6 @@ if (property_exists($value, $view_column)) { $row[$expected_column] = (string) $value->$view_column; } - // The comparison will be done on the string representation of the value. // For entity fields we don't have the raw value. Let's try to fetch it // using the entity itself. elseif (empty($value->$view_column) && isset($view->field[$expected_column]) && ($field = $view->field[$expected_column]) && $field instanceof EntityField) { @@ -96,7 +95,10 @@ if (count(explode(':', $view_column)) == 2) { $column = explode(':', $view_column)[1]; } - $row[$expected_column] = $field->getValue($value, $column); + // The comparison will be done on the string representation of the + // value. + $field_value = $field->getValue($value, $column); + $row[$expected_column] = is_array($field_value) ? array_map('strval', $field_value) : (string) $field_value; } } $result[$key] = $row; diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/ViewExecutable.php --- a/core/modules/views/src/ViewExecutable.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/ViewExecutable.php Fri Feb 23 15:52:07 2018 +0000 @@ -619,7 +619,6 @@ $this->offset = $offset; - // If the pager is already initialized, pass it through to the pager. if (!empty($this->pager)) { $this->pager->setOffset($offset); diff -r bfffd8d7479a -r 7a779792577d core/modules/views/src/ViewsDataHelper.php --- a/core/modules/views/src/ViewsDataHelper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/src/ViewsDataHelper.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,7 +20,7 @@ /** * A prepared list of all fields, keyed by base_table and handler type. * - * @param array + * @var array */ protected $fields; diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/modules/views_entity_test/views_entity_test.module --- a/core/modules/views/tests/modules/views_entity_test/views_entity_test.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/modules/views_entity_test/views_entity_test.module Fri Feb 23 15:52:07 2018 +0000 @@ -45,3 +45,20 @@ // No opinion. return AccessResult::neutral(); } + +/** + * Implements hook_entity_load(). + * + * @see \Drupal\Tests\views\Kernel\Handler\FieldFieldTest::testSimpleExecute() + */ +function views_entity_test_entity_load(array $entities, $entity_type_id) { + if ($entity_type_id === 'entity_test') { + // Cast the value of an entity field to be something else than a string so + // we can check that + // \Drupal\views\Tests\ViewResultAssertionTrait::assertIdenticalResultsetHelper() + // takes care of converting all field values to strings. + foreach ($entities as $entity) { + $entity->user_id->target_id = (int) $entity->user_id->target_id; + } + } +} diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Functional/Plugin/AccessTest.php --- a/core/modules/views/tests/src/Functional/Plugin/AccessTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Functional/Plugin/AccessTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -25,7 +25,7 @@ /** * Modules to enable. * - * @return array + * @var array */ public static $modules = ['node']; diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Functional/Plugin/StyleTest.php --- a/core/modules/views/tests/src/Functional/Plugin/StyleTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Functional/Plugin/StyleTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -173,7 +173,6 @@ $expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_data_age = '28'; $expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_data_id = '3'; - // Alter the results to support the stripped case. if ($stripped) { @@ -194,7 +193,6 @@ $view->style_plugin->options['grouping'][1] = ['field' => 'age', 'rendered' => TRUE, 'rendered_strip' => TRUE]; } - // The newer api passes the value of the grouping as well. $sets_new_rendered = $view->style_plugin->renderGrouping($view->result, $view->style_plugin->options['grouping'], TRUE); diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php --- a/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,7 +24,7 @@ /** * {@inheritdoc} */ - public static $modules = ['field', 'entity_test', 'user', 'views_test_formatter']; + public static $modules = ['field', 'entity_test', 'user', 'views_test_formatter', 'views_entity_test']; /** * {@inheritdoc} @@ -234,13 +234,13 @@ $this->assertIdenticalResultset($executable, [ - ['id' => 1, 'field_test' => 3], - ['id' => 2, 'field_test' => 0], - ['id' => 3, 'field_test' => 8], - ['id' => 4, 'field_test' => 5], - ['id' => 5, 'field_test' => 6], + ['id' => 1, 'field_test' => 3, 'user_id' => 2], + ['id' => 2, 'field_test' => 0, 'user_id' => 3], + ['id' => 3, 'field_test' => 8, 'user_id' => 4], + ['id' => 4, 'field_test' => 5, 'user_id' => 5], + ['id' => 5, 'field_test' => 6, 'user_id' => 6], ], - ['id' => 'id', 'field_test' => 'field_test'] + ['id' => 'id', 'field_test' => 'field_test', 'user_id' => 'user_id'] ); } diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php --- a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -69,11 +69,20 @@ } $width = '0'; switch ($columns) { - case 5: $width = '20'; break; - case 4: $width = '25'; break; - case 3: $width = '33.3333'; break; - case 2: $width = '50'; break; - case 1: $width = '100'; break; + case 5: $width = '20'; + break; + + case 4: $width = '25'; + break; + + case 3: $width = '33.3333'; + break; + + case 2: $width = '50'; + break; + + case 1: $width = '100'; + break; } // Ensure last column exists. $result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, :columns) and starts-with(@style, :width)]', [':columns' => 'col-' . $columns, ':width' => 'width: ' . $width]); diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php --- a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -98,7 +98,6 @@ $this->assertViewsCacheTags($view, $base_tags, $do_assert_views_caches, $base_tags); $this->assertViewsCacheTagsFromStaticRenderArray($view, $base_tags, $do_assert_views_caches); - // Non-empty result (1 entity). /** @var \Drupal\Core\Entity\EntityInterface[] $entities */ $entities[] = $entity = EntityTest::create(); @@ -109,7 +108,6 @@ $this->assertViewsCacheTags($view, $tags_with_entity, $do_assert_views_caches, $tags_with_entity); $this->assertViewsCacheTagsFromStaticRenderArray($view, $tags_with_entity, $do_assert_views_caches); - // Paged result (more entities than the items-per-page limit). for ($i = 0; $i < 5; $i++) { $entities[] = $entity = EntityTest::create(); @@ -259,7 +257,6 @@ $this->assertViewsCacheTags($view, $result_tags_with_entity, $do_assert_views_caches, $render_tags_with_entity); $this->assertViewsCacheTagsFromStaticRenderArray($view, $render_tags_with_entity, $do_assert_views_caches); - // Paged result (more entities than the items-per-page limit). for ($i = 0; $i < 5; $i++) { $entities[] = $entity = EntityTest::create(); diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php --- a/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -92,7 +92,6 @@ ->method('getStyle') ->willReturn($this->stylePlugin); - $token = $this->getMockBuilder('Drupal\Core\Utility\Token') ->disableOriginalConstructor() ->getMock(); diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php --- a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -58,7 +58,6 @@ ]); $this->viewHandler->view->storage = $view_this; - $this->viewHandler->options['view_to_insert'] = 'other:default'; $this->assertArrayEquals(['config' => ['view.other']], $this->viewHandler->calculateDependencies()); diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php --- a/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -71,7 +71,6 @@ ['test_op_3', NULL, FALSE, TRUE], ])); - $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); // Setup values for IDs passed as strings or numbers. diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php --- a/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -46,7 +46,7 @@ /** * The handler definition of the counter field. * - * @return array + * @var array */ protected $definition; diff -r bfffd8d7479a -r 7a779792577d core/modules/views/tests/src/Unit/ViewsDataTest.php --- a/core/modules/views/tests/src/Unit/ViewsDataTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/tests/src/Unit/ViewsDataTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -236,7 +236,6 @@ ->method('alter') ->with('views_data', $expected_views_data); - // The cache should only be called once (before the clear() call) as get // will get all table data in the first get(). $this->cacheBackend->expects($this->at(0)) diff -r bfffd8d7479a -r 7a779792577d core/modules/views/views.views.inc --- a/core/modules/views/views.views.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views/views.views.inc Fri Feb 23 15:52:07 2018 +0000 @@ -171,7 +171,6 @@ } } - // Field modules can implement hook_field_views_data() to override the default // behavior for adding fields. $module_handler = \Drupal::moduleHandler(); diff -r bfffd8d7479a -r 7a779792577d core/modules/views_ui/src/ViewEditForm.php --- a/core/modules/views_ui/src/ViewEditForm.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views_ui/src/ViewEditForm.php Fri Feb 23 15:52:07 2018 +0000 @@ -162,7 +162,6 @@ ], ]; - $form['displays']['top'] = $this->renderDisplayTop($view); // The rest requires a display to be selected. diff -r bfffd8d7479a -r 7a779792577d core/modules/views_ui/tests/src/Kernel/TagTest.php --- a/core/modules/views_ui/tests/src/Kernel/TagTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views_ui/tests/src/Kernel/TagTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,7 +52,6 @@ $this->assertTrue(in_array($match, $suggestions), 'Make sure the returned array has the proper format.'); } - // Make sure that matching by a certain prefix works. $request->query->set('q', 'autocomplete_tag_test_even'); $result = $controller->autocompleteTag($request); diff -r bfffd8d7479a -r 7a779792577d core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php --- a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -75,7 +75,6 @@ ], ])); - $default_display = $this->getMock('Drupal\views\Plugin\views\display\DefaultDisplay', ['initDisplay'], [[], 'default', $display_manager->getDefinition('default')] diff -r bfffd8d7479a -r 7a779792577d core/modules/views_ui/views_ui.module --- a/core/modules/views_ui/views_ui.module Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views_ui/views_ui.module Fri Feb 23 15:52:07 2018 +0000 @@ -157,6 +157,13 @@ } /** + * Implements hook_theme_suggestions_HOOK(). + */ +function views_ui_theme_suggestions_views_ui_view_preview_section(array $variables) { + return ['views_ui_view_preview_section__' . $variables['section']]; +} + +/** * Returns contextual links for each handler of a certain section. * * @TODO diff -r bfffd8d7479a -r 7a779792577d core/modules/views_ui/views_ui.theme.inc --- a/core/modules/views_ui/views_ui.theme.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/modules/views_ui/views_ui.theme.inc Fri Feb 23 15:52:07 2018 +0000 @@ -547,10 +547,3 @@ $variables['links'] = $build; } } - -/** - * Implements hook_theme_suggestions_HOOK(). - */ -function views_ui_theme_suggestions_views_ui_view_preview_section(array $variables) { - return ['views_ui_view_preview_section__' . $variables['section']]; -} diff -r bfffd8d7479a -r 7a779792577d core/profiles/testing/modules/drupal_system_listing_compatible_test/src/Tests/SystemListingCompatibleTest.php --- a/core/profiles/testing/modules/drupal_system_listing_compatible_test/src/Tests/SystemListingCompatibleTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/profiles/testing/modules/drupal_system_listing_compatible_test/src/Tests/SystemListingCompatibleTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,6 +29,8 @@ * asserts that this test is found. * * @see SimpleTestInstallationProfileModuleTestsTestCase + * + * @var string */ protected $profile = 'minimal'; diff -r bfffd8d7479a -r 7a779792577d core/scripts/run-tests.sh --- a/core/scripts/run-tests.sh Fri Feb 23 15:51:18 2018 +0000 +++ b/core/scripts/run-tests.sh Fri Feb 23 15:52:07 2018 +0000 @@ -305,6 +305,10 @@ --non-html Removes escaping from output. Useful for reading results on the CLI. + --suppress-deprecations + + Stops tests from failing if deprecation errors are triggered. + [,[, ...]] One or more tests to be run. By default, these are interpreted @@ -369,6 +373,7 @@ 'test_names' => array(), 'repeat' => 1, 'die-on-fail' => FALSE, + 'suppress-deprecations' => FALSE, 'browser' => FALSE, // Used internally. 'test-id' => 0, @@ -784,6 +789,12 @@ $methods = array(); } $test = new $class_name($test_id); + if ($args['suppress-deprecations']) { + putenv('SYMFONY_DEPRECATIONS_HELPER=disabled'); + } + else { + putenv('SYMFONY_DEPRECATIONS_HELPER=strict'); + } if (is_subclass_of($test_class, TestCase::class)) { $status = simpletest_script_run_phpunit($test_id, $test_class); } @@ -834,7 +845,7 @@ } $command .= ' --php ' . escapeshellarg($php); $command .= " --test-id $test_id"; - foreach (array('verbose', 'keep-results', 'color', 'die-on-fail') as $arg) { + foreach (array('verbose', 'keep-results', 'color', 'die-on-fail', 'suppress-deprecations') as $arg) { if ($args[$arg]) { $command .= ' --' . $arg; } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -633,4 +633,10 @@ $this->assertSession()->pageTextContains('Test page text.'); } + public function testGetDefaultDriveInstance() { + putenv('MINK_DRIVER_ARGS=' . json_encode([NULL, ['key1' => ['key2' => ['key3' => 3, 'key3.1' => 3.1]]]])); + $this->getDefaultDriverInstance(); + $this->assertEquals([NULL, ['key1' => ['key2' => ['key3' => 3, 'key3.1' => 3.1]]]], $this->minkDefaultDriverArgs); + } + } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php --- a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -112,7 +112,6 @@ 'translatable' => FALSE, ])->save(); - entity_get_form_display($this->entityTypeId, $this->entityTypeId, 'default') ->setComponent($this->fieldNameSingle, ['type' => 'test_field_widget']) ->setComponent($this->fieldNameMultiple, ['type' => 'test_field_widget']) diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,33 @@ +container->get('module_installer')->install(['router_test']); + // Note that on DrupalCI the test site is installed in a sub directory so + // we cannot use ::assertEquals(). + $this->assertStringEndsWith('/admin', \Drupal::state()->get('Drupal\lazy_route_provider_install_test\PluginManager')); + $this->assertStringEndsWith('/router_test/test1', \Drupal::state()->get('router_test_install')); + // If there is an exception thrown in rebuilding a route then the state + // 'lazy_route_provider_install_test_menu_links_discovered_alter' will be + // set. + // @see lazy_route_provider_install_test_menu_links_discovered_alter(). + $this->assertEquals('success', \Drupal::state()->get('lazy_route_provider_install_test_menu_links_discovered_alter', NULL)); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php --- a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,7 +49,6 @@ // a fixed location and naming. $this->assertIdentical(drupal_get_filename('profile', 'testing'), 'core/profiles/testing/testing.info.yml'); - // Generate a non-existing module name. $non_existing_module = uniqid("", TRUE); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -235,9 +235,9 @@ // Ensure that alphabetical order has no influence on dependency fixing and // removal. return [ - [['a', 'b', 'c', 'd']], - [['d', 'c', 'b', 'a']], - [['c', 'd', 'a', 'b']], + [['a', 'b', 'c', 'd', 'e']], + [['e', 'd', 'c', 'b', 'a']], + [['e', 'c', 'd', 'a', 'b']], ]; } @@ -316,6 +316,25 @@ ); $entity_4->save(); + // Entity 5 will be fixed because it is dependent on entity 3, which is + // unchanged, and entity 1 which will be fixed because + // \Drupal\config_test\Entity::onDependencyRemoval() will remove the + // dependency. + $entity_5 = $storage->create( + [ + 'id' => 'entity_' . $entity_id_suffixes[4], + 'dependencies' => [ + 'enforced' => [ + 'config' => [ + $entity_1->getConfigDependencyName(), + $entity_3->getConfigDependencyName(), + ], + ], + ], + ] + ); + $entity_5->save(); + // Set a more complicated test where dependencies will be fixed. \Drupal::state()->set('config_test.fix_dependencies', [$entity_1->getConfigDependencyName()]); \Drupal::state()->set('config_test.on_dependency_removal_called', []); @@ -323,14 +342,22 @@ // Do a dry run using // \Drupal\Core\Config\ConfigManager::getConfigEntitiesToChangeOnDependencyRemoval(). $config_entities = $config_manager->getConfigEntitiesToChangeOnDependencyRemoval('module', ['node']); + + // Assert that \Drupal\config_test\Entity\ConfigTest::onDependencyRemoval() + // is called as expected and with the correct dependencies. + $called = \Drupal::state()->get('config_test.on_dependency_removal_called', []); + $this->assertArrayNotHasKey($entity_3->id(), $called, 'ConfigEntityInterface::onDependencyRemoval() is not called for entity 3.'); + $this->assertSame([$entity_1->id(), $entity_4->id(), $entity_2->id(), $entity_5->id()], array_keys($called), 'The most dependent entites have ConfigEntityInterface::onDependencyRemoval() called first.'); + $this->assertSame(['config' => [], 'content' => [], 'module' => ['node'], 'theme' => []], $called[$entity_1->id()]); + $this->assertSame(['config' => [$entity_1->getConfigDependencyName()], 'content' => [], 'module' => [], 'theme' => []], $called[$entity_2->id()]); + $this->assertSame(['config' => [$entity_1->getConfigDependencyName()], 'content' => [], 'module' => ['node'], 'theme' => []], $called[$entity_4->id()]); + $this->assertSame(['config' => [$entity_1->getConfigDependencyName()], 'content' => [], 'module' => [], 'theme' => []], $called[$entity_5->id()]); + $this->assertEqual($entity_1->uuid(), $config_entities['delete'][1]->uuid(), 'Entity 1 will be deleted.'); - $this->assertEqual($entity_2->uuid(), reset($config_entities['update'])->uuid(), 'Entity 2 will be updated.'); + $this->assertEqual($entity_2->uuid(), $config_entities['update'][0]->uuid(), 'Entity 2 will be updated.'); $this->assertEqual($entity_3->uuid(), reset($config_entities['unchanged'])->uuid(), 'Entity 3 is not changed.'); $this->assertEqual($entity_4->uuid(), $config_entities['delete'][0]->uuid(), 'Entity 4 will be deleted.'); - - $called = \Drupal::state()->get('config_test.on_dependency_removal_called', []); - $this->assertFalse(in_array($entity_3->id(), $called), 'ConfigEntityInterface::onDependencyRemoval() is not called for entity 3.'); - $this->assertSame([$entity_1->id(), $entity_4->id(), $entity_2->id()], $called, 'The most dependent entites have ConfigEntityInterface::onDependencyRemoval() called first.'); + $this->assertEqual($entity_5->uuid(), $config_entities['update'][1]->uuid(), 'Entity 5 is updated.'); // Perform a module rebuild so we can know where the node module is located // and uninstall it. @@ -443,8 +470,11 @@ $this->assertSame($expected, $config_entity_ids); $called = \Drupal::state()->get('config_test.on_dependency_removal_called', []); - $this->assertFalse(in_array($entity_3->id(), $called), 'ConfigEntityInterface::onDependencyRemoval() is not called for entity 3.'); - $this->assertSame([$entity_1->id(), $entity_4->id(), $entity_2->id()], $called, 'The most dependent entities have ConfigEntityInterface::onDependencyRemoval() called first.'); + $this->assertArrayNotHasKey($entity_3->id(), $called, 'ConfigEntityInterface::onDependencyRemoval() is not called for entity 3.'); + $this->assertSame([$entity_1->id(), $entity_4->id(), $entity_2->id()], array_keys($called), 'The most dependent entities have ConfigEntityInterface::onDependencyRemoval() called first.'); + $this->assertSame(['config' => [], 'content' => [], 'module' => ['node'], 'theme' => []], $called[$entity_1->id()]); + $this->assertSame(['config' => [], 'content' => [], 'module' => ['node'], 'theme' => []], $called[$entity_2->id()]); + $this->assertSame(['config' => [], 'content' => [], 'module' => ['node'], 'theme' => []], $called[$entity_4->id()]); // Perform a module rebuild so we can know where the node module is located // and uninstall it. diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -75,7 +75,7 @@ // Test diffing a renamed config entity. $test_entity_id = $this->randomMachineName(); - $test_entity = entity_create('config_test', [ + $test_entity = \Drupal::entityTypeManager()->getStorage('config_test')->create([ 'id' => $test_entity_id, 'label' => $this->randomMachineName(), ]); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,7 +24,7 @@ } public function testNormalize() { - $config_entity = entity_create('config_test', ['id' => 'system', 'label' => 'foobar', 'weight' => 1]); + $config_entity = \Drupal::entityTypeManager()->getStorage('config_test')->create(['id' => 'system', 'label' => 'foobar', 'weight' => 1]); $config_entity->save(); // Modify stored config entity, this is comparable with a schema change. diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -22,7 +22,7 @@ * Tests the enabling/disabling of entities. */ public function testCRUD() { - $entity = entity_create('config_test', [ + $entity = \Drupal::entityTypeManager()->getStorage('config_test')->create([ 'id' => strtolower($this->randomMachineName()), ]); $this->assertTrue($entity->status(), 'Default status is enabled.'); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,7 +67,7 @@ public function testRenameValidation() { // Create a test entity. $test_entity_id = $this->randomMachineName(); - $test_entity = entity_create('config_test', [ + $test_entity = \Drupal::entityTypeManager()->getStorage('config_test')->create([ 'id' => $test_entity_id, 'label' => $this->randomMachineName(), ]); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -692,7 +692,7 @@ // does not use an install profile. This situation should be impossible // to get in but site's can removed the install profile setting from // settings.php so the test is valid. - $this->assertEqual(['Cannot change the install profile from this_will_not_work to once Drupal is installed.'], $error_log); + $this->assertEqual(['Cannot change the install profile from to this_will_not_work once Drupal is installed.'], $error_log); } } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -211,7 +211,6 @@ $expected['mapping']['upscale']['label'] = 'Upscale'; $expected['type'] = 'image.effect.image_scale'; - $this->assertEqual($definition, $expected, 'Retrieved the right metadata for image.effect.image_scale'); // Most complex case, get metadata for actual configuration element. diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Database/SelectTest.php --- a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -467,7 +467,6 @@ ], ]; - $database = $this->container->get('database'); foreach ($test_groups as $test_group) { $query = $database->select('test', 't'); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -626,7 +626,8 @@ $key_value = $this->container->get('keyvalue')->get(QueryFactory::CONFIG_LOOKUP_PREFIX . 'config_test'); $test_entities = []; - $entity = entity_create('config_test', [ + $storage = \Drupal::entityTypeManager()->getStorage('config_test'); + $entity = $storage->create([ 'label' => $this->randomMachineName(), 'id' => '1', 'style' => 'test', @@ -635,11 +636,10 @@ $entity->enforceIsNew(); $entity->save(); - $expected[] = $entity->getConfigDependencyName(); $this->assertEqual($expected, $key_value->get('style:test')); - $entity = entity_create('config_test', [ + $entity = $storage->create([ 'label' => $this->randomMachineName(), 'id' => '2', 'style' => 'test', @@ -650,7 +650,7 @@ $expected[] = $entity->getConfigDependencyName(); $this->assertEqual($expected, $key_value->get('style:test')); - $entity = entity_create('config_test', [ + $entity = $storage->create([ 'label' => $this->randomMachineName(), 'id' => '3', 'style' => 'blah', diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -131,7 +131,6 @@ } $this->assertTrue($different_references, 'The entity object and the cloned entity object reference different field item list objects.'); - // Reload the entity, initialize one translation, clone it and check that // both entity objects reference different field instances. $entity = $this->reloadEntity($entity); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -63,7 +63,6 @@ ]) ->shouldBeCalled(); - // An initially visible field, with a submitted region change. $entity->getComponent('field_start_visible_change_region') ->willReturn([ diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -739,13 +739,135 @@ } /** - * Test computed fields. + * Tests all the interaction points of a computed field. */ public function testComputedFields() { + $this->installEntitySchema('entity_test_computed_field'); + \Drupal::state()->set('entity_test_computed_field_item_list_value', ['foo computed']); + // Check that the values are not computed unnecessarily during the lifecycle + // of an entity when the field is not interacted with directly. + \Drupal::state()->set('computed_test_field_execution', 0); $entity = EntityTestComputedField::create([]); - $this->assertEquals($entity->computed_string_field->value, 'foo computed'); + $this->assertSame(0, \Drupal::state()->get('computed_test_field_execution', 0)); + + $entity->name->value = $this->randomString(); + $this->assertSame(0, \Drupal::state()->get('computed_test_field_execution', 0)); + + $entity->save(); + $this->assertSame(0, \Drupal::state()->get('computed_test_field_execution', 0)); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::getValue(). + \Drupal::state()->set('computed_test_field_execution', 0); + $entity = EntityTestComputedField::create([]); + $this->assertSame([['value' => 'foo computed']], $entity->computed_string_field->getValue()); + + // Check that the values are only computed once. + $this->assertSame(1, \Drupal::state()->get('computed_test_field_execution', 0)); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::setValue(). This also + // checks that a subsequent getter does not try to re-compute the value. + \Drupal::state()->set('computed_test_field_execution', 0); + $entity = EntityTestComputedField::create([]); + $entity->computed_string_field->setValue([ + ['value' => 'foo computed 1'], + ['value' => 'foo computed 2'], + ]); + $this->assertSame([['value' => 'foo computed 1'], ['value' => 'foo computed 2']], $entity->computed_string_field->getValue()); + + // Check that the values have not been computed when they were explicitly + // set. + $this->assertSame(0, \Drupal::state()->get('computed_test_field_execution', 0)); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::getString(). + $entity = EntityTestComputedField::create([]); + $this->assertSame('foo computed', $entity->computed_string_field->getString()); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::get(). + $entity = EntityTestComputedField::create([]); + $this->assertSame('foo computed', $entity->computed_string_field->get(0)->value); + $this->assertEmpty($entity->computed_string_field->get(1)); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::set(). + $entity = EntityTestComputedField::create([]); + $entity->computed_string_field->set(1, 'foo computed 1'); + $this->assertSame('foo computed', $entity->computed_string_field[0]->value); + $this->assertSame('foo computed 1', $entity->computed_string_field[1]->value); + $entity->computed_string_field->set(0, 'foo computed 0'); + $this->assertSame('foo computed 0', $entity->computed_string_field[0]->value); + $this->assertSame('foo computed 1', $entity->computed_string_field[1]->value); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::appendItem(). + $entity = EntityTestComputedField::create([]); + $entity->computed_string_field->appendItem('foo computed 1'); + $this->assertSame('foo computed', $entity->computed_string_field[0]->value); + $this->assertSame('foo computed 1', $entity->computed_string_field[1]->value); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::removeItem(). + $entity = EntityTestComputedField::create([]); + $entity->computed_string_field->removeItem(0); + $this->assertTrue($entity->computed_string_field->isEmpty()); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::isEmpty(). + \Drupal::state()->set('entity_test_computed_field_item_list_value', []); + $entity = EntityTestComputedField::create([]); + $this->assertTrue($entity->computed_string_field->isEmpty()); + + \Drupal::state()->set('entity_test_computed_field_item_list_value', ['foo computed']); + $entity = EntityTestComputedField::create([]); + $this->assertFalse($entity->computed_string_field->isEmpty()); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::filter(). + $filter_callback = function ($item) { + return !$item->isEmpty(); + }; + $entity = EntityTestComputedField::create([]); + $entity->computed_string_field->filter($filter_callback); + $this->assertCount(1, $entity->computed_string_field); + + // Add an empty item to the list and check that it is filtered out. + $entity->computed_string_field->appendItem(); + $entity->computed_string_field->filter($filter_callback); + $this->assertCount(1, $entity->computed_string_field); + + // Add a non-empty item to the list and check that it is not filtered out. + $entity->computed_string_field->appendItem('foo computed 1'); + $entity->computed_string_field->filter($filter_callback); + $this->assertCount(2, $entity->computed_string_field); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::offsetExists(). + $entity = EntityTestComputedField::create([]); + $this->assertTrue($entity->computed_string_field->offsetExists(0)); + $this->assertFalse($entity->computed_string_field->offsetExists(1)); + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::getIterator(). + $entity = EntityTestComputedField::create([]); + foreach ($entity->computed_string_field as $delta => $item) { + $this->assertSame('foo computed', $item->value); + } + + // Test \Drupal\Core\TypedData\ComputedItemListTrait::count(). + $entity = EntityTestComputedField::create([]); + $this->assertCount(1, $entity->computed_string_field); + + // Check that computed items are not auto-created when they have no values. + \Drupal::state()->set('entity_test_computed_field_item_list_value', []); + $entity = EntityTestComputedField::create([]); + $this->assertCount(0, $entity->computed_string_field); + + // Test \Drupal\Core\Field\FieldItemList::equals() for a computed field. + \Drupal::state()->set('entity_test_computed_field_item_list_value', ['foo computed']); + $entity = EntityTestComputedField::create([]); + $computed_item_list1 = $entity->computed_string_field; + + $entity = EntityTestComputedField::create([]); + $computed_item_list2 = $entity->computed_string_field; + + $this->assertTrue($computed_item_list1->equals($computed_item_list2)); + + $computed_item_list2->value = 'foo computed 2'; + $this->assertFalse($computed_item_list1->equals($computed_item_list2)); } /** diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -819,7 +819,6 @@ )->execute(); $this->assertIdentical(count($result), 1, 'Case sensitive, exact match.'); - // Check the case insensitive field, ENDS_WITH operator. $result = \Drupal::entityQuery('entity_test_mulrev')->condition( 'field_ci', $fixtures[1]['lowercase'], 'ENDS_WITH' @@ -842,7 +841,6 @@ )->execute(); $this->assertIdentical(count($result), 0, 'Case sensitive, exact match.'); - // Check the case insensitive field, CONTAINS operator, use the inner 8 // characters of the uppercase and lowercase strings. $result = \Drupal::entityQuery('entity_test_mulrev')->condition( diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,6 +3,7 @@ namespace Drupal\KernelTests\Core\Entity; use Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase; +use Drupal\language\Entity\ConfigurableLanguage; /** * Tests the Entity Validation API. @@ -16,7 +17,7 @@ * * @var array */ - public static $modules = ['filter', 'text']; + public static $modules = ['filter', 'text', 'language']; /** * @var string @@ -39,6 +40,10 @@ protected function setUp() { parent::setUp(); + // Enable an additional language. + ConfigurableLanguage::createFromLangcode('de') + ->save(); + // Create the test field. module_load_install('entity_test'); entity_test_install(); @@ -196,8 +201,53 @@ $this->assertTrue($constraint instanceof CompositeConstraintBase, 'Constraint is composite constraint.'); $this->assertEqual('type', $violations[0]->getPropertyPath()); - /** @var CompositeConstraintBase $constraint */ + /** @var \Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase $constraint */ $this->assertEqual($constraint->coversFields(), ['name', 'type'], 'Information about covered fields can be retrieved.'); } + /** + * Tests the EntityChangedConstraintValidator with multiple translations. + */ + public function testEntityChangedConstraintOnConcurrentMultilingualEditing() { + $this->installEntitySchema('entity_test_mulrev_changed'); + $storage = \Drupal::entityTypeManager() + ->getStorage('entity_test_mulrev_changed'); + + // Create a test entity. + $entity = $this->createTestEntity('entity_test_mulrev_changed'); + $entity->save(); + + $entity->setChangedTime($entity->getChangedTime() - 1); + $violations = $entity->validate(); + $this->assertEquals(1, $violations->count()); + $this->assertEqual($violations[0]->getMessage(), 'The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved.'); + + $entity = $storage->loadUnchanged($entity->id()); + $translation = $entity->addTranslation('de'); + $entity->save(); + + // Ensure that the new translation has a newer changed timestamp than the + // default translation. + $this->assertGreaterThan($entity->getChangedTime(), $translation->getChangedTime()); + + // Simulate concurrent form editing by saving the entity with an altered + // non-translatable field in order for the changed timestamp to be updated + // across all entity translations. + $original_entity_time = $entity->getChangedTime(); + $entity->set('not_translatable', $this->randomString()); + $entity->save(); + // Simulate form submission of an uncached form by setting the previous + // timestamp of an entity translation on the saved entity object. This + // happens in the entity form API where we put the changed timestamp of + // the entity in a form hidden value and then set it on the entity which on + // form submit is loaded from the storage if the form is not yet cached. + $entity->setChangedTime($original_entity_time); + // Setting the changed timestamp from the user input on the entity loaded + // from the storage is used as a prevention from saving a form built with a + // previous version of the entity and thus reverting changes by other users. + $violations = $entity->validate(); + $this->assertEquals(1, $violations->count()); + $this->assertEqual($violations[0]->getMessage(), 'The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved.'); + } + } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php --- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -60,4 +60,29 @@ $this->assertEquals(1, $modules['module_handler_test_multiple_child'], 'Weight of module_handler_test_multiple_child is set.'); } + /** + * Tests cache bins defined by modules are removed when uninstalled. + * + * @covers ::removeCacheBins + */ + public function testCacheBinCleanup() { + $schema = $this->container->get('database')->schema(); + $table = 'cache_module_cachebin'; + + $module_installer = $this->container->get('module_installer'); + $module_installer->install(['module_cachebin']); + + // Prime the bin. + /** @var \Drupal\Core\Cache\CacheBackendInterface $cache_bin */ + $cache_bin = $this->container->get('module_cachebin.cache_bin'); + $cache_bin->set('foo', 'bar'); + + // A database backend is used so there is a convenient way check whether the + // backend is uninstalled. + $this->assertTrue($schema->tableExists($table)); + + $module_installer->uninstall(['module_cachebin']); + $this->assertFalse($schema->tableExists($table)); + } + } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php --- a/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,7 +21,7 @@ /** * Tests the rewriting of shipped file URLs by hook_file_url_alter(). */ - public function testShippedFileURL() { + public function testShippedFileURL() { // Test generating a URL to a shipped file (i.e. a file that is part of // Drupal core, a module or a theme, for example a JavaScript file). diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php --- a/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -214,7 +214,9 @@ ]; // Systems using non-bundled GD2 don't have imagerotate. Test if available. - if (function_exists('imagerotate')) { + // @todo Remove the version check once + // https://www.drupal.org/project/drupal/issues/2670966 is resolved. + if (function_exists('imagerotate') && (version_compare(phpversion(), '7.0.26') < 0)) { $operations += [ 'rotate_5' => [ 'function' => 'rotate', @@ -383,7 +385,7 @@ $image = $this->imageFactory->get(); $image->createNew(50, 20, image_type_to_extension($type, FALSE), '#ffff00'); $file = 'from_null' . image_type_to_extension($type); - $file_path = $directory . '/' . $file ; + $file_path = $directory . '/' . $file; $this->assertEqual(50, $image->getWidth(), SafeMarkup::format('Image file %file has the correct width.', ['%file' => $file])); $this->assertEqual(20, $image->getHeight(), SafeMarkup::format('Image file %file has the correct height.', ['%file' => $file])); $this->assertEqual(image_type_to_mime_type($type), $image->getMimeType(), SafeMarkup::format('Image file %file has the correct MIME type.', ['%file' => $file])); @@ -463,7 +465,7 @@ // Color at top-right pixel should be fully transparent while in memory, // fully opaque after flushing image to file. $file = 'image-test-no-transparent-color-set.gif'; - $file_path = $directory . '/' . $file ; + $file_path = $directory . '/' . $file; // Create image. $image = $this->imageFactory->get(); $image->createNew(50, 20, 'gif', NULL); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php --- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,7 +54,6 @@ ->execute(); } - // Perform a new set operation and then trigger garbage collection. $store->setWithExpire('autumn', 'winter', rand(500, 1000000)); system_cron(); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php --- a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -62,9 +62,9 @@ \Drupal::entityManager()->getStorage('menu')->create(['id' => 'menu1'])->save(); \Drupal::entityManager()->getStorage('menu')->create(['id' => 'menu2'])->save(); - \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu1', 'bundle' => 'menu_link_content'])->save(); - \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu1', 'bundle' => 'menu_link_content'])->save(); - \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu2', 'bundle' => 'menu_link_content'])->save(); + \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu1', 'bundle' => 'menu_link_content', 'title' => 'Link test'])->save(); + \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu1', 'bundle' => 'menu_link_content', 'title' => 'Link test'])->save(); + \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu2', 'bundle' => 'menu_link_content', 'title' => 'Link test'])->save(); $output = $this->linkTree->load('menu1', new MenuTreeParameters()); $this->assertEqual(count($output), 2); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Render/RenderTest.php --- a/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,7 +16,7 @@ * * @var array */ - public static $modules = ['system', 'common_test']; + public static $modules = ['system', 'common_test', 'theme_test']; /** * Tests theme preprocess functions being able to attach assets. @@ -44,6 +44,23 @@ } /** + * Ensures that render array children are processed correctly. + */ + public function testRenderChildren() { + // Ensure that #prefix and #suffix is only being printed once since that is + // the behaviour the caller code expects. + $build = [ + '#type' => 'container', + '#theme' => 'theme_test_render_element_children', + '#prefix' => 'kangaroo', + '#suffix' => 'kitten', + ]; + $this->render($build); + $this->removeWhiteSpace(); + $this->assertNoRaw('
    kangarookitten
    '); + } + + /** * Tests that we get an exception when we try to attach an illegal type. */ public function testProcessAttached() { diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php --- a/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -23,7 +23,7 @@ /** * A collection of shared fixture data for tests. * - * @var RoutingFixtures + * @var \Drupal\Tests\Core\Routing\RoutingFixtures */ protected $fixtures; diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php --- a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,7 +41,7 @@ /** * A collection of shared fixture data for tests. * - * @var RoutingFixtures + * @var \Drupal\Tests\Core\Routing\RoutingFixtures */ protected $fixtures; @@ -532,7 +532,6 @@ $request = Request::create($path, 'GET'); - $routes = $provider->getRoutesByPattern($path); $this->assertFalse(count($routes), 'No path found with this pattern.'); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php --- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -164,11 +164,11 @@ */ public function testThemeSuggestions() { // Mock the current page as the front page. - /** @var PathMatcherInterface $path_matcher */ + /** @var \Drupal\Core\Path\PathMatcherInterface $path_matcher */ $path_matcher = $this->prophesize(PathMatcherInterface::class); $path_matcher->isFrontPage()->willReturn(TRUE); $this->container->set('path.matcher', $path_matcher->reveal()); - /** @var CurrentPathStack $path_matcher */ + /** @var \Drupal\Core\Path\CurrentPathStack $path_matcher */ $path_current = $this->prophesize(CurrentPathStack::class); $path_current->getPath()->willReturn('/node/1'); $this->container->set('path.current', $path_current->reveal()); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/KernelTests/KernelTestBase.php --- a/core/tests/Drupal/KernelTests/KernelTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/KernelTests/KernelTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,6 +20,7 @@ use Drupal\simpletest\AssertContentTrait; use Drupal\Tests\AssertHelperTrait; use Drupal\Tests\ConfigTestTrait; +use Drupal\Tests\PhpunitCompatibilityTrait; use Drupal\Tests\RandomGeneratorTrait; use Drupal\Tests\TestRequirementsTrait; use Drupal\simpletest\TestServiceProvider; @@ -76,6 +77,7 @@ use RandomGeneratorTrait; use ConfigTestTrait; use TestRequirementsTrait; + use PhpunitCompatibilityTrait; /** * {@inheritdoc} @@ -324,10 +326,10 @@ private function bootKernel() { $this->setSetting('container_yamls', []); // Allow for test-specific overrides. - $settings_services_file = $this->root . '/sites/default' . '/testing.services.yml'; + $settings_services_file = $this->root . '/sites/default/testing.services.yml'; if (file_exists($settings_services_file)) { // Copy the testing-specific service overrides in place. - $testing_services_file = $this->root . '/' . $this->siteDirectory . '/services.yml'; + $testing_services_file = $this->siteDirectory . '/services.yml'; copy($settings_services_file, $testing_services_file); $this->setSetting('container_yamls', [$testing_services_file]); } @@ -827,7 +829,7 @@ foreach ($modules as $module) { if ($module_handler->moduleExists($module)) { - throw new \LogicException("$module module is already enabled."); + continue; } $module_handler->addModule($module, $module_list[$module]->getPath()); // Maintain the list of enabled modules in configuration. diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/BrowserTestBase.php --- a/core/tests/Drupal/Tests/BrowserTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/BrowserTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,6 +35,10 @@ * Drupal\Tests\yourmodule\Functional namespace and live in the * modules/yourmodule/tests/src/Functional directory. * + * Tests extending this base class should only translate text when testing + * translation functionality. For example, avoid wrapping test text with t() + * or TranslatableMarkup(). + * * @ingroup testing */ abstract class BrowserTestBase extends TestCase { @@ -62,6 +66,7 @@ createUser as drupalCreateUser; } use XdebugRequestTrait; + use PhpunitCompatibilityTrait; /** * The database prefix of this test run. @@ -342,7 +347,7 @@ protected function getDefaultDriverInstance() { // Get default driver params from environment if availables. if ($arg_json = getenv('MINK_DRIVER_ARGS')) { - $this->minkDefaultDriverArgs = json_decode($arg_json); + $this->minkDefaultDriverArgs = json_decode($arg_json, TRUE); } // Get and check default driver class from environment if availables. @@ -446,6 +451,15 @@ * {@inheritdoc} */ protected function setUp() { + // Installing Drupal creates 1000s of objects. Garbage collection of these + // objects is expensive. This appears to be causing random segmentation + // faults in PHP 5.x due to https://bugs.php.net/bug.php?id=72286. Once + // Drupal is installed is rebuilt, garbage collection is re-enabled. + $disable_gc = version_compare(PHP_VERSION, '7', '<') && gc_enabled(); + if ($disable_gc) { + gc_collect_cycles(); + gc_disable(); + } parent::setUp(); $this->setupBaseUrl(); @@ -466,6 +480,11 @@ // Set up the browser test output file. $this->initBrowserOutputFile(); + // If garbage collection was disabled prior to rebuilding container, + // re-enable it. + if ($disable_gc) { + gc_enable(); + } } /** @@ -777,10 +796,10 @@ * be unchecked. * @param string $submit * Value of the submit button whose click is to be emulated. For example, - * t('Save'). The processing of the request depends on this value. For - * example, a form may have one button with the value t('Save') and another - * button with the value t('Delete'), and execute different code depending - * on which one is clicked. + * 'Save'. The processing of the request depends on this value. For example, + * a form may have one button with the value 'Save' and another button with + * the value 'Delete', and execute different code depending on which one is + * clicked. * @param string $form_html_id * (optional) HTML ID of the form to be submitted. On some pages * there are many identical forms, so just using the value of the submit @@ -859,11 +878,11 @@ * @code * // First step in form. * $edit = array(...); - * $this->drupalPostForm('some_url', $edit, t('Save')); + * $this->drupalPostForm('some_url', $edit, 'Save'); * * // Second step in form. * $edit = array(...); - * $this->drupalPostForm(NULL, $edit, t('Save')); + * $this->drupalPostForm(NULL, $edit, 'Save'); * @endcode * @param array $edit * Field data in an associative array. Changes the current input fields @@ -893,10 +912,10 @@ * https://www.drupal.org/node/2802401 * @param string $submit * Value of the submit button whose click is to be emulated. For example, - * t('Save'). The processing of the request depends on this value. For - * example, a form may have one button with the value t('Save') and another - * button with the value t('Delete'), and execute different code depending - * on which one is clicked. + * 'Save'. The processing of the request depends on this value. For example, + * a form may have one button with the value 'Save' and another button with + * the value 'Delete', and execute different code depending on which one is + * clicked. * * This function can also be called to emulate an Ajax submission. In this * case, this value needs to be an array with the following keys: diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php --- a/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -167,7 +167,7 @@ * Assertion helper for testTimestamp and testDateTimestamp since they need * different dataProviders. * - * @param DateTimePlus $date + * @param \Drupal\Component\Datetime\DateTimePlus $date * DateTimePlus to test. * @input mixed $input * The original input passed to the test method. diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php --- a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -1043,7 +1043,7 @@ class MockService { /** - * @var ContainerInterface + * @var \Symfony\Component\DependencyInjection\ContainerInterface */ protected $container; @@ -1081,7 +1081,7 @@ /** * Sets the container object. * - * @param ContainerInterface $container + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container * The container to inject via setter injection. */ public function setContainer(ContainerInterface $container) { @@ -1091,7 +1091,7 @@ /** * Gets the container object. * - * @return ContainerInterface + * @return \Symfony\Component\DependencyInjection\ContainerInterface * The internally set container. */ public function getContainer() { diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php --- a/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -125,7 +125,6 @@ $class, ]; - // Test default configuration plus specific per collection setting. $data['default-plus-collection-setting'] = [ [ diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php --- a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,6 +4,8 @@ use Drupal\Component\PhpStorage\FileStorage; use Drupal\Component\Utility\Random; +use org\bovigo\vfs\vfsStreamDirectory; +use PHPUnit_Framework_Error_Warning; /** * @coversDefaultClass \Drupal\Component\PhpStorage\FileStorage @@ -87,4 +89,18 @@ unset($GLOBALS[$random]); } + /** + * @covers ::createDirectory + */ + public function testCreateDirectoryFailWarning() { + $directory = new vfsStreamDirectory('permissionDenied', 0200); + $storage = new FileStorage([ + 'directory' => $directory->url(), + 'bin' => 'test', + ]); + $code = "setExpectedException(PHPUnit_Framework_Error_Warning::class, 'mkdir(): Permission Denied'); + $storage->save('subdirectory/foo.php', $code); + } + } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Component/Utility/HtmlTest.php --- a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,9 +67,10 @@ [$id1, $id1, []], // Verify that valid UTF-8 characters are not stripped from the identifier. [$id2, $id2, []], - // Verify that invalid characters (including non-breaking space) are stripped from the identifier. + // Verify that double underscores are not stripped from the identifier. [$id3, $id3], - // Verify that double underscores are not stripped from the identifier. + // Verify that invalid characters (including non-breaking space) are + // stripped from the identifier. ['invalididentifier', 'invalid !"#$%&\'()*+,./:;<=>?@[\\]^`{|}~ identifier', []], // Verify that an identifier starting with a digit is replaced. ['_cssidentifier', '1cssidentifier', []], diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Access/AccessResultTest.php --- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -617,7 +617,6 @@ [$allowed_un, 'OR', $neutral_cf, FALSE, NULL], [$allowed_un, 'OR', $neutral_un, FALSE, NULL], - // Forbidden (ct) OR allowed (ct,cf,un). [$forbidden_ct, 'OR', $allowed_ct, TRUE, TRUE], [$forbidden_ct, 'OR', $allowed_cf, TRUE, TRUE], @@ -657,7 +656,6 @@ [$forbidden_un, 'OR', $forbidden_cf, FALSE, NULL], [$forbidden_un, 'OR', $forbidden_un, FALSE, NULL], - // Neutral (ct) OR allowed (ct,cf,un). [$neutral_ct, 'OR', $allowed_ct, TRUE, TRUE], [$neutral_ct, 'OR', $allowed_cf, TRUE, FALSE], @@ -697,7 +695,6 @@ [$neutral_un, 'OR', $forbidden_cf, FALSE, NULL], [$neutral_un, 'OR', $forbidden_un, FALSE, NULL], - // Allowed (ct) AND allowed (ct,cf,un). [$allowed_ct, 'AND', $allowed_ct, TRUE, TRUE], [$allowed_ct, 'AND', $allowed_cf, TRUE, FALSE], @@ -737,7 +734,6 @@ [$allowed_un, 'AND', $neutral_cf, FALSE, NULL], [$allowed_un, 'AND', $neutral_un, FALSE, NULL], - // Forbidden (ct) AND allowed (ct,cf,un). [$forbidden_ct, 'AND', $allowed_ct, TRUE, TRUE], [$forbidden_ct, 'AND', $allowed_cf, TRUE, TRUE], @@ -777,7 +773,6 @@ [$forbidden_un, 'AND', $forbidden_cf, FALSE, NULL], [$forbidden_un, 'AND', $forbidden_un, FALSE, NULL], - // Neutral (ct) AND allowed (ct,cf,un). [$neutral_ct, 'AND', $allowed_ct, TRUE, TRUE], [$neutral_ct, 'AND', $allowed_cf, TRUE, TRUE], diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php --- a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -25,6 +25,7 @@ use Drupal\Core\Ajax\SetDialogTitleCommand; use Drupal\Core\Ajax\RedirectCommand; use Drupal\Core\Ajax\UpdateBuildIdCommand; +use Drupal\Core\Ajax\OpenDialogCommand; /** * Test coverage for various classes in the \Drupal\Core\Ajax namespace. @@ -293,27 +294,16 @@ * @covers \Drupal\Core\Ajax\OpenDialogCommand */ public function testOpenDialogCommand() { - $command = $this->getMockBuilder('Drupal\Core\Ajax\OpenDialogCommand') - ->setConstructorArgs([ - '#some-dialog', 'Title', '

    Text!

    ', [ - 'url' => FALSE, - 'width' => 500, - ], - ]) - ->setMethods(['getRenderedContent']) - ->getMock(); - - // This method calls the render service, which isn't available. We want it - // to do nothing so we mock it to return a known value. - $command->expects($this->once()) - ->method('getRenderedContent') - ->willReturn('rendered content'); + $command = new OpenDialogCommand('#some-dialog', 'Title', '

    Text!

    ', [ + 'url' => FALSE, + 'width' => 500, + ]); $expected = [ 'command' => 'openDialog', 'selector' => '#some-dialog', 'settings' => NULL, - 'data' => 'rendered content', + 'data' => '

    Text!

    ', 'dialogOptions' => [ 'url' => FALSE, 'width' => 500, @@ -322,6 +312,10 @@ ], ]; $this->assertEquals($expected, $command->render()); + + $command->setDialogTitle('New title'); + $expected['dialogOptions']['title'] = 'New title'; + $this->assertEquals($expected, $command->render()); } /** diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php --- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -97,7 +97,7 @@ * bag so the setParameter() call effects the parent container as well. * * @param $service - * @return ContainerBuilder + * @return \Symfony\Component\DependencyInjection\ContainerBuilder */ protected function getSqliteContainer($service) { $container = new ContainerBuilder(); @@ -115,7 +115,7 @@ * bag so the setParameter() call effects the parent container as well. * * @param $service - * @return ContainerBuilder + * @return \Symfony\Component\DependencyInjection\ContainerBuilder */ protected function getMysqlContainer($service) { $container = new ContainerBuilder(); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -112,7 +112,7 @@ * * @param \stdClass $object * Any object, including prophesized mocks based on interfaces. - * @return RouteMatchInterface + * @return \Drupal\Core\Routing\RouteMatchInterface * A prophesized RouteMatchInterface. */ private function createRouteMatchForObject(\stdClass $object) { diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php --- a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -439,7 +439,6 @@ }) ->shouldBeCalled(); - $this->assertSame($expected, $this->entityFieldManager->getFieldStorageDefinitions('test_entity_type')); $this->entityFieldManager->testClearEntityFieldInfo(); $this->assertSame($expected, $this->entityFieldManager->getFieldStorageDefinitions('test_entity_type')); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php --- a/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,7 +67,7 @@ /** * Test destination detection and redirection. * - * @param Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * The request object with destination query set. * @param string|bool $expected * The expected target URL or FALSE. diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php --- a/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -100,7 +100,6 @@ RSS; - $data['invalid-feed'] = [$invalid_feed, $invalid_feed]; return $data; } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc --- a/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc Fri Feb 23 15:52:07 2018 +0000 @@ -8,4 +8,5 @@ /** * Test hook. */ -function module_handler_test_hook_include() {} +function module_handler_test_hook_include() { +} diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php --- a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,10 +28,24 @@ $container->set('plugin.manager.field.field_type', $field_type_manager); \Drupal::setContainer($container); + // Set up three properties, one of them being computed. + $property_definitions['0'] = $this->getMock('Drupal\Core\TypedData\DataDefinitionInterface'); + $property_definitions['0']->expects($this->any()) + ->method('isComputed') + ->willReturn(FALSE); + $property_definitions['1'] = $this->getMock('Drupal\Core\TypedData\DataDefinitionInterface'); + $property_definitions['1']->expects($this->any()) + ->method('isComputed') + ->willReturn(FALSE); + $property_definitions['2'] = $this->getMock('Drupal\Core\TypedData\DataDefinitionInterface'); + $property_definitions['2']->expects($this->any()) + ->method('isComputed') + ->willReturn(TRUE); + $field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface'); $field_storage_definition->expects($this->any()) - ->method('getColumns') - ->willReturn([0 => '0', 1 => '1']); + ->method('getPropertyDefinitions') + ->will($this->returnValue($property_definitions)); $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface'); $field_definition->expects($this->any()) ->method('getFieldStorageDefinition') @@ -95,6 +109,30 @@ // types. $datasets[] = [TRUE, $field_item_b, $field_item_e]; + /** @var \Drupal\Core\Field\FieldItemBase $field_item_f */ + $field_item_f = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE); + $field_item_f->setValue(['0' => 1, '1' => 2, '2' => 3]); + /** @var \Drupal\Core\Field\FieldItemBase $field_item_g */ + $field_item_g = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE); + $field_item_g->setValue(['0' => 1, '1' => 2, '2' => 4]); + + // Tests field item lists where both have same values for the non-computed + // properties ('0' and '1') and a different value for the computed one + // ('2'). + $datasets[] = [TRUE, $field_item_f, $field_item_g]; + + /** @var \Drupal\Core\Field\FieldItemBase $field_item_h */ + $field_item_h = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE); + $field_item_h->setValue(['0' => 1, '1' => 2, '3' => 3]); + /** @var \Drupal\Core\Field\FieldItemBase $field_item_i */ + $field_item_i = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE); + $field_item_i->setValue(['0' => 1, '1' => 2, '3' => 4]); + + // Tests field item lists where both have same values for the non-computed + // properties ('0' and '1') and a different value for a property that does + // not exist ('3'). + $datasets[] = [TRUE, $field_item_h, $field_item_i]; + return $datasets; } @@ -114,10 +152,20 @@ $container->set('plugin.manager.field.field_type', $field_type_manager); \Drupal::setContainer($container); + // Set up the properties of the field item. + $property_definitions['0'] = $this->getMock('Drupal\Core\TypedData\DataDefinitionInterface'); + $property_definitions['0']->expects($this->any()) + ->method('isComputed') + ->willReturn(FALSE); + $property_definitions['1'] = $this->getMock('Drupal\Core\TypedData\DataDefinitionInterface'); + $property_definitions['1']->expects($this->any()) + ->method('isComputed') + ->willReturn(FALSE); + $field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface'); $field_storage_definition->expects($this->any()) - ->method('getColumns') - ->willReturn([0 => '0', 1 => '1']); + ->method('getPropertyDefinitions') + ->will($this->returnValue($property_definitions)); $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface'); $field_definition->expects($this->any()) ->method('getFieldStorageDefinition') diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php --- a/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -181,7 +181,7 @@ $this->assertSame(200, $actual_response->headers->get('X-Status-Code')); $expected_commands[] = [ 'command' => 'insert', - 'method' => 'replaceWith', + 'method' => 'prepend', 'selector' => NULL, 'data' => $rendered_output, 'settings' => NULL, diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Image/ImageTest.php --- a/core/tests/Drupal/Tests/Core/Image/ImageTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Image/ImageTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -72,7 +72,7 @@ * * @param string $class_name * The name of the GD toolkit operation class to be mocked. - * @param ImageToolkitInterface $toolkit + * @param \Drupal\Core\Image\ImageToolkitInterface $toolkit * The image toolkit object. * * @return \PHPUnit_Framework_MockObject_MockObject diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -462,7 +462,6 @@ $mock->getCacheTags()->willReturn(isset($info['cache_tags']) ? $info['cache_tags'] : []); $mock->getCacheMaxAge()->willReturn(isset($info['cache_max_age']) ? $info['cache_max_age'] : Cache::PERMANENT); - $access_manager_map[] = [$info['route_name'], [], $this->account, TRUE, $info['access']]; $map[] = [$info['id'], [], $mock->reveal()]; diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php --- a/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -133,7 +133,6 @@ ->method('processInbound') ->willReturnArgument(0); - $this->assertTrue($this->pathValidator->isValid('test-path')); } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php --- a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -163,7 +163,6 @@ ], ]; - $expected_when_empty_metadata = [ '#cache' => [ 'contexts' => [], @@ -228,7 +227,6 @@ ], ]; - $data[] = [$empty_render_array, $empty_metadata]; $data[] = [$nonempty_render_array, $nonempty_metadata]; diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php --- a/core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -202,6 +202,22 @@ ]; $tags['linearGradient'] = [$element, '' . "\n" . '' . "\n" . '' . "\n"]; + // Simple link. + $element = [ + '#tag' => 'link', + ]; + $tags['link'] = [HtmlTag::preRenderConditionalComments($element), '' . "\n"]; + + // Conditional link. + $element = [ + '#tag' => 'link', + '#browsers' => [ + 'IE' => TRUE, + '!IE' => FALSE, + ], + ]; + $tags['conditional-link'] = [HtmlTag::preRenderConditionalComments($element), "\n" . '' . "\n"]; + return $tags; } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php --- a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -291,6 +291,42 @@ ]; $data[] = [$test_element, ['bar', 'foo'], $expected_cache_items]; + // Ensure that bubbleable metadata has been collected from children and set + // correctly to the main level of the render array. That ensures that correct + // bubbleable metadata exists if render array gets rendered multiple times. + $test_element = [ + '#cache' => [ + 'keys' => ['parent'], + 'tags' => ['yar', 'har'] + ], + '#markup' => 'parent', + 'child' => [ + '#render_children' => TRUE, + 'subchild' => [ + '#cache' => [ + 'contexts' => ['foo'], + 'tags' => ['fiddle', 'dee'], + ], + '#attached' => [ + 'library' => ['foo/bar'] + ], + '#markup' => '', + ] + ], + ]; + $expected_cache_items = [ + 'parent:foo' => [ + '#attached' => ['library' => ['foo/bar']], + '#cache' => [ + 'contexts' => ['foo'], + 'tags' => ['dee', 'fiddle', 'har', 'yar'], + 'max-age' => Cache::PERMANENT, + ], + '#markup' => 'parent', + ], + ]; + $data[] = [$test_element, ['foo'], $expected_cache_items]; + return $data; } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Render/RendererTest.php --- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -65,10 +65,8 @@ public function providerTestRenderBasic() { $data = []; - // Part 1: the most simplistic render arrays possible, none using #theme. - // Pass a NULL. $data[] = [NULL, '']; // Pass an empty string. @@ -216,7 +214,6 @@ // Part 2: render arrays using #theme and #theme_wrappers. - // Tests that #theme and #theme_wrappers can co-exist on an element. $build = [ '#theme' => 'common_test_foo', @@ -302,10 +299,8 @@ }; $data[] = [$build, '
    ' . "\n", $setup_code]; - // Part 3: render arrays using #markup as a fallback for #theme hooks. - // Theme suggestion is not implemented, #markup should be rendered. $build = [ '#theme' => ['suggestionnotimplemented'], @@ -357,10 +352,8 @@ ]; $data[] = [$build, $theme_function_output, $setup_code]; - // Part 4: handling of #children and child renderable elements. - // #theme is implemented so the values of both #children and 'child' will // be ignored - it is the responsibility of the theme hook to render these // if appropriate. @@ -410,6 +403,25 @@ }; $data[] = [$build, 'baz', $setup_code]; + // #theme is implemented but #render_children is TRUE. In this case the + // calling code is expecting only the children to be rendered. #prefix and + // #suffix should not be inherited for the children. + $build = [ + '#theme' => 'common_test_foo', + '#children' => '', + '#prefix' => 'kangaroo', + '#suffix' => 'unicorn', + '#render_children' => TRUE, + 'child' => [ + '#markup' => 'kitten', + ], + ]; + $setup_code = function () { + $this->themeManager->expects($this->never()) + ->method('render'); + }; + $data[] = [$build, 'kitten', $setup_code]; + return $data; } @@ -569,19 +581,21 @@ } /** - * Tests that a first render returns the rendered output and a second doesn't. + * Tests rendering same render array twice. * - * (Because of the #printed property.) + * Tests that a first render returns the rendered output and a second doesn't + * because of the #printed property. Also tests that correct metadata has been + * set for re-rendering. * * @covers ::render * @covers ::doRender + * + * @dataProvider providerRenderTwice */ - public function testRenderTwice() { - $build = [ - '#markup' => 'test', - ]; - - $this->assertEquals('test', $this->renderer->renderRoot($build)); + public function testRenderTwice($build) { + $this->assertEquals('kittens', $this->renderer->renderRoot($build)); + $this->assertEquals('kittens', $build['#markup']); + $this->assertEquals(['kittens-147'], $build['#cache']['tags']); $this->assertTrue($build['#printed']); // We don't want to reprint already printed render arrays. @@ -589,6 +603,60 @@ } /** + * Provides a list of render array iterations. + * + * @return array + */ + public function providerRenderTwice() { + return [ + [ + [ + '#markup' => 'kittens', + '#cache' => [ + 'tags' => ['kittens-147'] + ], + ], + ], + [ + [ + 'child' => [ + '#markup' => 'kittens', + '#cache' => [ + 'tags' => ['kittens-147'], + ], + ], + ], + ], + [ + [ + '#render_children' => TRUE, + 'child' => [ + '#markup' => 'kittens', + '#cache' => [ + 'tags' => ['kittens-147'], + ], + ], + ], + ], + ]; + } + + /** + * Ensures that #access is taken in account when rendering #render_children. + */ + public function testRenderChildrenAccess() { + $build = [ + '#access' => FALSE, + '#render_children' => TRUE, + 'child' => [ + '#markup' => 'kittens', + ], + ]; + + $this->assertEquals('', $this->renderer->renderRoot($build)); + } + + /** * Provides a list of both booleans. * * @return array diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php --- a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,7 +16,7 @@ * * @param $name * Route name. - * @param Route $route + * @param \Symfony\Component\Routing\Route $route * Request object * @param array $parameters * Parameters array diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php --- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -211,7 +211,6 @@ ->method('processOutbound') ->with($this->anything()); - // Check that the two generate methods return the same result. $this->assertGenerateFromRoute('test_1', [], [], $url, (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT)); @@ -232,7 +231,6 @@ ->method('processOutbound') ->with($this->anything()); - // Check that the two generate methods return the same result. $this->assertGenerateFromRoute('test_1', [], [], $url, (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT)); diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/Core/Site/SettingsTest.php --- a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,7 +28,7 @@ /** * @covers ::__construct */ - protected function setUp(){ + protected function setUp() { $this->config = [ 'one' => '1', 'two' => '2', diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/PhpunitCompatibilityTrait.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/PhpunitCompatibilityTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,142 @@ +supports('getMock')) { + $mock = $this->getMockBuilder($originalClassName) + ->setMethods($methods) + ->setConstructorArgs($arguments) + ->setMockClassName($mockClassName) + ->setProxyTarget($proxyTarget); + if ($callOriginalConstructor) { + $mock->enableOriginalConstructor(); + } + else { + $mock->disableOriginalConstructor(); + } + if ($callOriginalClone) { + $mock->enableOriginalClone(); + } + else { + $mock->disableOriginalClone(); + } + if ($callAutoload) { + $mock->enableAutoload(); + } + else { + $mock->disableAutoload(); + } + if ($cloneArguments) { + $mock->enableArgumentCloning(); + } + else { + $mock->disableArgumentCloning(); + } + if ($callOriginalMethods) { + $mock->enableProxyingToOriginalMethods(); + } + else { + $mock->disableProxyingToOriginalMethods(); + } + return $mock->getMock(); + } + else { + return parent::getMock($originalClassName, $methods, $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $cloneArguments, $callOriginalMethods, $proxyTarget); + } + } + + /** + * Returns a mock object for the specified class using the available method. + * + * The createMock method does not exist in PHPUnit 4. To provide forward + * compatibility this trait provides the createMock method and uses createMock + * if this method is available on the parent class or falls back to getMock if + * it isn't. + * + * @param string $originalClassName + * Name of the class to mock. + * + * @see \PHPUnit_Framework_TestCase::getMock + * + * @return \PHPUnit_Framework_MockObject_MockObject + */ + public function createMock($originalClassName) { + if ($this->supports('createMock')) { + return parent::createMock($originalClassName); + } + else { + return $this->getMock($originalClassName, [], [], '', FALSE, FALSE); + } + } + + /** + * Checks if the trait is used in a class that has a method. + * + * @param string $method + * Method to check. + * + * @return bool + * TRUE if the method is supported, FALSE if not. + */ + private function supports($method) { + // Get the parent class of the currently running test class. + $parent = get_parent_class($this); + // Ensure that the method_exists() check on the createMock method is carried + // out on the first parent of $this that does not have access to this + // trait's methods. This is because the trait also has a method called + // createMock(). Most often the check will be made on + // \PHPUnit\Framework\TestCase. + while (method_exists($parent, 'supports')) { + $parent = get_parent_class($parent); + } + return method_exists($parent, $method); + } + +} diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/PhpunitCompatibilityTraitTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/Tests/PhpunitCompatibilityTraitTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,115 @@ +assertSame($expected, $class->getMock($this->randomMachineName())); + } + + /** + * Tests that createMock is available and calls the correct parent method. + * + * @covers ::createMock + * @dataProvider providerMockVersions + */ + public function testCreateMock($className, $expected) { + $class = new $className(); + $this->assertSame($expected, $class->createMock($this->randomMachineName())); + } + + /** + * Returns the class names and the string they return. + * + * @return array + */ + public function providerMockVersions() { + return [ + [UnitTestCasePhpunit4TestClass::class, 'PHPUnit 4'], + [UnitTestCasePhpunit4TestClassExtends::class, 'PHPUnit 4'], + [UnitTestCasePhpunit6TestClass::class, 'PHPUnit 6'], + [UnitTestCasePhpunit6TestClassExtends::class, 'PHPUnit 6'], + ]; + } + +} + +/** + * Test class for \PHPUnit\Framework\TestCase in PHPUnit 4. + */ +class Phpunit4TestClass { + public function getMock($originalClassName) { + return 'PHPUnit 4'; + } + +} + +/** + * Test class for \PHPUnit\Framework\TestCase in PHPUnit 6. + */ +class Phpunit6TestClass { + public function createMock($originalClassName) { + return 'PHPUnit 6'; + } + + public function getMockbuilder() { + return new Mockbuilder(); + } + +} + +/** + * Test double for PHPUnit_Framework_MockObject_MockBuilder. + */ +class Mockbuilder { + public function __call($name, $arguments) { + return $this; + } + + public function getMock() { + return 'PHPUnit 6'; + } + +} + +/** + * Test class for \Drupal\Tests\UnitTestCase with PHPUnit 4. + */ +class UnitTestCasePhpunit4TestClass extends Phpunit4TestClass { + use PhpunitCompatibilityTrait; + +} + +/** + * Test class for \Drupal\Tests\UnitTestCase with PHPUnit 4. + */ +class UnitTestCasePhpunit4TestClassExtends extends UnitTestCasePhpunit4TestClass { +} + +/** + * Test class for \Drupal\Tests\UnitTestCase with PHPUnit 6. + */ +class UnitTestCasePhpunit6TestClass extends Phpunit6TestClass { + use PhpunitCompatibilityTrait; + +} + +/** + * Test class for \Drupal\Tests\UnitTestCase with PHPUnit 6. + */ +class UnitTestCasePhpunit6TestClassExtends extends UnitTestCasePhpunit6TestClass { +} diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/TestFileCreationTrait.php --- a/core/tests/Drupal/Tests/TestFileCreationTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/TestFileCreationTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -164,7 +164,8 @@ } // Create filename. - file_put_contents('public://' . $filename . '.txt', $text); + $filename = 'public://' . $filename . '.txt'; + file_put_contents($filename, $text); return $filename; } diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/UnitTestCase.php --- a/core/tests/Drupal/Tests/UnitTestCase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/UnitTestCase.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,6 +17,8 @@ */ abstract class UnitTestCase extends TestCase { + use PhpunitCompatibilityTrait; + /** * The random generator. * @@ -135,7 +137,7 @@ } // Construct a config factory with the array of configuration object stubs // as its return map. - $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface'); + $config_factory = $this->createMock('Drupal\Core\Config\ConfigFactoryInterface'); $config_factory->expects($this->any()) ->method('get') ->will($this->returnValueMap($config_get_map)); @@ -157,7 +159,7 @@ * A mocked config storage. */ public function getConfigStorageStub(array $configs) { - $config_storage = $this->getMock('Drupal\Core\Config\NullStorage'); + $config_storage = $this->createMock('Drupal\Core\Config\NullStorage'); $config_storage->expects($this->any()) ->method('listAll') ->will($this->returnValue(array_keys($configs))); @@ -204,7 +206,7 @@ * A mock translation object. */ public function getStringTranslationStub() { - $translation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface'); + $translation = $this->createMock('Drupal\Core\StringTranslation\TranslationInterface'); $translation->expects($this->any()) ->method('translate') ->willReturnCallback(function ($string, array $args = [], array $options = []) use ($translation) { @@ -234,7 +236,7 @@ * The container with the cache tags invalidator service. */ protected function getContainerWithCacheTagsInvalidator(CacheTagsInvalidatorInterface $cache_tags_validator) { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); $container->expects($this->any()) ->method('get') ->with('cache_tags.invalidator') @@ -251,7 +253,7 @@ * The class resolver stub. */ protected function getClassResolverStub() { - $class_resolver = $this->getMock('Drupal\Core\DependencyInjection\ClassResolverInterface'); + $class_resolver = $this->createMock('Drupal\Core\DependencyInjection\ClassResolverInterface'); $class_resolver->expects($this->any()) ->method('getInstanceFromDefinition') ->will($this->returnCallback(function ($class) { diff -r bfffd8d7479a -r 7a779792577d core/tests/Drupal/Tests/WebAssert.php --- a/core/tests/Drupal/Tests/WebAssert.php Fri Feb 23 15:51:18 2018 +0000 +++ b/core/tests/Drupal/Tests/WebAssert.php Fri Feb 23 15:52:07 2018 +0000 @@ -451,7 +451,7 @@ * @throws \Behat\Mink\Exception\ElementNotFoundException * @throws \Behat\Mink\Exception\ExpectationException */ - public function fieldDisabled($field, TraversableElement $container = NULL) { + public function fieldDisabled($field, TraversableElement $container = NULL) { $container = $container ?: $this->session->getPage(); $node = $container->findField($field); diff -r bfffd8d7479a -r 7a779792577d core/themes/seven/seven.theme --- a/core/themes/seven/seven.theme Fri Feb 23 15:51:18 2018 +0000 +++ b/core/themes/seven/seven.theme Fri Feb 23 15:52:07 2018 +0000 @@ -6,6 +6,7 @@ */ use Drupal\Core\Form\FormStateInterface; +use Drupal\media\MediaForm; /** * Implements hook_preprocess_HOOK() for HTML document templates. @@ -167,9 +168,14 @@ * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\media\MediaForm. */ function seven_form_media_form_alter(&$form, FormStateInterface $form_state) { - // @todo Revisit after https://www.drupal.org/node/2892304 is in. It - // introduces a footer region to these forms which will allow for us to - // display a top border over the published checkbox by defining a - // media-edit-form.html.twig template the same way node does. - $form['#attached']['library'][] = 'seven/media-form'; + $media_is_enabled = \Drupal::moduleHandler()->moduleExists('media'); + // Only attach CSS from core if this form comes from Media core, and not from + // the contrib Media Entity 1.x branch. + if ($media_is_enabled && $form_state->getFormObject() instanceof MediaForm) { + // @todo Revisit after https://www.drupal.org/node/2892304 is in. It + // introduces a footer region to these forms which will allow for us to + // display a top border over the published checkbox by defining a + // media-edit-form.html.twig template the same way node does. + $form['#attached']['library'][] = 'seven/media-form'; + } } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/LICENSE.txt --- a/modules/contrib/migrate_plus/LICENSE.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/README.txt --- a/modules/contrib/migrate_plus/README.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -The migrate_plus module extends the core migration system with API enhancements -and additional functionality, as well as providing practical examples. - -Extensions to base API -====================== -* A Migration configuration entity is provided, enabling persistance of dynamic -migration configuration. -* A ConfigEntityDiscovery class is implemented which enables plugin configuration -to be based on configuration entities. This is fully general - it can be used -for any configuration entity type, not just migrations. -* A MigrationConfigEntityPluginManager class and corresponding -plugin.manager.config_entity_migration service is provided, to enable discovery -and instantiation of migration plugins based on the Migration configuration -entity. -* A MigrationGroup configuration entity is provided, which enables migrations to -be organized in groups, and to maintain shared configuration in one place. -* A MigrateEvents::PREPARE_ROW event is provided to dispatch hook_prepare_row() -invocations as events. -* A SourcePluginExtension class is provided, enabling one to define fields and -IDs for a source plugin via configuration rather than requiring PHP code. - -Plugins -======= -* A Url source plugin is provided, implementing a common structure for -file-based data providers. -* XML and JSON fetchers and parsers for the Url source plugin are provided. - -Examples -======== -* The migrate_example submodule provides a fully functional and runnable -example migration scenario demonstrating the basic concepts and most common -techniques for SQL-based migrations. -* The migrate_example_advanced submodule provides examples of migration from -different kinds of sources, as well as less common techniques. diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/composer.json --- a/modules/contrib/migrate_plus/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -{ - "name": "drupal/migrate_plus", - "description": "Enhancements to core migration support.", - "type": "drupal-module", - "license": "GPL-2.0+", - "homepage": "https://www.drupal.org/project/migrate_plus", - "authors": [ - { - "name": "Mike Ryan", - "homepage":"https://www.drupal.org/u/mikeryan", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/migrate_plus", - "irc": "irc://irc.freenode.org/drupal-migrate", - "source": "https://cgit.drupalcode.org/migrate_plus" - }, - "minimum-stability": "dev", - "require": {} -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/config/schema/migrate_plus.data_types.schema.yml --- a/modules/contrib/migrate_plus/config/schema/migrate_plus.data_types.schema.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -# Basic data types for Migrate. - -migrate_plugin: - type: mapping - mapping: - plugin: - type: string - label: 'Plugin' - -migrate_destination: - type: migrate_plugin - label: 'Destination' - mapping: - overwrite_properties: - type: sequence - label: 'Properties to overwrite' - sequence: - type: string - label: 'Property' - -migrate_source: - type: migrate_plugin - label: 'Source' - mapping: - constants: - type: ignore - label: 'Constants' - -migrate_process: - type: migrate_plugin - label: 'Process' - -# Base schema for migrate source plugins that extend -# \Drupal\migrate\Plugin\migrate\source\SqlBase. -migrate_source_sql: - type: migrate_source - mapping: - target: - type: string - label: 'The migration database target' diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/config/schema/migrate_plus.destination.schema.yml --- a/modules/contrib/migrate_plus/config/schema/migrate_plus.destination.schema.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -# Schema for the migrate destination plugins. - -migrate_plus.destination.*: - type: migrate_destination - label: 'Default destination' - mapping: - no_stub: - type: boolean - label: 'Whether stubbing is allowed.' - default: false - -migrate_plus.destination.config: - type: migrate_destination - label: 'Config' - mapping: - config_name: - type: string - label: 'Configuration name' diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/config/schema/migrate_plus.process.schema.yml --- a/modules/contrib/migrate_plus/config/schema/migrate_plus.process.schema.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -# Schema for the migrate process plugins. - -migrate_plus.process.*: - type: migrate_process - label: 'Default process' - -migrate_plus.process.callback: - type: migrate_process - label: 'Callback process' - mapping: - callback: - type: string - label: 'Callback' - -migrate_plus.process.concat: - type: migrate_process - label: 'Concat process' - mapping: - delimiter: - type: string - label: 'Delimiter' - -migrate_plus.process.dedupe_entity: - type: migrate_process - label: 'Dedupe Entity process' - mapping: - entity_type: - type: string - label: 'Entity type' - field: - type: string - label: 'Field name' - postfix: - type: string - label: 'Postfix' - start: - type: integer - label: 'Start' - length: - type: integer - label: 'Length' - -migrate_plus.process.explode: - type: migrate_process - label: 'Explode process' - mapping: - delimiter: - type: string - label: 'Delimiter' - limit: - type: integer - label: 'Limit' - -migrate_plus.process.extract: - type: migrate_process - label: 'Extract process' - mapping: - default: - type: string - label: 'Default value' - -migrate_plus.process.flatten: - type: migrate_process - label: 'Flatten process' - -migrate_plus.process.get: - type: migrate_process - label: 'Get process' - mapping: - source: - type: string - label: 'Source key' - -migrate_plus.process.iterator: - type: migrate_process - label: 'Iterator process' - mapping: - process: - type: ignore - label: 'Process' - key: - type: string - label: 'Key' - -migrate_plus.process.machine_name: - type: migrate_process - label: 'Machine name process' - -migrate_plus.process.migration: - type: migrate_process - label: 'Migration process' - mapping: - migration: - type: sequence - label: 'Migration' - source: - type: sequence - label: 'Source keys' - source_ids: - type: string - label: 'Source IDs' - stub_id: - type: string - label: 'Stub ID' - -migrate_plus.process.route: - type: migrate_process - label: 'Route process' - -migrate_plus.process.skip_on_empty: - type: migrate_process - label: 'Skip on Empty' - -migrate_plus.process.skip_row_if_not_set: - type: migrate_process - label: 'Skip Row process if not set' - mapping: - index: - type: integer - label: 'Index' - -migrate_plus.process.static_map: - type: migrate_process - label: 'Static Map' - mapping: - map: - type: sequence - label: 'Map' - default_value: - type: string - label: 'Default value' - bypass: - type: boolean - label: 'Bypass lookup' - -migrate_plus.process.default_value: - type: migrate_process - label: 'Default value' - mapping: - strict: - type: boolean - label: 'Strict type check' - default_value: - type: string - label: 'Default value' diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/config/schema/migrate_plus.schema.yml --- a/modules/contrib/migrate_plus/config/schema/migrate_plus.schema.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -# Schema for the configuration files of the Migrate Plus module. - -migrate_plus.migration.*: - type: config_entity - label: 'Migration' - mapping: - id: - type: string - label: 'ID' - migration_tags: - type: sequence - label: 'Migration Tags' - sequence: - type: string - label: 'Tag' - migration_group: - type: string - label: 'Group' - label: - type: label - label: 'Label' - source: - type: migrate_plus.source.[plugin] - label: 'Source' - process: - type: ignore - label: 'Process' - destination: - type: migrate_plus.destination.[plugin] - label: 'Destination' - migration_dependencies: - type: mapping - label: 'Dependencies' - mapping: - required: - type: sequence - label: 'Required dependencies' - sequence: - type: string - label: 'Dependency' - optional: - type: sequence - label: 'Optional dependencies' - sequence: - type: string - label: 'Dependency' - -migrate_plus.migration_group.*: - type: config_entity - label: 'Migration Group' - mapping: - id: - type: string - label: 'ID' - label: - type: label - label: 'Label' - description: - type: string - label: 'Description' - source_type: - type: string - label: 'Source type' - module: - type: string - label: 'Dependent module' - shared_configuration: - type: ignore - label: 'Shared migration configuration' diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/config/schema/migrate_plus.source.schema.yml --- a/modules/contrib/migrate_plus/config/schema/migrate_plus.source.schema.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# Schema for the migrate source plugins. - -migrate_plus.source.*: - type: migrate_source - label: 'Default source' - -migrate_plus.source.empty: - type: migrate_source_sql - label: 'Empty source' - mapping: - provider: - type: string - label: 'Provider' - -migrate_plus.source.embedded_data: - type: migrate_source - label: 'Embedded data source' - mapping: - data_rows: - type: sequence - label: 'Data rows' - sequence: - type: ignore - label: 'Data row' - ids: - type: sequence - label: 'Unique key' - sequence: - type: mapping - label: 'Key column' - mapping: - type: - type: string - label: 'Column type' diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/README.txt --- a/modules/contrib/migrate_plus/migrate_example/README.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -INTRODUCTION ------------- -The migrate_example module demonstrates how to implement custom migrations -for Drupal 8. It includes a group of "beer" migrations demonstrating a complete -simple migration scenario. - -THE BEER SITE -------------- -In this scenario, we have a beer aficionado site which stores its data in MySQL -tables - there are content items for each beer on the site, user accounts with -profile data, categories to classify the beers, and user-generated comments on -the beers. We want to convert this site to Drupal with just a few modifications -to the basic structure. - -To make the example as simple as to run as possible, the source data is placed -in tables directly in your Drupal database - in most real-world scenarios, your -source data will be in an external database. The migrate_example_setup submodule -creates and populates these tables, as well as configuring your Drupal 8 site -(creating a node type, vocabulary, fields, etc.) to receive the data. - -STRUCTURE ---------- -There are two primary components to this example: - -1. Migration configuration, in the config/install directory. These YAML files - describe the migration process and provide the mappings from the source data - to Drupal's destination entities. The YAML file names are prefixed with - 'migrate_plus.migration.' (because, reading from right to left, they define - "migration" configuration entities, and the configuration entity type is - defined by the "migrate_plus" module). - -2. Source plugins, in src/Plugin/migrate/source. These are referenced from the - configuration files, and provide the source data to the migration processing - pipeline, as well as manipulating that data where necessary to put it into - a canonical form for migrations. - -UNDERSTANDING THE MIGRATIONS ----------------------------- -The YAML and PHP files are copiously documented in-line. To best understand -the concepts described in a more-or-less narrative form, it is recommended you -read the files in the following order: - -1. migrate_plus.migration_group.beer.yml -2. migrate_plus.migration.beer_term.yml -3. BeerTerm.php -4. migrate_plus.migration.beer_user.yml -5. BeerUser.php -6. migrate_plus.migration.beer_node.yml -7. BeerNode.php -8. migrate_plus.migration.beer_comment.yml -9. BeerComment.php - -RUNNING THE MIGRATIONS ----------------------- -The migrate_tools module (https://www.drupal.org/project/migrate_tools) provides -the tools you need to perform migration processes. At this time, the web UI only -provides status information - to perform migration operations, you need to use -the drush commands. - -# Enable the tools and the example module if you haven't already. -drush en -y migrate_tools,migrate_example - -# Look at the migrations. Just look at them. Notice that they are displayed in -# the order they will be run, which reflects their dependencies. For example, -# because the node migration references the imported terms and users, it must -# run after those migrations have been run. -drush ms # Abbreviation for migrate-status - -# Run the import operation for all the beer migrations. -drush mi --group=beer # Abbreviation for migrate-import - -# Look at what you've done! Also, visit the site and see the imported content, -# user accounts, etc. -drush ms - -# Look at the duplicate username message. -drush mmsg beer_user # Abbreviation for migrate-messages - -# Run the rollback operation for all the migrations (removing all the imported -# content, user accounts, etc.). Note that it will rollback the migrations in -# the opposite order as they were imported. -drush mr --group=beer # Abbreviation for migrate-rollback - -# You can import specific migrations. -drush mi beer_term,beer_user -# At this point, go look at your content listing - you'll see beer nodes named -# "Stub", generated from the user's favbeers references. - -drush mi beer_node,beer_comment -# Refresh your content listing - the stub nodes have been filled with real beer! - -# You can rollback specific migrations. -drush mr beer_comment,beer_node diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_comment.yml --- a/modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_comment.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# Migration configuration for beer comments. No new concepts here. -id: beer_comment -label: Comments on beers -migration_group: beer -source: - plugin: beer_comment -destination: - plugin: entity:comment -process: - pid: - plugin: migration - migration: beer_comment - source: cid_parent - entity_id: - plugin: migration - migration: beer_node - source: bid - entity_type: - plugin: default_value - default_value: node - field_name: - plugin: default_value - default_value: field_comments - comment_type: - plugin: default_value - default_value: node_comments - subject: subject - uid: - plugin: migration - migration: beer_user - source: aid - name: name - mail: mail - status: - plugin: default_value - default_value: 1 - 'comment_body/value': body -migration_dependencies: - required: - - beer_node - - beer_user -dependencies: - enforced: - module: - - migrate_example diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml --- a/modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -# Migration configuration for beer content. -id: beer_node -label: Beers of the world -migration_group: beer -source: - plugin: beer_node -destination: - plugin: entity:node -process: - # Hardcode the destination node type (bundle) as 'migrate_example_beer'. - type: - plugin: default_value - default_value: migrate_example_beer - title: name - nid: bid - uid: - plugin: migration - migration: beer_user - source: aid - sticky: - plugin: default_value - default_value: 0 - field_migrate_example_country: countries - field_migrate_example_beer_style: - plugin: migration - migration: beer_term - source: terms - # Some Drupal fields may have multiple components we may want to set - # separately. For example, text fields may have summaries (teasers) in - # addition to the full text value. We use / to separate the field name from - # the internal field value being set, and put it in quotes because / is a - # YAML special character. - 'body/value': body - 'body/summary': excerpt -# Our beer nodes have references to terms and users, so we want those to be -# imported first. We make that dependency explicit here - by putting those -# migrations under the 'required' key, we ensure that the tools will prevent -# us from running the beer_node migration unless the beer_term and beer_user -# migrations are complete (although we can override the dependency check by -# passing --force to the drush migrate-import command). We can also add -# 'optional' dependencies - these affect the order in which migrations are -# displayed, and run by default, but does not force you run them in that -# order. -# The general rule of thumb is that any migrations referenced by migration -# process plugins should be required here. -migration_dependencies: - required: - - beer_term - - beer_user -dependencies: - enforced: - module: - - migrate_example diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_term.yml --- a/modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_term.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -# A "migration" is, in technical terms, a plugin whose configuration describes -# how to read source data, process it (generally by mapping source fields to -# destination fields), and write it to Drupal. - -# The machine name for a migration, used to uniquely identify it. -id: beer_term - -# A human-friendly description of the migration. -label: Migrate style categories from the source database to taxonomy terms - -# The machine name of the group containing this migration (which contains shared -# configuration to be merged with our own configuration here). -migration_group: beer - -# Every migration must have a source plugin, which controls the delivery of our -# source data. In this case, our source plugin has the name "beer_term", which -# Drupal resolves to the PHP class defined in -# src/Plugin/migrate/source/BeerTerm.php. -source: - plugin: beer_term - -# Every migration must also have a destination plugin, which handles writing -# the migrated data in the appropriate form for that particular kind of data. -# Most Drupal content is an "entity" of one type or another, and we need to -# specify what entity type we are populating (in this case, taxonomy terms). -# Unlike the source plugin (which is specific to our particular scenario), this -# destination plugin is implemented in Drupal itself. -destination: - plugin: entity:taxonomy_term - -# Here's the meat of the migration - the processing pipeline. This describes how -# each destination field is to be populated based on the source data. For each -# destination field, one or more process plugins may be invoked. -process: - # The simplest process plugin is named 'get' - it is the default plugin, so - # does not need to be explicitly named. It simply copies the source value - # (the 'style' field from the source database in this case) to the destination - # field (the taxonomy term 'name' field). You can see we simply copy the - # source 'details' field to destination 'description' field in the same way. - name: style - description: details - - # Here is a new plugin - default_value. In its simplest usage here, it is used - # to hard-code a destination value, the vid (vocabulary ID) our taxonomy terms - # should be assigned to. It's important to note that while above the right - # side of the mappings was a source field name, here the right side of the - # 'default_value:' line is an actual value. - vid: - plugin: default_value - default_value: migrate_example_beer_styles - - # Here's another new plugin - migration. When importing data from another - # system, typically the unique identifiers for items on the destination side - # are not the same as the identifiers were on the source side. For example, in - # our style data the term names are the unique identifiers for each term, - # while in Drupal each term is assigned a unique integer term ID (tid). When - # any such items are referenced in Drupal, the reference needs to be - # translated from the old ID ('ale') to the new ID (1). The migration - # framework keeps track of the relationships between source and destination - # IDs in map tables, and the migration plugin is the means of performing a - # lookup in those map tables during processing. - parent: - plugin: migration - # Here we reference the migration whose map table we're performing a lookup - # against. You'll note that in this case we're actually referencing this - # migration itself, since category parents are imported by the same - # migration. This works best when we're sure the parents are imported - # before the children, and in this case our source plugin is guaranteeing - # that. - migration: beer_term - # 'style_parent' is the parent reference field from the source data. The - # result of this plugin is that the destination 'parent' field is populated - # with the Drupal term ID of the referenced style (or NULL if style_parent - # was empty). - source: style_parent - -# We'll learn more about dependencies in beer_node - here, we leave them empty. -migration_dependencies: {} - -# By default, configuration entities (like this migration) are not automatically -# removed when the migration which installed them is uninstalled. To have your -# migrations uninstalled with your migration module, add an enforced dependency -# on your module. -dependencies: - enforced: - module: - - migrate_example diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_user.yml --- a/modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_user.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -# Migration configuration for user accounts. We've described most of what goes -# into migration configuration in migrate_plus.migration.beer_term.yml, so won't -# repeat that here. -id: beer_user -label: Beer Drinkers of the world -migration_group: beer -source: - plugin: beer_user -destination: - plugin: entity:user -process: - pass: password - mail: email - init: email - status: status - roles: - plugin: default_value - default_value: 2 - - # Here's a new process plugin - dedupe_entity. Our source site allowed there - # to be multiple user accounts with the same username, but Drupal wants - # usernames to be unique. This plugin allows us to automatically generate - # unique usernames when we detect collisions. - name: - plugin: dedupe_entity - # The name of the source field containing the username. - source: username - # These next two settings identify the destination-side field to check for - # duplicates. They say "see if the incoming 'name' matches any existing - # 'name' field in any 'user' entity". - entity_type: user - field: name - # Finally, this specifies a string to use between the original value and the - # sequence number appended to make the value unique. Thus, the first 'alice' - # account gets the name 'alice' in Drupal, and the second one gets the name - # 'alice_1'. - postfix: _ - - # Another new process plugin - callback. This allows us to filter an incoming - # source value through an arbitrary PHP function. The function called must - # have one required argument. - created: - plugin: callback - # The 'registered' timestamp in the source data is a string of the form - # 'yyyy-mm-dd hh:mm:ss', but Drupal wants a UNIX timestamp for 'created'. - source: registered - callable: strtotime - - # Our source data only has a single timestamp value, 'registered', which we - # want to use for all four of Drupal's user timestamp fields. We could - # duplicate the callback plugin we used for 'created' above - but we have a - # shortcut. Putting an @ sign at the beginning of the source value indicates - # that it is to be interpreted as a *destination* field name instead of a - # *source* field name. Thus, if a value we need in more than one place - # requires some processing beyond simply copying it directly, we can perform - # that processing a single time and use the result in multiple places. - changed: '@created' - access: '@created' - login: '@created' - - # Yet another new process plugin - static_map. We're making a transformation - # in how we represent gender data - formerly it was integer values 0 for male - # and 1 for female, but in our modern Drupal site we will be making this a - # free-form text field, so we want to replace the obscure integers with - # simple strings. - field_migrate_example_gender: - plugin: static_map - # Specify the source field we're reading (containing 0's and 1's). - source: sex - # Tell it to transform 0 to 'Male', and 1 to 'Female'. - map: - 0: Male - 1: Female - # If the input is missing, leave the field empty. Without this, an empty - # or invalid source value would cause the user record to be skipped - # entirely. - bypass: true - - # This looks like a simple migration process plugin, but there's magic - # happening here. We import nodes after terms and users, because they have - # references to terms and users, so of course the terms and users must be - # migrated first - right? However, the favbeers field is a reference to the - # beer nodes which haven't yet been migrated - we have a circular relationship - # between users and nodes. The way the migration system resolves this - # situation is by creating "stubs". In this case, because no beer nodes have - # been created, each time a beer is looked up against the beer_node migration - # nothing is found, and by default the migration process plugin creates an - # empty stub node as a placeholder so the favbeers reference field has - # something to point to. The stub is recorded in the beer_node map table, so - # when that migration runs it knows that each incoming beer should overwrite - # its stub instead of creating a new node. - field_migrate_example_favbeers: - plugin: migration - source: beers - migration: beer_node - -migration_dependencies: {} - -# When a module is creating a custom content type it needs to add an -# enforced dependency to itself, otherwise the content type will persist -# after the module is disabled. See: https://www.drupal.org/node/2629516. -dependencies: - enforced: - module: - - migrate_example diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration_group.beer.yml --- a/modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration_group.beer.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -# A "migration group" is - surprise! - a group of migrations. It is used to -# group migrations for display by our tools, and to perform operations on a -# specific set of migrations. It can also be used to hold any configuration -# common to those migrations, so it doesn't have to be duplicated in each one. - -# The machine name of the group, by which it is referenced in individual -# migrations. -id: beer - -# A human-friendly label for the group. -label: Beer Imports - -# More information about the group. -description: A few simple beer-related imports, to demonstrate how to implement migrations. - -# Short description of the type of source, e.g. "Drupal 6" or "WordPress". -source_type: Custom tables - -# Here we add any default configuration settings to be shared among all -# migrations in the group. For this example, the source tables are in the -# Drupal (default) database, but usually if your source data is in a -# database it will be external. -shared_configuration: - # Specifying 'source' here means that this configuration will be merged into - # the 'source' configuration of each migration. - source: - # A better practice for real-world migrations would be to add a database - # connection to your external database in settings.php and reference its - # key here. - key: default - -# As with the migration configuration (see beer_term), we add an enforced -# dependency so the migration_group configuration will be removed on module -# uninstall. -dependencies: - enforced: - module: - - migrate_example diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example.info.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example.info.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -type: module -name: Migrate Example -description: 'Examples of how Drupal 8 migration compares to previous versions.' -package: Examples -# core: 8.x -dependencies: - - migrate - - migrate_example_setup - - migrate_plus - -# Information added by Drupal.org packaging script on 2016-08-05 -version: '8.x-2.0-beta2' -core: '8.x' -project: 'migrate_plus' -datestamp: 1470428640 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/comment.type.node_comments.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/comment.type.node_comments.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: node_comments -label: 'Node comments' -target_entity_type_id: node -description: '' diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.comment.node_comments.default.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.comment.node_comments.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.node_comments - - field.field.comment.node_comments.comment_body - module: - - text -id: comment.node_comments.default -targetEntityType: comment -bundle: node_comments -mode: default -content: - author: - weight: -2 - comment_body: - type: text_textarea - weight: 11 - settings: - rows: 5 - placeholder: '' - third_party_settings: { } - subject: - type: string_textfield - weight: 10 - settings: - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.node.migrate_example_beer.default.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.node.migrate_example_beer.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_beer.body - - field.field.node.migrate_example_beer.field_comments - - field.field.node.migrate_example_beer.field_migrate_example_beer_style - - field.field.node.migrate_example_beer.field_migrate_example_country - - field.field.node.migrate_example_beer.field_migrate_example_image - - node.type.migrate_example_beer - module: - - comment - - image - - path - - text -id: node.migrate_example_beer.default -targetEntityType: node -bundle: migrate_example_beer -mode: default -content: - body: - type: text_textarea_with_summary - weight: 6 - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - third_party_settings: { } - created: - type: datetime_timestamp - weight: 2 - settings: { } - third_party_settings: { } - field_comments: - weight: 10 - settings: { } - third_party_settings: { } - type: comment_default - field_migrate_example_beer_style: - weight: 7 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - field_migrate_example_country: - weight: 8 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - field_migrate_example_image: - weight: 9 - settings: - progress_indicator: throbber - preview_image_style: thumbnail - third_party_settings: { } - type: image_image - path: - type: path - weight: 5 - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 3 - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 4 - third_party_settings: { } - title: - type: string_textfield - weight: 0 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 1 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.comment.node_comments.default.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.comment.node_comments.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.node_comments - - field.field.comment.node_comments.comment_body - module: - - text -id: comment.node_comments.default -targetEntityType: comment -bundle: node_comments -mode: default -content: - comment_body: - label: hidden - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - links: - weight: 100 -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.default.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_beer.body - - field.field.node.migrate_example_beer.field_comments - - field.field.node.migrate_example_beer.field_migrate_example_beer_style - - field.field.node.migrate_example_beer.field_migrate_example_country - - field.field.node.migrate_example_beer.field_migrate_example_image - - node.type.migrate_example_beer - module: - - comment - - image - - text - - user -id: node.migrate_example_beer.default -targetEntityType: node -bundle: migrate_example_beer -mode: default -content: - body: - label: hidden - type: text_default - weight: 2 - settings: { } - third_party_settings: { } - field_comments: - weight: 5 - label: above - settings: - pager_id: 0 - third_party_settings: { } - type: comment_default - field_migrate_example_beer_style: - weight: 3 - label: above - settings: - link: true - third_party_settings: { } - type: entity_reference_label - field_migrate_example_country: - weight: 4 - label: above - settings: - link_to_entity: false - third_party_settings: { } - type: string - field_migrate_example_image: - weight: 1 - label: above - settings: - image_style: '' - image_link: '' - third_party_settings: { } - type: image - links: - weight: 0 - settings: { } - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.teaser.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.teaser.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.migrate_example_beer.body - - field.field.node.migrate_example_beer.field_comments - - field.field.node.migrate_example_beer.field_migrate_example_beer_style - - field.field.node.migrate_example_beer.field_migrate_example_country - - field.field.node.migrate_example_beer.field_migrate_example_image - - node.type.migrate_example_beer - module: - - text - - user -id: node.migrate_example_beer.teaser -targetEntityType: node -bundle: migrate_example_beer -mode: teaser -content: - body: - label: hidden - type: text_summary_or_trimmed - weight: 1 - settings: - trim_length: 600 - third_party_settings: { } - links: - weight: 0 - settings: { } - third_party_settings: { } -hidden: - field_comments: true - field_migrate_example_beer_style: true - field_migrate_example_country: true - field_migrate_example_image: true diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.comment.node_comments.comment_body.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.comment.node_comments.comment_body.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.node_comments - - field.storage.comment.comment_body - module: - - text -id: comment.node_comments.comment_body -field_name: comment_body -entity_type: comment -bundle: node_comments -label: Comment -description: '' -required: true -translatable: true -default_value: { } -default_value_callback: '' -settings: { } -field_type: text_long diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.body.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.body.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.body - - node.type.migrate_example_beer - module: - - text -id: node.migrate_example_beer.body -field_name: body -entity_type: node -bundle: migrate_example_beer -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: true -field_type: text_with_summary diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_comments.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_comments.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_comments - - node.type.migrate_example_beer - module: - - comment -id: node.migrate_example_beer.field_comments -field_name: field_comments -entity_type: node -bundle: migrate_example_beer -label: Comments -description: '' -required: false -translatable: false -default_value: - - - status: 2 - cid: 0 - last_comment_timestamp: 0 - last_comment_name: null - last_comment_uid: 0 - comment_count: 0 -default_value_callback: '' -settings: - default_mode: 1 - per_page: 50 - anonymous: 0 - form_location: true - preview: 1 -field_type: comment diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_beer_style.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_beer_style.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_beer_style - - node.type.migrate_example_beer - - taxonomy.vocabulary.migrate_example_beer_styles -id: node.migrate_example_beer.field_migrate_example_beer_style -field_name: field_migrate_example_beer_style -entity_type: node -bundle: migrate_example_beer -label: 'Migrate Example Beer Styles' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_beer_styles: migrate_example_beer_styles - sort: - field: _none - auto_create: false -field_type: entity_reference diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_country.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_country.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_country - - node.type.migrate_example_beer -id: node.migrate_example_beer.field_migrate_example_country -field_name: field_migrate_example_country -entity_type: node -bundle: migrate_example_beer -label: Countries -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_image.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_image.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_image - - node.type.migrate_example_beer - module: - - image -id: node.migrate_example_beer.field_migrate_example_image -field_name: field_migrate_example_image -entity_type: node -bundle: migrate_example_beer -label: Image -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - file_directory: '' - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: true - alt_field_required: false - title_field: false - title_field_required: false - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_favbeers.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_favbeers.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.user.field_migrate_example_favbeers - - node.type.migrate_example_beer - module: - - user -id: user.user.field_migrate_example_favbeers -field_name: field_migrate_example_favbeers -entity_type: user -bundle: user -label: 'Favorite Beers' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:node' - handler_settings: - target_bundles: - migrate_example_beer: migrate_example_beer - sort: - field: title - direction: ASC -field_type: entity_reference diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_gender.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_gender.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.user.field_migrate_example_gender - module: - - user -id: user.user.field_migrate_example_gender -field_name: field_migrate_example_gender -entity_type: user -bundle: user -label: Gender -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_comments.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_comments.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - comment - - node -id: node.field_comments -field_name: field_comments -entity_type: node -type: comment -settings: - comment_type: node_comments -module: comment -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_beer_style.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_beer_style.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_migrate_example_beer_style -field_name: field_migrate_example_beer_style -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_country.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_country.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_migrate_example_country -field_name: field_migrate_example_country -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_image.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_image.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - file - - image - - node -id: node.field_migrate_example_image -field_name: field_migrate_example_image -entity_type: node -type: image -settings: - uri_scheme: public - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_favbeers.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_favbeers.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - user -id: user.field_migrate_example_favbeers -field_name: field_migrate_example_favbeers -entity_type: user -type: entity_reference -settings: - target_type: node -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_gender.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_gender.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - user -id: user.field_migrate_example_gender -field_name: field_migrate_example_gender -entity_type: user -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/node.type.migrate_example_beer.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/node.type.migrate_example_beer.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - menu_ui -third_party_settings: - menu_ui: - available_menus: - - main - parent: 'main:' -name: Beer -type: migrate_example_beer -description: 'Beer is what we drink.' -help: '' -new_revision: false -preview_mode: 1 -display_submitted: true diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/taxonomy.vocabulary.migrate_example_beer_styles.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/config/install/taxonomy.vocabulary.migrate_example_beer_styles.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Migrate Example Beer Styles' -vid: migrate_example_beer_styles -description: 'Use tags to group beers on similar topics into categories.' -hierarchy: 0 -weight: 0 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.info.yml --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.info.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -type: module -name: Migrate Example Setup -description: 'Separate site configuration for the example from the actual migration.' -package: Migration -# core: 8.x -hidden: 1 -dependencies: - - comment - - image - - text - - options - - taxonomy - -# Information added by Drupal.org packaging script on 2016-08-05 -version: '8.x-2.0-beta2' -core: '8.x' -project: 'migrate_plus' -datestamp: 1470428640 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.install --- a/modules/contrib/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.install Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,345 +0,0 @@ - 'Beers of the world.', - 'fields' => array( - 'bid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Beer ID.', - ), - 'name' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ), - 'body' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Full description of the beer.', - ), - 'excerpt' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Abstract for this beer.', - ), - 'countries' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Countries of origin. Multiple values, delimited by pipe', - ), - 'aid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'description' => 'Account Id of the author.', - ), - 'image' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image path', - ), - 'image_alt' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image ALT', - ), - 'image_title' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image title', - ), - 'image_description' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image description', - ), - ), - 'primary key' => array('bid'), - ); -} - -function migrate_example_beer_schema_topic() { - return array( - 'description' => 'Categories', - 'fields' => array( - 'style' => array( - 'type' => 'varchar_ascii', - 'length' => 255, - 'not null' => TRUE, - ), - 'details' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ), - 'style_parent' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Parent topic, if any', - ), - 'region' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Region first associated with this style', - ), - 'hoppiness' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Relative hoppiness of the beer', - ), - ), - 'primary key' => array('style'), - ); -} - -function migrate_example_beer_schema_topic_node() { - return array( - 'description' => 'Beers topic pairs.', - 'fields' => array( - 'bid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Beer ID.', - ), - 'style' => array( - 'type' => 'varchar_ascii', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Topic name', - ), - ), - 'primary key' => array('style', 'bid'), - ); -} - -function migrate_example_beer_schema_comment() { - return array( - 'description' => 'Beers comments.', - 'fields' => array( - 'cid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Comment ID.', - ), - 'bid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Beer ID that is being commented upon', - ), - 'cid_parent' => array( - 'type' => 'int', - 'not null' => FALSE, - 'description' => 'Parent comment ID in case of comment replies.', - ), - 'subject' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment subject', - ), - 'body' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment body', - ), - 'name' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment name (if anon)', - ), - 'mail' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment email (if anon)', - ), - 'aid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'description' => 'Account ID (if any).', - ), - ), - 'primary key' => array('cid'), - ); -} - -function migrate_example_beer_schema_account() { - return array( - 'description' => 'Beers accounts.', - 'fields' => array( - 'aid' => array( - 'type' => 'serial', - //'not null' => TRUE, - 'description' => 'Account ID', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Blocked_Allowed', - ), - 'registered' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Registration date', - ), - 'username' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account name (for login)', - ), - 'nickname' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account name (for display)', - ), - 'password' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account password (raw)', - ), - 'email' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account email', - ), - 'sex' => array( - 'type' => 'int', - 'not null' => FALSE, - 'description' => 'Gender (0 for male, 1 for female)', - ), - 'beers' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Favorite Beers', - ), - ), - 'primary key' => array('aid'), - ); -} - -function migrate_example_beer_data_node() { - $fields = array('bid', 'name', 'body', 'excerpt', 'countries', 'aid', 'image', - 'image_alt', 'image_title', 'image_description'); - $query = db_insert('migrate_example_beer_node') - ->fields($fields); - // Use high bid numbers to avoid overwriting an existing node id. - $data = array( - array(99999999, 'Heineken', 'Blab Blah Blah Green', 'Green', 'Netherlands|Belgium', 0, 'heineken.jpg', 'Heinekin alt', 'Heinekin title', 'Heinekin description'), // comes with migrate_example project. - array(99999998, 'Miller Lite', 'We love Miller Brewing', 'Tasteless', 'USA|Canada', 1, NULL, NULL, NULL, NULL), - array(99999997, 'Boddington', 'English occasionally get something right', 'A treat', 'United Kingdom', 1, NULL, NULL, NULL, NULL), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -// Note that alice has duplicate username. Exercises dedupe_entity plugin. -// @TODO duplicate email also. -function migrate_example_beer_data_account() { - $fields = array('status', 'registered', 'username', 'nickname', 'password', 'email', 'sex', 'beers'); - $query = db_insert('migrate_example_beer_account') - ->fields($fields); - $data = array( - array(1, '2010-03-30 10:31:05', 'alice', 'alice in beerland', 'alicepass', 'alice@example.com', '1', '99999999|99999998|99999997'), - array(1, '2010-04-04 10:31:05', 'alice', 'alice in aleland', 'alicepass', 'alice2@example.com', '1', '99999999|99999998|99999997'), - array(0, '2007-03-15 10:31:05', 'bob', 'rebob', 'bobpass', 'bob@example.com', '0', '99999999|99999997'), - array(1, '2004-02-29 10:31:05', 'charlie', 'charlie chocolate', 'mykids', 'charlie@example.com', '0', '99999999|99999998'), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_beer_data_comment() { - $fields = array('bid', 'cid_parent', 'subject', 'body', 'name', 'mail', 'aid'); - $query = db_insert('migrate_example_beer_comment') - ->fields($fields); - $data = array( - array(99999998, NULL, 'im first', 'full body', 'alice', 'alice@example.com', 0), - array(99999998, NULL, 'im second', 'aromatic', 'alice', 'alice@example.com', 0), - array(99999999, NULL, 'im parent', 'malty', 'alice', 'alice@example.com', 0), - array(99999999, 1, 'im child', 'cold body', 'bob', NULL, 1), - array(99999999, 4, 'im grandchild', 'bitter body', 'charlie@example.com', NULL, 1), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_beer_data_topic() { - $fields = array('style', 'details', 'style_parent', 'region', 'hoppiness'); - $query = db_insert('migrate_example_beer_topic') - ->fields($fields); - $data = array( - array('ale', 'traditional', NULL, 'Medieval British Isles', 'Medium'), - array('red ale', 'colorful', 'ale', NULL, NULL), - array('pilsner', 'refreshing', NULL, 'Pilsen, Bohemia (now Czech Republic)', 'Low'), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_beer_data_topic_node() { - $fields = array('bid', 'style'); - $query = db_insert('migrate_example_beer_topic_node') - ->fields($fields); - $data = array( - array(99999999, 'pilsner'), - array(99999999, 'red ale'), - array(99999998, 'red ale'), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerComment.php --- a/modules/contrib/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerComment.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -select('migrate_example_beer_comment', 'mec') - ->fields('mec', ['cid', 'cid_parent', 'name', 'mail', 'aid', - 'body', 'bid', 'subject']) - ->orderBy('cid_parent', 'ASC'); - return $query; - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'cid' => $this->t('Comment ID'), - 'cid_parent' => $this->t('Parent comment ID in case of comment replies'), - 'name' => $this->t('Comment name (if anon)'), - 'mail' => $this->t('Comment email (if anon)'), - 'aid' => $this->t('Account ID (if any)'), - 'bid' => $this->t('Beer ID that is being commented upon'), - 'subject' => $this->t('Comment subject'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return [ - 'cid' => [ - 'type' => 'integer', - 'alias' => 'mec', - ], - ]; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerNode.php --- a/modules/contrib/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerNode.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -select('migrate_example_beer_node', 'b') - ->fields('b', ['bid', 'name', 'body', 'excerpt', 'aid', - 'countries', 'image', 'image_alt', 'image_title', - 'image_description']); - return $query; - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'bid' => $this->t('Beer ID'), - 'name' => $this->t('Name of beer'), - 'body' => $this->t('Full description of the beer'), - 'excerpt' => $this->t('Abstract for this beer'), - 'aid' => $this->t('Account ID of the author'), - 'countries' => $this->t('Countries of origin. Multiple values, delimited by pipe'), - 'image' => $this->t('Image path'), - 'image_alt' => $this->t('Image ALT'), - 'image_title' => $this->t('Image title'), - 'image_description' => $this->t('Image description'), - // Note that this field is not part of the query above - it is populated - // by prepareRow() below. You should document all source properties that - // are available for mapping after prepareRow() is called. - 'terms' => $this->t('Applicable styles'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return [ - 'bid' => [ - 'type' => 'integer', - 'alias' => 'b', - ], - ]; - } - - /** - * {@inheritdoc} - */ - public function prepareRow(Row $row) { - /** - * As explained above, we need to pull the style relationships into our - * source row here, as an array of 'style' values (the unique ID for - * the beer_term migration). - */ - $terms = $this->select('migrate_example_beer_topic_node', 'bt') - ->fields('bt', ['style']) - ->condition('bid', $row->getSourceProperty('bid')) - ->execute() - ->fetchCol(); - $row->setSourceProperty('terms', $terms); - - // As we did for favorite beers in the user migration, we need to explode - // the multi-value country names. - if ($value = $row->getSourceProperty('countries')) { - $row->setSourceProperty('countries', explode('|', $value)); - } - return parent::prepareRow($row); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerTerm.php --- a/modules/contrib/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerTerm.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -select() call - this ensures - * that the query is executed against the database configured for this - * source plugin. - */ - return $this->select('migrate_example_beer_topic', 'met') - ->fields('met', ['style', 'details', 'style_parent', 'region', 'hoppiness']) - // We sort this way to ensure parent terms are imported first. - ->orderBy('style_parent', 'ASC'); - } - - /** - * {@inheritdoc} - */ - public function fields() { - /** - * This method simply documents the available source fields provided by - * the source plugin, for use by front-end tools. It returns an array keyed - * by field/column name, with the value being a translated string explaining - * to humans what the field represents. You should always - */ - $fields = [ - 'style' => $this->t('Account ID'), - 'details' => $this->t('Blocked/Allowed'), - 'style_parent' => $this->t('Registered date'), - // These values are not currently migrated - it's OK to skip fields you - // don't need. - 'region' => $this->t('Region the style is associated with'), - 'hoppiness' => $this->t('Hoppiness of the style'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - /** - * This method indicates what field(s) from the source row uniquely identify - * that source row, and what their types are. This is critical information - * for managing the migration. The keys of the returned array are the field - * names from the query which comprise the unique identifier. The values are - * arrays indicating the type of the field, used for creating compatible - * columns in the map tables that track processed items. - */ - return [ - 'style' => [ - 'type' => 'string', - // 'alias' is the alias for the table containing 'style' in the query - // defined above. Optional in this case, but necessary if the same - // column may occur in multiple tables in a join. - 'alias' => 'met', - ], - ]; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerUser.php --- a/modules/contrib/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerUser.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -select('migrate_example_beer_account', 'mea') - ->fields('mea', ['aid', 'status', 'registered', 'username', 'nickname', - 'password', 'email', 'sex', 'beers']); - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'aid' => $this->t('Account ID'), - 'status' => $this->t('Blocked/Allowed'), - 'registered' => $this->t('Registered date'), - 'username' => $this->t('Account name (for login)'), - 'nickname' => $this->t('Account name (for display)'), - 'password' => $this->t('Account password (raw)'), - 'email' => $this->t('Account email'), - 'sex' => $this->t('Gender'), - 'beers' => $this->t('Favorite beers, pipe-separated'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return [ - 'aid' => [ - 'type' => 'integer', - 'alias' => 'mea', - ], - ]; - } - - /** - * {@inheritdoc} - */ - public function prepareRow(Row $row) { - /** - * prepareRow() is the most common place to perform custom run-time - * processing that isn't handled by an existing process plugin. It is called - * when the raw data has been pulled from the source, and provides the - * opportunity to modify or add to that data, creating the canonical set of - * source data that will be fed into the processing pipeline. - * - * In our particular case, the list of a user's favorite beers is a pipe- - * separated list of beer IDs. The processing pipeline deals with arrays - * representing multi-value fields naturally, so we want to explode that - * string to an array of individual beer IDs. - */ - if ($value = $row->getSourceProperty('beers')) { - $row->setSourceProperty('beers', explode('|', $value)); - } - /** - * Always call your parent! Essential processing is performed in the base - * class. Be mindful that prepareRow() returns a boolean status - if FALSE - * that indicates that the item being processed should be skipped. Unless - * we're deciding to skip an item ourselves, let the parent class decide. - */ - return parent::prepareRow($row); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/README.txt --- a/modules/contrib/migrate_plus/migrate_example_advanced/README.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -INTRODUCTION ------------- -The migrate_example_advanced module demonstrates some techniques for Drupal 8 -migrations beyond the basics in migrate_example. It includes a group of -migrations with a wine theme. - -SETUP ------ -To demonstrate XML migrations as realistically as possible, the setup module -provides the source data as REST services. So the migrations' references to these -services can be set up accurately, if you install migrate_example_advanced via -drush be sure to use the --uri parameter, e.g. - -drush en -y migrate_example_advanced --uri=http://d8.local:8083/ - -THE WINE SITE -------------- -In this scenario, we have a wine aficionado site which stores data in SQL tables -as well is pulling in additional data from XML services. - -To make the example as simple as to run as possible, the SQL data is placed in -tables directly in your Drupal database - in most real-world scenarios, your -source data will be in an external database. The migrate_example_advanced_setup -submodule creates and populates these tables, as well as configuring your Drupal -8 site (creating node types, vocabularies, fields, etc.) to receive the data, -and providing service endpoints for XML data. - -STRUCTURE ---------- -As with most custom migrations, there are two primary components to this -example: - -1. Migration configuration, in the config/install directory. These YAML files - describe the migration process and provide the mappings from the source data - to Drupal's destination entities. - -2. Source plugins, in src/Plugin/migrate/source. These are referenced from the - configuration files, and provide the source data to the migration processing - pipeline, as well as manipulating that data where necessary to put it into - a canonical form for migrations. - -UNDERSTANDING THE MIGRATIONS ----------------------------- -Basic techniques demonstrated in the migrate_example module are not rehashed -here - it is expected that if you are learning Drupal 8 migration, you will -study and understand those examples first, and use migrate_example_advanced to -learn about specific techniques beyond those basics. This example doesn't have -the narrative form of migrate_example - it's more of a grab-bag demonstrating -varous features, and is more of a reference for, say, copying the code to set -up an XML migration. An index of things demonstrated by this module: - -Multiple vocabularies populated in one migration ------------------------------------------------- -See migrate_plus.migration.wine_terms.yml. - -Importing from XML services ---------------------------- -See migrate_plus.migration.wine_role_xml.yml. diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.weather_soap.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.weather_soap.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -# This migration demonstrates importing from SOAP/WSDL. -id: weather_soap -label: SOAP service providing weather. -migration_group: wine -source: - # We use the SOAP parser source plugin. - plugin: url - data_fetcher_plugin: http # Ignored - SoapClient does the fetching. - data_parser_plugin: soap - # URL of a WSDL endpoint. - urls: http://www.webservicex.net/globalweather.asmx?WSDL - # The function to call on the service, and the parameters to pass. - function: GetCitiesByCountry - parameters: - CountryName: Spain - response_type: xml - item_selector: /NewDataSet/Table - fields: - - - name: Country - label: Country - selector: Country - - - name: City - label: City - selector: City - ids: - City: - type: string -process: - vid: - plugin: default_value - default_value: migrate_example_wine_varieties - name: City -destination: - plugin: entity:taxonomy_term diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_json.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_json.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -# This migration demonstrates importing from a monolithic JSON file. -id: wine_role_json -label: JSON feed of roles (positions) -migration_group: wine -source: - # We use the JSON source plugin. - plugin: url - data_fetcher_plugin: http - data_parser_plugin: json - # Normally, this is one or more fully-qualified URLs or file paths. Because - # we can't hardcode your local URL, we provide a relative path here which - # hook_install() will rewrite to a full URL for the current site. - urls: /migrate_example_advanced_position?_format=json - item_selector: 1 - # Under 'fields', we list the data items to be imported. The first level keys - # are the source field names we want to populate (the names to be used as - # sources in the process configuration below). For each field we're importing, - # we provide a label (optional - this is for display in migration tools) and - # an xpath for retrieving that value. It's important to note that this xpath - # is relative to the elements retrieved by item_xpath. - fields: - - - name: machine_name - label: 'Unique position identifier' - selector: sourceid - - - name: friendly_name - label: 'Position name' - selector: name - # Under 'ids', we identify source fields populated above which will uniquely - # identify each imported item. The 'type' makes sure the migration map table - # uses the proper schema type for stored the IDs. - ids: - machine_name: - type: string -process: - # Note that the source field names here (machine_name and friendly_name) were - # defined by the 'fields' configuration for the source plugin above. - id: machine_name - label: friendly_name -destination: - plugin: entity:user_role -migration_dependencies: {} -dependencies: - enforced: - module: - - migrate_example_advanced diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_xml.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_xml.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -# This migration demonstrates importing from a monolithic XML file. -id: wine_role_xml -label: XML feed of roles (positions) -migration_group: wine -source: - # We use the XML data parser plugin. - plugin: url - data_fetcher_plugin: http - data_parser_plugin: xml - # Normally, this is one or more fully-qualified URLs or file paths. Because - # we can't hardcode your local URL, we provide a relative path here which - # hook_install() will rewrite to a full URL for the current site. - urls: /migrate_example_advanced_position?_format=xml - # Visit the URL above (relative to your site root) and look at it. You can see - # that is the outer element, and each item we want to import is a - # element. The item_xpath value is the xpath to use to query the - # desired elements. - item_selector: /response/position - # Under 'fields', we list the data items to be imported. The first level keys - # are the source field names we want to populate (the names to be used as - # sources in the process configuration below). For each field we're importing, - # we provide a label (optional - this is for display in migration tools) and - # an xpath for retrieving that value. It's important to note that this xpath - # is relative to the elements retrieved by item_xpath. - fields: - - - name: machine_name - label: 'Unique position identifier' - selector: sourceid - - - name: friendly_name - label: 'Position name' - selector: name - # Under 'ids', we identify source fields populated above which will uniquely - # identify each imported item. The 'type' makes sure the migration map table - # uses the proper schema type for stored the IDs. - ids: - machine_name: - type: string -process: - # Note that the source field names here (machine_name and friendly_name) were - # defined by the 'fields' configuration for the source plugin above. - id: machine_name - label: friendly_name -destination: - plugin: entity:user_role -migration_dependencies: {} -dependencies: - enforced: - module: - - migrate_example_advanced diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_terms.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_terms.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -id: wine_terms -label: Migrate all categories into Drupal taxonomy terms -migration_group: wine -source: - plugin: wine_term -destination: - plugin: entity:taxonomy_term -process: - name: name - description: details - # Usually, one wants to have a separate migration for each entity_type/bundle - # combination - e.g., separate migrations for articles and blog posts, as - # opposed to a single monolithic node migration. This affords maximum - # control - the ability to import just one bundle at a time, and most - # importantly to have distinct field mappings (because different node types - # usually have different fields). In this case, though, because all of the - # vocabularies we're importing come from a common table, and on the Drupal - # side there are no distinct custom fields, we are able to import them all in - # one migration. The static_map tells the migration in which vocabulary to - # place each term, based on the incoming 'type' column. - vid: - plugin: static_map - source: type - map: - best_with: migrate_example_wine_best_with - region: migrate_example_wine_regions - variety: migrate_example_wine_varieties - parent: - plugin: migration - migration: wine_terms - source: category_parent - weight: ordering -migration_dependencies: {} -dependencies: - enforced: - module: - - migrate_example_advanced diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_variety_list.yml.txt --- a/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_variety_list.yml.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -# This migration demonstrates importing from an endpoint listing other endpoints -# containing individual item data. -id: wine_variety_list -label: XML feed of varieties -migration_group: wine -source: - # We use the XML source plugin. - plugin: xml - # Normally, this is one or more fully-qualified URLs or file paths. Because - # we can't hardcode your local URL, we provide a relative path here which - # hook_install() will rewrite to a full URL for the current site. - urls: /migrate_example_advanced_variety_list?_format=xml - item_url: /migrate_example_advanced_variety_list/:id?_format=xml - id_selector: /response/items - # Visit the URL above (relative to your site root) and look at it. You can see - # that is the outer element, and each item we want to import is a - # element. The item_xpath value is the xpath to use to query the - # desired elements. - item_selector: /response/variety - # Under 'fields', we list the data items to be imported. The first level keys - # are the source field names we want to populate (the names to be used as - # sources in the process configuration below). For each field we're importing, - # we provide a label (optional - this is for display in migration tools) and - # an xpath for retrieving that value. It's important to note that this xpath - # is relative to the elements retrieved by item_xpath. - fields: - category_name: - label: - selector: name - category_details: - label: - selector: details - category_parent: - label: 'Unique position identifier' - selector: parent - # Under 'ids', we identify source fields populated above which will uniquely - # identify each imported item. The 'type' makes sure the migration map table - # uses the proper schema type for stored the IDs. - ids: - category_name: - type: string -process: - vid: - plugin: default_value - default_value: migrate_example_wine_varieties - name: category_name - description: category_details - parent: - plugin: migration - migration: wine_terms - source: category_parent -destination: - plugin: entity:taxonomy_term -migration_dependencies: - require: - - wine_terms diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_variety_multi_xml.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_variety_multi_xml.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -# This migration demonstrates importing from multiple XML files. -id: wine_variety_multi_xml -label: XML feed of varieties -migration_group: wine -source: - # We use the XML source plugin. - plugin: url - data_fetcher_plugin: http - data_parser_plugin: xml - # Normally, this is one or more fully-qualified URLs or file paths. Because - # we can't hardcode your local URL, we provide a relative path here which - # hook_install() will rewrite to a full URL for the current site. - urls: - - /migrate_example_advanced_variety_multiple/red?_format=xml - - /migrate_example_advanced_variety_multiple/white?_format=xml - # Visit the URL above (relative to your site root) and look at it. You can see - # that is the outer element, and each item we want to import is a - # element. The item_xpath value is the xpath to use to query the - # desired elements. - item_selector: /response/variety - # Under 'fields', we list the data items to be imported. The first level keys - # are the source field names we want to populate (the names to be used as - # sources in the process configuration below). For each field we're importing, - # we provide a label (optional - this is for display in migration tools) and - # an xpath for retrieving that value. It's important to note that this xpath - # is relative to the elements retrieved by item_xpath. - fields: - - - name: category_name - label: Name - selector: name - - - name: category_details - label: Details - selector: details - - - name: category_parent - label: 'Unique position identifier' - selector: parent - - - name: category_attributes - label: 'List of variety attributes' - selector: attributes - # Under 'ids', we identify source fields populated above which will uniquely - # identify each imported item. The 'type' makes sure the migration map table - # uses the proper schema type for stored the IDs. - ids: - category_name: - type: string -process: - vid: - plugin: default_value - default_value: migrate_example_wine_varieties - name: category_name - description: category_details - parent: - plugin: migration - migration: wine_terms - source: category_parent - field_variety_attributes: category_attributes -destination: - plugin: entity:taxonomy_term -migration_dependencies: - required: - - wine_terms -dependencies: - enforced: - module: - - migrate_example_advanced diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration_group.wine.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration_group.wine.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -id: wine -label: Wine Imports -description: A few wine-related imports, demonstrating some more advanced migration techniques. -source_type: Custom tables and XML -shared_configuration: - source: - key: default -dependencies: - enforced: - module: - - migrate_example_advanced diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/data/0001.xml --- a/modules/contrib/migrate_plus/migrate_example_advanced/data/0001.xml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - Lolonis Winery - Makers of Ladybug Red - 3 - Redwood Valley - diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/data/0002.xml --- a/modules/contrib/migrate_plus/migrate_example_advanced/data/0002.xml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - Château Latour - Makers of grand vin Chateau Latour, Les Forts de Latour and Pauillac - 3 - Bordeaux - diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/data/index.xml --- a/modules/contrib/migrate_plus/migrate_example_advanced/data/index.xml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - - - 0001 - diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/data/index2.xml --- a/modules/contrib/migrate_plus/migrate_example_advanced/data/index2.xml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - - - 0002 - diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced.info.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced.info.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -type: module -name: Migrate Example (Advanced) -description: 'Specialized examples of Drupal 8 migration.' -package: Examples -# core: 8.x -dependencies: - - migrate - - migrate_example_advanced_setup - - migrate_plus - -# Information added by Drupal.org packaging script on 2016-08-05 -version: '8.x-2.0-beta2' -core: '8.x' -project: 'migrate_plus' -datestamp: 1470428640 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced.install --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced.install Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -get('source'); - $request = \Drupal::request(); - $source['urls'] = 'http://' . $request->getHttpHost() . $source['urls']; - $wine_role_xml_migration->set('source', $source); - $wine_role_xml_migration->save(); - } - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $wine_role_json_migration */ - $wine_role_json_migration = Migration::load('wine_role_json'); - if ($wine_role_json_migration) { - $source = $wine_role_json_migration->get('source'); - $request = \Drupal::request(); - $source['urls'] = 'http://' . $request->getHttpHost() . $source['urls']; - $wine_role_json_migration->set('source', $source); - $wine_role_json_migration->save(); - } - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $wine_variety_multi_xml_migration */ - $wine_variety_multi_xml_migration = Migration::load('wine_variety_multi_xml'); - if ($wine_variety_multi_xml_migration) { - $source = $wine_variety_multi_xml_migration->get('source'); - $request = \Drupal::request(); - $urls = []; - foreach ($source['urls'] as $url) { - $urls[] = 'http://' . $request->getHttpHost() . $url; - } - $source['urls'] = $urls; - $wine_variety_multi_xml_migration->set('source', $source); - $wine_variety_multi_xml_migration->save(); - } -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/comment.type.migrate_example_advanced_comment.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/comment.type.migrate_example_advanced_comment.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: migrate_example_advanced_comment -label: 'Node comments' -target_entity_type_id: node -description: '' diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.comment.migrate_example_advanced_comment.default.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.comment.migrate_example_advanced_comment.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.migrate_example_advanced_comment - - field.field.comment.migrate_example_advanced_comment.comment_body - module: - - text -id: comment.migrate_example_advanced_comment.default -targetEntityType: comment -bundle: migrate_example_advanced_comment -mode: default -content: - author: - weight: -2 - comment_body: - type: text_textarea - weight: 11 - settings: - rows: 5 - placeholder: '' - third_party_settings: { } - subject: - type: string_textfield - weight: 10 - settings: - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_producer.default.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_producer.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_producer.body - - field.field.node.migrate_example_producer.field_migrate_example_wine_regio - - node.type.migrate_example_producer - module: - - path - - text -id: node.migrate_example_producer.default -targetEntityType: node -bundle: migrate_example_producer -mode: default -content: - body: - type: text_textarea_with_summary - weight: 31 - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - third_party_settings: { } - created: - type: datetime_timestamp - weight: 10 - settings: { } - third_party_settings: { } - field_migrate_example_wine_regio: - weight: 32 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - path: - type: path - weight: 30 - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 15 - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 16 - third_party_settings: { } - title: - type: string_textfield - weight: -5 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 5 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_wine.default.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_wine.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_wine.body - - field.field.node.migrate_example_wine.field_migrate_example_comments - - field.field.node.migrate_example_wine.field_migrate_example_adv_image - - field.field.node.migrate_example_wine.field_migrate_example_top_vintag - - field.field.node.migrate_example_wine.field_migrate_example_wine_best - - field.field.node.migrate_example_wine.field_migrate_example_wine_ratin - - field.field.node.migrate_example_wine.field_migrate_example_wine_regio - - field.field.node.migrate_example_wine.field_migrate_example_wine_var - - node.type.migrate_example_wine - module: - - comment - - image - - path - - text -id: node.migrate_example_wine.default -targetEntityType: node -bundle: migrate_example_wine -mode: default -content: - body: - type: text_textarea_with_summary - weight: 31 - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - third_party_settings: { } - created: - type: datetime_timestamp - weight: 10 - settings: { } - third_party_settings: { } - field_migrate_example_comments: - weight: 38 - settings: { } - third_party_settings: { } - type: comment_default - field_migrate_example_adv_image: - weight: 35 - settings: - progress_indicator: throbber - preview_image_style: thumbnail - third_party_settings: { } - type: image_image - field_migrate_example_top_vintag: - weight: 37 - settings: - placeholder: '' - third_party_settings: { } - type: number - field_migrate_example_wine_best: - weight: 34 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete_tags - field_migrate_example_wine_ratin: - weight: 36 - settings: - placeholder: '' - third_party_settings: { } - type: number - field_migrate_example_wine_regio: - weight: 33 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - field_migrate_example_wine_var: - weight: 32 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - path: - type: path - weight: 30 - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 15 - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 16 - third_party_settings: { } - title: - type: string_textfield - weight: -5 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 5 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.taxonomy_term.migrate_example_wine_varieties.default.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.taxonomy_term.migrate_example_wine_varieties.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes - - taxonomy.vocabulary.migrate_example_wine_varieties - module: - - path - - text -id: taxonomy_term.migrate_example_wine_varieties.default -targetEntityType: taxonomy_term -bundle: migrate_example_wine_varieties -mode: default -content: - description: - type: text_textarea - weight: 1 - settings: - placeholder: '' - rows: 5 - third_party_settings: { } - field_variety_attributes: - type: string_textfield - weight: 3 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - name: - type: string_textfield - weight: 0 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - path: - type: path - weight: 2 - settings: { } - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.comment.migrate_example_advanced_comment.default.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.comment.migrate_example_advanced_comment.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.migrate_example_advanced_comment - - field.field.comment.migrate_example_advanced_comment.comment_body - module: - - text -id: comment.migrate_example_advanced_comment.default -targetEntityType: comment -bundle: migrate_example_advanced_comment -mode: default -content: - comment_body: - label: hidden - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - links: - weight: 100 -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.default.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_producer.body - - field.field.node.migrate_example_producer.field_migrate_example_wine_regio - - node.type.migrate_example_producer - module: - - text - - user -id: node.migrate_example_producer.default -targetEntityType: node -bundle: migrate_example_producer -mode: default -content: - body: - label: hidden - type: text_default - weight: 101 - settings: { } - third_party_settings: { } - field_migrate_example_wine_regio: - weight: 102 - label: inline - settings: - link: true - third_party_settings: { } - type: entity_reference_label - links: - weight: 100 - settings: { } - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.teaser.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.teaser.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.migrate_example_producer.body - - field.field.node.migrate_example_producer.field_migrate_example_wine_regio - - node.type.migrate_example_producer - module: - - text - - user -id: node.migrate_example_producer.teaser -targetEntityType: node -bundle: migrate_example_producer -mode: teaser -content: - body: - label: hidden - type: text_summary_or_trimmed - weight: 101 - settings: - trim_length: 600 - third_party_settings: { } - links: - weight: 100 -hidden: - field_migrate_example_wine_regio: true diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.default.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_wine.body - - field.field.node.migrate_example_wine.field_migrate_example_comments - - field.field.node.migrate_example_wine.field_migrate_example_adv_image - - field.field.node.migrate_example_wine.field_migrate_example_top_vintag - - field.field.node.migrate_example_wine.field_migrate_example_wine_best - - field.field.node.migrate_example_wine.field_migrate_example_wine_ratin - - field.field.node.migrate_example_wine.field_migrate_example_wine_regio - - field.field.node.migrate_example_wine.field_migrate_example_wine_var - - node.type.migrate_example_wine - module: - - comment - - image - - text - - user -id: node.migrate_example_wine.default -targetEntityType: node -bundle: migrate_example_wine -mode: default -content: - body: - label: hidden - type: text_default - weight: 101 - settings: { } - third_party_settings: { } - field_migrate_example_comments: - weight: 108 - label: hidden - settings: - pager_id: 0 - third_party_settings: { } - type: comment_default - field_migrate_example_adv_image: - weight: 105 - label: hidden - settings: - image_style: '' - image_link: '' - third_party_settings: { } - type: image - field_migrate_example_top_vintag: - weight: 107 - label: inline - settings: - thousand_separator: '' - prefix_suffix: true - third_party_settings: { } - type: number_integer - field_migrate_example_wine_best: - weight: 104 - label: inline - settings: - link: true - third_party_settings: { } - type: entity_reference_label - field_migrate_example_wine_ratin: - weight: 106 - label: inline - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - field_migrate_example_wine_regio: - weight: 103 - label: inline - settings: - link: true - third_party_settings: { } - type: entity_reference_label - field_migrate_example_wine_var: - weight: 102 - label: inline - settings: - link: true - third_party_settings: { } - type: entity_reference_label - links: - weight: 100 - settings: { } - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.teaser.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.teaser.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.migrate_example_wine.body - - field.field.node.migrate_example_wine.field_migrate_example_comments - - field.field.node.migrate_example_wine.field_migrate_example_adv_image - - field.field.node.migrate_example_wine.field_migrate_example_top_vintag - - field.field.node.migrate_example_wine.field_migrate_example_wine_best - - field.field.node.migrate_example_wine.field_migrate_example_wine_ratin - - field.field.node.migrate_example_wine.field_migrate_example_wine_regio - - field.field.node.migrate_example_wine.field_migrate_example_wine_var - - node.type.migrate_example_wine - module: - - text - - user -id: node.migrate_example_wine.teaser -targetEntityType: node -bundle: migrate_example_wine -mode: teaser -content: - body: - label: hidden - type: text_summary_or_trimmed - weight: 101 - settings: - trim_length: 600 - third_party_settings: { } - links: - weight: 100 -hidden: - field_migrate_example_comments: true - field_migrate_example_adv_image: true - field_migrate_example_top_vintag: true - field_migrate_example_wine_best: true - field_migrate_example_wine_ratin: true - field_migrate_example_wine_regio: true - field_migrate_example_wine_var: true diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.taxonomy_term.migrate_example_wine_varieties.default.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.taxonomy_term.migrate_example_wine_varieties.default.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes - - taxonomy.vocabulary.migrate_example_wine_varieties - module: - - text -id: taxonomy_term.migrate_example_wine_varieties.default -targetEntityType: taxonomy_term -bundle: migrate_example_wine_varieties -mode: default -content: - description: - label: hidden - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - field_variety_attributes: - type: string - weight: 0 - label: inline - settings: - link_to_entity: false - third_party_settings: { } -hidden: { } diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.comment.migrate_example_advanced_comment.comment_body.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.comment.migrate_example_advanced_comment.comment_body.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.migrate_example_advanced_comment - - field.storage.comment.comment_body - module: - - text -id: comment.migrate_example_advanced_comment.comment_body -field_name: comment_body -entity_type: comment -bundle: migrate_example_advanced_comment -label: Comment -description: '' -required: true -translatable: true -default_value: { } -default_value_callback: '' -settings: { } -field_type: text_long diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.body.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.body.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.body - - node.type.migrate_example_producer - module: - - text -id: node.migrate_example_producer.body -field_name: body -entity_type: node -bundle: migrate_example_producer -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: true -field_type: text_with_summary diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.field_migrate_example_wine_regio.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.field_migrate_example_wine_regio.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_regio - - node.type.migrate_example_producer - - taxonomy.vocabulary.migrate_example_wine_regions -id: node.migrate_example_producer.field_migrate_example_wine_regio -field_name: field_migrate_example_wine_regio -entity_type: node -bundle: migrate_example_producer -label: 'Migrate Example Wine Regions' -description: 'Select the region this wine comes from' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_wine_regions: migrate_example_wine_regions - sort: - field: _none - auto_create: false -field_type: entity_reference diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.body.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.body.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.body - - node.type.migrate_example_wine - module: - - text -id: node.migrate_example_wine.body -field_name: body -entity_type: node -bundle: migrate_example_wine -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: true -field_type: text_with_summary diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_adv_image.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_adv_image.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_adv_image - - node.type.migrate_example_wine - module: - - image -id: node.migrate_example_wine.field_migrate_example_adv_image -field_name: field_migrate_example_adv_image -entity_type: node -bundle: migrate_example_wine -label: Image -description: 'Upload an image to go with this wine.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - file_directory: field/migrate_example/image - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: true - alt_field_required: false - title_field: false - title_field_required: false - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_comments.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_comments.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_comments - - node.type.migrate_example_wine - module: - - comment -id: node.migrate_example_wine.field_migrate_example_comments -field_name: field_migrate_example_comments -entity_type: node -bundle: migrate_example_wine -label: Comments -description: '' -required: false -translatable: false -default_value: - - - status: 2 - cid: 0 - last_comment_timestamp: 0 - last_comment_name: null - last_comment_uid: 0 - comment_count: 0 -default_value_callback: '' -settings: - default_mode: 1 - per_page: 50 - anonymous: 0 - form_location: true - preview: 1 -field_type: comment diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_top_vintag.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_top_vintag.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_top_vintag - - node.type.migrate_example_wine -id: node.migrate_example_wine.field_migrate_example_top_vintag -field_name: field_migrate_example_top_vintag -entity_type: node -bundle: migrate_example_wine -label: 'Recommended vintages' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: integer diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_best.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_best.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_best - - node.type.migrate_example_wine - - taxonomy.vocabulary.migrate_example_wine_best_with -id: node.migrate_example_wine.field_migrate_example_wine_best -field_name: field_migrate_example_wine_best -entity_type: node -bundle: migrate_example_wine -label: 'Migrate Example Wine Best With' -description: 'Enter any foods this wine may be paired with, separated by commas' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_wine_best_with: migrate_example_wine_best_with - sort: - field: _none - auto_create: false -field_type: entity_reference diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_ratin.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_ratin.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_ratin - - node.type.migrate_example_wine -id: node.migrate_example_wine.field_migrate_example_wine_ratin -field_name: field_migrate_example_wine_ratin -entity_type: node -bundle: migrate_example_wine -label: Rating -description: 'Rating on a 1-100 scale' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: !!float 1 - max: !!float 100 - prefix: '' - suffix: '' -field_type: decimal diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_regio.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_regio.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_regio - - node.type.migrate_example_wine - - taxonomy.vocabulary.migrate_example_wine_regions -id: node.migrate_example_wine.field_migrate_example_wine_regio -field_name: field_migrate_example_wine_regio -entity_type: node -bundle: migrate_example_wine -label: 'Migrate Example Wine Regions' -description: 'Select the region this wine comes from' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_wine_regions: migrate_example_wine_regions - sort: - field: _none - auto_create: false -field_type: entity_reference diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_var.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_var.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_var - - node.type.migrate_example_wine - - taxonomy.vocabulary.migrate_example_wine_varieties -id: node.migrate_example_wine.field_migrate_example_wine_var -field_name: field_migrate_example_wine_var -entity_type: node -bundle: migrate_example_wine -label: 'Migrate Example Wine Varieties' -description: 'Select the variety of this wine' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_wine_varieties: migrate_example_wine_varieties - sort: - field: _none - auto_create: false -field_type: entity_reference diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.taxonomy_term.field_variety_attributes - - taxonomy.vocabulary.migrate_example_wine_varieties -id: taxonomy_term.migrate_example_wine_varieties.field_variety_attributes -field_name: field_variety_attributes -entity_type: taxonomy_term -bundle: migrate_example_wine_varieties -label: Attributes -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_adv_image.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_adv_image.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - file - - image - - node -id: node.field_migrate_example_adv_image -field_name: field_migrate_example_adv_image -entity_type: node -type: image -settings: - uri_scheme: public - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_comments.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_comments.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - comment - - node -id: node.field_migrate_example_comments -field_name: field_migrate_example_comments -entity_type: node -type: comment -settings: - comment_type: migrate_example_advanced_comment -module: comment -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_top_vintag.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_top_vintag.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_migrate_example_top_vintag -field_name: field_migrate_example_top_vintag -entity_type: node -type: integer -settings: - unsigned: false - size: normal -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_best.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_best.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_migrate_example_wine_best -field_name: field_migrate_example_wine_best -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_ratin.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_ratin.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_migrate_example_wine_ratin -field_name: field_migrate_example_wine_ratin -entity_type: node -type: decimal -settings: - precision: 10 - scale: 0 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_regio.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_regio.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_migrate_example_wine_regio -field_name: field_migrate_example_wine_regio -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_var.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_var.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_migrate_example_wine_var -field_name: field_migrate_example_wine_var -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.taxonomy_term.field_variety_attributes.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.taxonomy_term.field_variety_attributes.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - taxonomy -id: taxonomy_term.field_variety_attributes -field_name: field_variety_attributes -entity_type: taxonomy_term -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_producer.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_producer.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Wine Producer' -type: migrate_example_producer -description: 'Wineries, vineyards, and large producers.' -help: '' -new_revision: false -preview_mode: 1 -display_submitted: true diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_wine.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_wine.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: Wine -type: migrate_example_wine -description: 'Wine is what we drink.' -help: '' -new_revision: false -preview_mode: 1 -display_submitted: true diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_best_with.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_best_with.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Migrate Example Wine Best With' -vid: migrate_example_wine_best_with -description: 'Foods the wine goes best with' -hierarchy: 0 -weight: 0 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_regions.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_regions.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Migrate Example Wine Regions' -vid: migrate_example_wine_regions -description: 'Wine regions' -hierarchy: 0 -weight: 0 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_varieties.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_varieties.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Migrate Example Wine Varieties' -vid: migrate_example_wine_varieties -description: 'Wine varieties' -hierarchy: 0 -weight: 0 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.info.yml --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.info.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -type: module -name: Migrate Advanced Example Setup -description: 'Separate site configuration for the example from the actual migration.' -package: Migration -# core: 8.x -hidden: 1 -dependencies: - - comment - - image - - text - - taxonomy - - rest - -# Information added by Drupal.org packaging script on 2016-08-05 -version: '8.x-2.0-beta2' -core: '8.x' -project: 'migrate_plus' -datestamp: 1470428640 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.install --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.install Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,928 +0,0 @@ -getEditable('rest.settings'); - $resources = $config->get('resources'); - $resources['migrate_example_advanced_position']['GET'] = [ - 'supported_formats' => ['json', 'xml'], - 'supported_auth' => ['cookie'], - ]; - $resources['migrate_example_advanced_variety_multiple']['GET'] = [ - 'supported_formats' => ['json', 'xml'], - 'supported_auth' => ['cookie'], - ]; - $resources['migrate_example_advanced_variety_list']['GET'] = [ - 'supported_formats' => ['json', 'xml'], - 'supported_auth' => ['cookie'], - ]; - $resources['migrate_example_advanced_variety_items']['GET'] = [ - 'supported_formats' => ['json', 'xml'], - 'supported_auth' => ['cookie'], - ]; - $config->set('resources', $resources); - $config->save(); - - // Don't require authentication for the services, so the migrations can easily - // be run from drush. - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, - ['restful get migrate_example_advanced_position']); - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, - ['restful get migrate_example_advanced_variety_multiple']); - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, - ['restful get migrate_example_advanced_variety_list']); - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, - ['restful get migrate_example_advanced_variety_items']); - - // Populate our tables. - migrate_example_advanced_data_account(); - migrate_example_advanced_data_account_updates(); - migrate_example_advanced_data_categories(); - migrate_example_advanced_data_vintages(); - migrate_example_advanced_data_variety_updates(); - migrate_example_advanced_data_wine(); - migrate_example_advanced_data_updates(); - migrate_example_advanced_data_producer(); - migrate_example_advanced_data_category_wine(); - migrate_example_advanced_data_category_producer(); - migrate_example_advanced_data_comment(); - migrate_example_advanced_data_comment_updates(); - migrate_example_advanced_data_files(); - migrate_example_advanced_data_blobs(); - migrate_example_advanced_data_table_source(); -} - -function migrate_example_advanced_schema_wine() { - return [ - 'description' => 'Wines of the world', - 'fields' => [ - 'wineid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine ID', - ], - 'name' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ], - 'body' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Full description of the wine.', - ], - 'excerpt' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Abstract for this wine.', - ], - 'accountid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'ID of the author.', - ], - 'posted' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Original creation date', - ], - 'last_changed' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Last change date', - ], - 'variety' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine variety', - ], - 'region' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine region', - ], - 'rating' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Rating (100-point scale)', - ], - ], - 'primary key' => ['wineid'], - ]; -} - -function migrate_example_advanced_schema_updates() { - return array( - 'description' => 'Updated wine ratings', - 'fields' => [ - 'wineid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine ID', - ], - 'rating' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Rating (100-point scale)', - ], - ], - 'primary key' => ['wineid'], - ); -} - -function migrate_example_advanced_schema_producer() { - return array( - 'description' => 'Wine producers of the world', - 'fields' => array( - 'producerid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Producer ID', - ), - 'name' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ), - 'body' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Full description of the producer.', - ), - 'excerpt' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Abstract for this producer.', - ), - 'accountid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Account ID of the author.', - ), - ), - 'primary key' => array('producerid'), - ); -} - -function migrate_example_advanced_schema_categories() { - return array( - 'description' => 'Categories', - 'fields' => array( - 'categoryid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'unsigned' => TRUE, - 'description' => 'Category ID', - ), - 'type' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Type of category: variety, region, best_with', - ), - 'name' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ), - 'details' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ), - 'category_parent' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Parent category, if any', - ), - 'ordering' => array( - 'type' => 'int', - 'unsigned' => FALSE, - 'not null' => FALSE, - 'description' => 'Order in which to display categories', - ), - ), - 'primary key' => array('categoryid'), - ); -} - -function migrate_example_advanced_schema_vintages() { - return array( - 'description' => 'Wine vintages', - 'fields' => array( - 'wineid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Wine ID', - ), - 'vintage' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Vintage (year)', - ), - ), - 'primary key' => array('wineid', 'vintage'), - ); -} - -function migrate_example_advanced_schema_variety_updates() { - return array( - 'description' => 'Variety updates', - 'fields' => array( - 'categoryid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'unsigned' => TRUE, - 'description' => 'Category ID', - ), - 'details' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ), - ), - 'primary key' => array('categoryid'), - ); -} - -function migrate_example_advanced_schema_category_wine() { - return array( - 'description' => 'Wine category assignments', - 'fields' => array( - 'wineid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Wine ID', - ), - 'categoryid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Category ID', - ), - ), - 'primary key' => array('categoryid', 'wineid'), - ); -} - -function migrate_example_advanced_schema_category_producer() { - return array( - 'description' => 'Producer category assignments', - 'fields' => array( - 'producerid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Producer ID', - ), - 'categoryid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Category ID', - ), - ), - 'primary key' => array('categoryid', 'producerid'), - ); -} - -function migrate_example_advanced_schema_comment() { - return array( - 'description' => 'Wine comments', - 'fields' => array( - 'commentid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Comment ID', - ), - 'wineid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine ID that is being commented upon', - ), - 'comment_parent' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Parent comment ID in case of comment replies.', - ), - 'subject' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment subject', - ), - 'body' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment body', - ), - 'name' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment name (if anon)', - ), - 'mail' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment email (if anon)', - ), - 'accountid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Account ID (if any).', - ), - 'commenthost' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'IP/domain of host posted from', - ), - 'userpage' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'User homepage', - ), - 'posted' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Date comment posted', - ), - 'lastchanged' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Date comment last changed', - ), - ), - 'primary key' => array('commentid'), - ); -} - -function migrate_example_advanced_schema_comment_updates() { - return array( - 'description' => 'Wine comment updates', - 'fields' => array( - 'commentid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Comment ID', - ), - 'subject' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment subject', - ), - ), - 'primary key' => array('commentid'), - ); -} - -function migrate_example_advanced_schema_account() { - return array( - 'description' => 'Wine accounts.', - 'fields' => array( - 'accountid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Account ID', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Blocked_Allowed', - ), - 'posted' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Registration date', - ), - 'last_access' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Last access date', - ), - 'last_login' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Last login date', - ), - 'name' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account name (for login)', - ), - 'sex' => array( - 'type' => 'char', - 'length' => 1, - 'not null' => FALSE, - 'description' => 'Gender', - ), - 'password' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account password (raw)', - ), - 'mail' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account email', - ), - 'original_mail' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Original account email', - ), - 'sig' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Signature for comments', - ), - 'imageid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Image ID', - ), - 'positions' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Positions held', - ), - ), - 'primary key' => array('accountid'), - ); -} - -function migrate_example_advanced_schema_account_updates() { - return array( - 'description' => 'Wine account updates', - 'fields' => array( - 'accountid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Account ID', - ), - 'sex' => array( - 'type' => 'char', - 'length' => 1, - 'not null' => FALSE, - 'description' => 'Gender', - ), - ), - 'primary key' => array('accountid'), - ); -} - -function migrate_example_advanced_schema_blobs() { - return array( - 'description' => 'Wine blobs to be migrated to file entities', - 'fields' => array( - 'imageid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Image ID', - ), - 'imageblob' => array( - 'type' => 'blob', - 'size' => 'normal', - 'description' => 'binary image data', - ), - ), - 'primary key' => array('imageid'), - ); -} - -function migrate_example_advanced_schema_files() { - return array( - 'description' => 'Wine and account files', - 'fields' => array( - 'imageid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Image ID', - ), - 'url' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Image URL', - ), - 'image_alt' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image alt', - ), - 'image_title' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image title', - ), - 'wineid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Wine node this is associated with', - ), - ), - 'primary key' => array('imageid'), - ); -} - -function migrate_example_advanced_schema_table_source() { - return array( - 'description' => 'Source data to go into a custom Drupal table', - 'fields' => array( - 'fooid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Primary key', - ), - 'field1' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'First field', - ), - 'field2' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Second field', - ), - ), - 'primary key' => array('fooid'), - ); -} - -function migrate_example_advanced_schema_table_dest() { - return array( - 'description' => 'Custom Drupal table to receive source data directly', - 'fields' => array( - 'recordid' => array( - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Primary key', - ), - 'drupal_text' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'First field', - ), - 'drupal_int' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Second field', - ), - ), - 'primary key' => array('recordid'), - ); -} - -function migrate_example_advanced_data_wine() { - $fields = array('wineid', 'name', 'body', 'excerpt', 'accountid', - 'posted', 'last_changed', 'variety', 'region', 'rating'); - $query = db_insert('migrate_example_wine') - ->fields($fields); - $data = array( - array(1, 'Montes Classic Cabernet Sauvignon', 'Intense ruby-red color', 'Great!', 9, - strtotime('2010-01-02 03:04:05'), strtotime('2010-03-04 05:06:07'), 25, 17, 95), - array(2, 'Archeo Ruggero di Tasso Nero d\'Avola', 'Lots of berry character', 'Pair with red sauced dishes', 3, - strtotime('2010-09-03 18:23:58'), strtotime('2010-09-03 18:23:58'), 26, 2, 85), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_updates() { - $fields = array('wineid', 'rating'); - $query = db_insert('migrate_example_advanced_updates') - ->fields($fields); - $data = array( - array(1, 93), - array(2, NULL), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_producer() { - $fields = array('producerid', 'name', 'body', 'excerpt', 'accountid'); - $query = db_insert('migrate_example_advanced_producer') - ->fields($fields); - $data = array( - array(1, 'Montes', 'Fine Chilean winery', 'Great!', 9), - array(2, 'Archeo', 'Sicilia!', NULL, 3), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_account() { - $fields = array('accountid', 'status', 'posted', 'last_access', 'last_login', - 'name', 'sex', 'password', 'mail', 'original_mail', 'sig', 'imageid', 'positions'); - $query = db_insert('migrate_example_advanced_account') - ->fields($fields); - $data = array( - array(1, 1, '2010-03-30 10:31:05', '2010-04-30 18:25:24', '2010-04-30 14:01:02', - 'darren', 'M', 'dpass', 'ddarren@example.com', 'darren@example.com', - 'All about the Australians', NULL, '5'), - array(3, 0, '2007-03-15 10:31:05', '2007-06-10 04:11:38', '2007-06-10 04:11:38', - 'emily', 'F', 'insecure', 'emily@example.com', 'emily@example.com', - 'Sommelier to the stars', NULL, '18'), - array(9, 1, '2004-02-29 10:31:05', '2004-02-29 10:31:05', '2004-02-29 10:31:05', - 'fonzie', NULL, 'bike', 'thefonz@example.com', 'arthur@example.com', - 'Aaay!', 1, '5,18'), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_account_updates() { - $fields = array('accountid', 'sex'); - $query = db_insert('migrate_example_advanced_account_updates') - ->fields($fields); - $data = array( - array(1, NULL), - array(3, 'M'), - array(9, 'F'), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_comment() { - $fields = array('commentid', 'wineid', 'comment_parent', 'subject', 'body', - 'name', 'mail', 'accountid', 'commenthost', 'userpage', 'posted', 'lastchanged'); - $query = db_insert('migrate_example_advanced_comment') - ->fields($fields); - $data = array( - array(1, 1, NULL, 'im first', 'Tasty', 'grace', 'grace@example.com', 0, - '123.456.78.9', 'http:://grace.example.com/', - strtotime('2010-01-02 03:04:05'), strtotime('2010-04-05 06:07:08')), - array(2, 1, NULL, 'im second', 'Delicious', 'horace', 'horace@example.com', 0, - 'example.com', NULL, - strtotime('2010-02-02 03:04:05'), strtotime('2010-05-05 06:07:08')), - array(3, 1, NULL, 'im parent', 'Don\'t care for it', 'irene', 'irene@example.com', 0, - '254.0.2.5', 'http:://www.example.com/irene', - strtotime('2010-03-02 03:04:05'), strtotime('2010-03-02 03:04:05')), - array(4, 1, 3, 'im child', 'But it\'s so good!', 'emily', NULL, 3, - '58.29.126.1', 'http:://www.wine.com/', - strtotime('2010-01-02 03:04:05'), strtotime('2010-01-02 03:04:05')), - array(5, 1, 4, 'im grandchild', 'Right on, Emily!', 'thefonz@example.com', NULL, 9, - '123.456.78.9', NULL, - strtotime('2010-06-02 03:04:05'), strtotime('2010-06-02 03:04:05')), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_comment_updates() { - $fields = array('commentid', 'subject'); - $query = db_insert('migrate_example_advanced_comment_updates') - ->fields($fields); - $data = array( - array(1, 'I am first'), - array(2, 'I am second'), - array(3, 'I am parent'), - array(4, ''), - array(5, 'I am Spartacus'), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_categories() { - $fields = array('categoryid', 'type', 'name', 'category_parent', 'details', 'ordering'); - $query = db_insert('migrate_example_advanced_categories') - ->fields($fields); - $data = array( - array(1, 'variety', 'White wine', NULL, 'White wines are generally simpler and sweeter than red', 3), - array(3, 'variety', 'Red wine', NULL, 'Red wines are generally more complex and "dry" than white', 1), - array(8, 'variety', 'Riesling', 1, 'Associated with Germany', 2), - array(9, 'variety', 'Chardonnay', 1, 'One of the most popular whites', 1), - array(13, 'variety', 'Merlot', 3, 'Very drinkable', 4), - array(14, 'variety', 'Syrah', 3, 'A.k.a. shiraz', -3), - array(25, 'variety', 'Cabernet Sauvignon', 3, 'A basic', -5), - array(26, 'variety', "Nero d'Avola", 3, 'Sicilian specialty', 2), - array(2, 'region', 'Italy', NULL, 'Largest producer of wine', 5), - array(11, 'region', 'Tuscany', 2, NULL, 2), - array(18, 'region', 'Chianti', 11, NULL, -1), - array(19, 'region', 'Elba', 11, NULL, 5), - array(4, 'region', 'France', NULL, 'C\'est bon', 6), - array(5, 'region', 'Bordeaux', 4, NULL, 1), - array(6, 'region', 'Barsac', 5, NULL, 3), - array(7, 'region', 'Pomerol', 5, NULL, 2), - array(16, 'region', 'Chile', NULL, NULL, 3), - array(17, 'region', 'Colchagua Valley', 16, NULL, 1), - array(20, 'region', 'California', NULL, NULL, 5), - array(21, 'region', 'Redwood Valley', 20, NULL, 1), - array(10, 'best_with', 'Beef', NULL, NULL, 5), - array(12, 'best_with', 'Pork', NULL, NULL, -3), - array(15, 'best_with', 'Chicken', NULL, NULL, -5), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_vintages() { - $fields = array('wineid', 'vintage'); - $query = db_insert('migrate_example_advanced_vintages') - ->fields($fields); - $data = array( - array(1, 2006), - array(1, 2007), - array(2, 2001), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_variety_updates() { - $fields = array('categoryid', 'details'); - $query = db_insert('migrate_example_advanced_variety_updates') - ->fields($fields); - $data = array( - array(1, 'White wines are simpler and sweeter than red'), - array(3, 'Red wines are generally more complex and dry than white'), - array(8, 'Usually associated with Germany'), - array(9, NULL), - array(13, 'Common, very drinakable'), - array(14, 'AKA Shiraz'), - array(25, 'Basic'), - array(26, 'A specialty of Sicily'), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_category_wine() { - $fields = array('wineid', 'categoryid'); - $query = db_insert('migrate_example_advanced_category_wine') - ->fields($fields); - $data = array( - array(1, 12), - array(1, 15), - array(2, 10), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_category_producer() { - $fields = array('producerid', 'categoryid'); - $query = db_insert('migrate_example_advanced_category_producer') - ->fields($fields); - $data = array( - array(1, 17), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_files() { - $fields = array('imageid', 'url', 'image_alt', 'image_title', 'wineid'); - $query = db_insert('migrate_example_advanced_files') - ->fields($fields); - $data = array( - array(1, 'http://placekitten.com/200/200', NULL, NULL, NULL), - array(2, 'http://cyrve.com/files/penguin.jpeg', 'Penguin alt', 'Penguin title', 1), - array(3, 'http://cyrve.com/files/rioja.jpeg', 'Rioja alt', 'Rioja title', 2), - array(4, 'http://cyrve.com/files/boutisse_0.jpeg', 'Boutisse alt', 'Boutisse title', 2), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_blobs() { - $blob = file_get_contents('core/misc/druplicon.png'); - $fields = array('imageid', 'imageblob'); - $query = db_insert('migrate_example_advanced_blobs') - ->fields($fields); - $data = array( - array(1, $blob), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -function migrate_example_advanced_data_table_source() { - $fields = array('fooid', 'field1', 'field2'); - $query = db_insert('migrate_example_advanced_table_source') - ->fields($fields); - $data = array( - array(3, 'Some sample data', 58), - array(15, 'Whatever', 2), - array(646, 'More sample data', 34989), - ); - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/PositionResource.php --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/PositionResource.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ - 'wine_taster', 'name' => 'Wine Taster']; - $position2 = ['sourceid' => 'vintner', 'name' => 'Vintner']; - $data = ['position' => [$position1, $position2]]; - - $response = new ResourceResponse($data, 200); - return $response; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyItems.php --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyItems.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ - [ - 'name' => 'Retsina', - 'parent' => 1, // categoryid for 'white'. - 'details' => 'Greek', - ], - 'trebbiano' => [ - 'name' => 'Trebbiano', - 'parent' => 1, // categoryid for 'white'. - 'details' => 'Italian', - ], - 'valpolicella' => [ - 'name' => 'Valpolicella', - 'parent' => 3, // categoryid for 'red'. - 'details' => 'Italian Venoto region', - ], - 'bardolino' => [ - 'name' => 'Bardolino', - 'parent' => 3, // categoryid for 'red'. - 'details' => 'Italian Venoto region', - ], - ]; - if (isset($varieties[$variety])) { - $data = ['variety' => $varieties[$variety]]; - } - else { - $data = []; - } - - $response = new ResourceResponse($data, 200); - return $response; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php --- a/modules/contrib/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - 'Amarone', - 'parent' => 3, // categoryid for 'red'. - 'details' => 'Italian Venoto region', - 'attributes' => [ - 'rich', - 'aromatic', - ], - ]; - $data['variety'][] = [ - 'name' => 'Barbaresco', - 'parent' => 3, // categoryid for 'red'. - 'details' => 'Italian Piedmont region', - 'attributes' => [ - 'smoky', - 'earthy', - ], - ]; - } - if (strtolower($type) != 'red') { - $data['variety'][] = [ - 'name' => 'Kir', - 'parent' => 1, // categoryid for 'white'. - 'details' => 'French Burgundy region', - 'attributes' => [], - ]; - $data['variety'][] = [ - 'name' => 'Pinot Grigio', - 'parent' => 1, // categoryid for 'white'. - 'details' => 'From the northeast of Italy', - 'attributes' => [ - 'fruity', - 'medium-bodied', - 'slightly sweet', - ], - ]; - } - - $response = new ResourceResponse($data, 200); - return $response; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_example_advanced/src/Plugin/migrate/source/WineTerm.php --- a/modules/contrib/migrate_plus/migrate_example_advanced/src/Plugin/migrate/source/WineTerm.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -select('migrate_example_advanced_categories', 'wc') - ->fields('wc', ['categoryid', 'type', 'name', 'details', 'category_parent', 'ordering']) - // This sort assures that parents are saved before children. - ->orderBy('category_parent', 'ASC'); - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'categoryid' => $this->t('Unique ID of the category'), - 'type' => $this->t('Category type corresponding to Drupal vocabularies'), - 'name' => $this->t('Category name'), - 'details' => $this->t('Description of the category'), - 'category_parent' => $this->t('ID of the parent category'), - 'ordering' => $this->t('Order in which to display this category'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return ['categoryid' => ['type' => 'integer']]; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_plus.info.yml --- a/modules/contrib/migrate_plus/migrate_plus.info.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -type: module -name: Migrate Plus -description: 'Enhancements to core migration support' -package: Migration -# core: 8.x -dependencies: - - system (>=8.1) - - migrate - -# Information added by Drupal.org packaging script on 2016-08-05 -version: '8.x-2.0-beta2' -core: '8.x' -project: 'migrate_plus' -datestamp: 1470428640 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_plus.install --- a/modules/contrib/migrate_plus/migrate_plus.install Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -select('config', 'c') - ->fields('c', ['name', 'data']) - ->condition('name', 'migrate.migration.%', 'LIKE') - ->execute(); - foreach ($migration_config as $migration) { - $data = unserialize($migration->data); - if (isset($data['third_party_settings']['migrate_plus']['migration_group'])) { - $data['migration_group'] = $data['third_party_settings']['migrate_plus']['migration_group']; - unset($data['third_party_settings']['migrate_plus']); - if (empty($data['third_party_settings'])) { - unset($data['third_party_settings']); - } - $new_name = str_replace('migrate.migration.', 'migrate_plus.migration.', $migration->name); - $database->update('config') - ->fields([ - 'name' => $new_name, - 'data' => serialize($data), - ]) - ->condition('name', $migration->name) - ->execute(); - } - } -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_plus.module --- a/modules/contrib/migrate_plus/migrate_plus.module Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ - $migration) { - if (empty($migration['migration_group'])) { - $migration['migration_group'] = 'default'; - } - $group = MigrationGroup::load($migration['migration_group']); - if (empty($group)) { - // If the specified group does not exist, create it. Provide a little more - // for the 'default' group. - $group_properties = []; - $group_properties['id'] = $migration['migration_group']; - if ($migration['migration_group'] == 'default') { - $group_properties['label'] = 'Default'; - $group_properties['description'] = 'A container for any migrations not explicitly assigned to a group.'; - } - else { - $group_properties['label'] = $group_properties['id']; - $group_properties['description'] = ''; - } - $group = MigrationGroup::create($group_properties); - $group->save(); - } - $shared_configuration = $group->get('shared_configuration'); - if (empty($shared_configuration)) { - continue; - } - foreach ($shared_configuration as $key => $group_value) { - $migration_value = $migration[$key]; - // Where both the migration and the group provide arrays, replace - // recursively (so each key collision is resolved in favor of the - // migration). - if (is_array($migration_value) && is_array($group_value)) { - $merged_values = array_replace_recursive($group_value, $migration_value); - $migrations[$id][$key] = $merged_values; - } - // Where the group provides a value the migration doesn't, use the group - // value. - elseif (is_null($migration_value)) { - $migrations[$id][$key] = $group_value; - } - // Otherwise, the existing migration value overrides the group value. - } - } -} - -/** - * Implements hook_migrate_prepare_row(). - */ -function migrate_plus_migrate_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) { - \Drupal::service('event_dispatcher')->dispatch(MigrateEvents::PREPARE_ROW, new MigratePrepareRowEvent($row, $source, $migration)); -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/migrate_plus.services.yml --- a/modules/contrib/migrate_plus/migrate_plus.services.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -services: - plugin.manager.migrate_plus.data_fetcher: - class: Drupal\migrate_plus\DataFetcherPluginManager - parent: default_plugin_manager - plugin.manager.migrate_plus.data_parser: - class: Drupal\migrate_plus\DataParserPluginManager - parent: default_plugin_manager - plugin.manager.config_entity_migration: - class: Drupal\migrate_plus\Plugin\MigrationConfigEntityPluginManager - parent: plugin.manager.migration diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Annotation/DataFetcher.php --- a/modules/contrib/migrate_plus/src/Annotation/DataFetcher.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -alterInfo('data_fetcher_info'); - $this->setCacheBackend($cache_backend, 'migrate_plus_plugins_data_fetcher'); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/DataParserPluginBase.php --- a/modules/contrib/migrate_plus/src/DataParserPluginBase.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -urls = $configuration['urls']; - $this->itemSelector = $configuration['item_selector']; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition); - } - - - /** - * Returns the initialized data fetcher plugin. - * - * @return \Drupal\migrate_plus\DataFetcherPluginInterface - * The data fetcher plugin. - */ - public function getDataFetcherPlugin() { - if (!isset($this->dataFetcherPlugin)) { - $this->dataFetcherPlugin = \Drupal::service('plugin.manager.migrate_plus.data_fetcher')->createInstance($this->configuration['data_fetcher_plugin'], $this->configuration); - } - return $this->dataFetcherPlugin; - } - - /** - * {@inheritdoc} - */ - public function rewind() { - $this->activeUrl = NULL; - $this->next(); - } - - /** - * Implementation of Iterator::next(). - */ - public function next() { - $this->currentItem = $this->currentId = NULL; - if (is_null($this->activeUrl)) { - if (!$this->nextSource()) { - // No data to import. - return; - } - } - // At this point, we have a valid open source url, try to fetch a row from - // it. - $this->fetchNextRow(); - // If there was no valid row there, try the next url (if any). - if (is_null($this->currentItem)) { - if ($this->nextSource()) { - $this->fetchNextRow(); - } - } - if ($this->valid()) { - foreach ($this->configuration['ids'] as $id_field_name => $id_info) { - $this->currentId[$id_field_name] = $this->currentItem[$id_field_name]; - } - } - } - - /** - * Opens the specified URL. - * - * @param $url - * URL to open. - * - * @return bool - * TRUE if the URL was successfully opened, FALSE otherwise. - */ - abstract protected function openSourceUrl($url); - - /** - * Retrieves the next row of data from the open source URL, populating - * currentItem. - */ - abstract protected function fetchNextRow(); - - /** - * Advances the data parser to the next source url. - * - * @return bool - * TRUE if a valid source URL was opened - */ - protected function nextSource() { - while ($this->activeUrl === NULL || (count($this->urls) - 1) > $this->activeUrl) { - if (is_null($this->activeUrl)) { - $this->activeUrl = 0; - } - else { - // Increment the activeUrl so we try to load the next source. - $this->activeUrl = $this->activeUrl + 1; - if ($this->activeUrl >= count($this->urls)) { - return FALSE; - } - } - - if ($this->openSourceUrl($this->urls[$this->activeUrl])) { - // We have a valid source. - return TRUE; - } - } - - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function current() { - return $this->currentItem; - } - - /** - * {@inheritdoc} - */ - public function key() { - return $this->currentId; - } - - /** - * {@inheritdoc} - */ - public function valid() { - return !empty($this->currentItem); - } - - /** - * {@inheritdoc} - */ - public function count() { - $count = 0; - foreach ($this as $item) { - $count++; - } - return $count; - } - - /** - * Return the selectors used to populate each configured field. - * - * @return string[] - * Array of selectors, keyed by field name. - */ - protected function fieldSelectors() { - $fields = []; - foreach ($this->configuration['fields'] as $field_info) { - if (isset($field_info['selector'])) { - $fields[$field_info['name']] = $field_info['selector']; - } - } - return $fields; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/DataParserPluginInterface.php --- a/modules/contrib/migrate_plus/src/DataParserPluginInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -alterInfo('data_parser_info'); - $this->setCacheBackend($cache_backend, 'migrate_plus_plugins_data_parser'); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Entity/Migration.php --- a/modules/contrib/migrate_plus/src/Entity/Migration.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -createInstance($plugin_id); - $entity_array['id'] = $new_plugin_id; - $entity_array['migration_tags'] = $migration_plugin->get('migration_tags'); - $entity_array['label'] = $migration_plugin->label(); - $entity_array['source'] = $migration_plugin->getSourceConfiguration(); - $entity_array['destination'] = $migration_plugin->getDestinationConfiguration(); - $entity_array['process'] = $migration_plugin->getProcess(); - $entity_array['migration_dependencies'] = $migration_plugin->getMigrationDependencies(); - $migration_entity = static::create($entity_array); - return $migration_entity; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Entity/MigrationGroup.php --- a/modules/contrib/migrate_plus/src/Entity/MigrationGroup.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -condition('migration_group', $this->id()); - $names = $query->execute(); - - // Order the migrations according to their dependencies. - /** @var MigrationInterface[] $migrations */ - $migrations = \Drupal::entityTypeManager()->getStorage('migration')->loadMultiple($names); - - // Delete in reverse order, so dependencies are never violated. - $migrations = array_reverse($migrations); - - foreach ($migrations as $migration) { - $migration->delete(); - } - - // Finally, delete the group itself. - parent::delete(); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - parent::calculateDependencies(); - // Make sure we save any explicit module dependencies. - if ($provider = $this->get('module')) { - $this->addDependency('module', $provider); - } - return $this->dependencies; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Entity/MigrationGroupInterface.php --- a/modules/contrib/migrate_plus/src/Entity/MigrationGroupInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -row = $row; - $this->source = $source; - $this->migration = $migration; - } - - /** - * Gets the row object. - * - * @return \Drupal\migrate\Row - * The row object about to be imported. - */ - public function getRow() { - return $this->row; - } - - /** - * Gets the source plugin. - * - * @return \Drupal\migrate\Plugin\MigrateSourceInterface $source - * The source plugin firing the event. - */ - public function getSource() { - return $this->source; - } - - /** - * Gets the migration plugin. - * - * @return \Drupal\migrate\Plugin\MigrationInterface - * The migration entity being imported. - */ - public function getMigration() { - return $this->migration; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/Discovery/ConfigEntityDiscovery.php --- a/modules/contrib/migrate_plus/src/Plugin/Discovery/ConfigEntityDiscovery.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -entityType = $entity_type; - } - - /** - * {@inheritdoc} - */ - public function getDefinitions() { - $definition = \Drupal::entityTypeManager()->getDefinition($this->entityType); - $prefix = $definition->getConfigPrefix() . '.'; - $storage = \Drupal::service('config.storage'); - $query = \Drupal::entityQuery($this->entityType); - $ids = $query->execute(); - $definitions = []; - foreach ($ids as $id) { - $definitions[$id] = $storage->read($prefix . $id); - } - - return $definitions; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/MigrationConfigEntityPluginManager.php --- a/modules/contrib/migrate_plus/src/Plugin/MigrationConfigEntityPluginManager.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -discovery)) { - $discovery = new ConfigEntityDiscovery('migration'); - $this->discovery = new ContainerDerivativeDiscoveryDecorator($discovery); - } - return $this->discovery; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/migrate/process/EntityGenerate.php --- a/modules/contrib/migrate_plus/src/Plugin/migrate/process/EntityGenerate.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -generateEntity($value); - } - - return $result; - } - - /** - * Generates stub entity for a given value. - * - * @param string $value - * Value to use in creation of stub entity. - * - * @return int|string - * The entity id of the generated entity. - */ - protected function generateEntity($value) { - if(!empty($value)) { - $entity = $this->entityManager - ->getStorage($this->lookupEntityType) - ->create($this->stub($value)); - $entity->save(); - - return $entity->id(); - } - } - - /** - * Fabricate a stub entity. - * - * This is intended to be extended by implementing classes to provide for more - * dynamic default values, rather than just static ones. - * - * @param $value - * Value to use in creation of stub entity. - * - * @return array - * The stub entity. - */ - protected function stub($value) { - $stub = [$this->lookupValueKey => $value]; - - if ($this->lookupBundleKey) { - $stub[$this->lookupBundleKey] = $this->lookupBundle; - } - - // Gather any static default values for properties/fields. - if (isset($this->configuration['default_values']) && is_array($this->configuration['default_values'])) { - foreach ($this->configuration['default_values'] as $key => $value) { - $stub[$key] = $value; - } - } - - return $stub; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/migrate/process/EntityLookup.php --- a/modules/contrib/migrate_plus/src/Plugin/migrate/process/EntityLookup.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,241 +0,0 @@ -migration = $migration; - $this->entityManager = $entityManager; - $this->selectionPluginManager = $selectionPluginManager; - $pluginIdParts = explode(':', $this->migration->getDestinationPlugin()->getPluginId()); - $this->destinationEntityType = empty($pluginIdParts[1]) ?: $pluginIdParts[1]; - $this->destinationBundleKey = !$this->destinationEntityType ?: $this->entityManager->getDefinition($this->destinationEntityType)->getKey('bundle'); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition, MigrationInterface $migration = NULL) { - return new static( - $configuration, - $pluginId, - $pluginDefinition, - $migration, - $container->get('entity.manager'), - $container->get('plugin.manager.entity_reference_selection') - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrateExecutable, Row $row, $destinationProperty) { - $this->determineLookupProperties($destinationProperty); - - $this->destinationProperty = $this->configuration['destination_field']; - - return $this->query($value); - } - - /** - * Determine the lookup properties from config or target field configuration. - * - * @param string $destinationProperty - * The destination property currently worked on. This is only used together - * with the $row above. - */ - protected function determineLookupProperties($destinationProperty) { - if (!empty($this->configuration['value_key'])) { - $this->lookupValueKey = $this->configuration['value_key']; - } - if (!empty($this->configuration['bundle_key'])) { - $this->lookupBundleKey = $this->configuration['bundle_key']; - } - if (!empty($this->configuration['bundle'])) { - $this->lookupBundle = $this->configuration['bundle']; - } - if (!empty($this->configuration['entity_type'])) { - $this->lookupEntityType = $this->configuration['entity_type']; - } - - if (empty($this->lookupValueKey) || empty($this->lookupBundleKey) || empty($this->lookupBundle) || empty($this->lookupEntityType)) { - // See if we can introspect the lookup properties from the destination field. - if (!empty($this->migration->getProcess()[$this->destinationBundleKey][0]['default_value'])) { - $destinationEntityBundle = $this->migration->getProcess()[$this->destinationBundleKey][0]['default_value']; - $fieldConfig = $this->entityManager->getFieldDefinitions($this->destinationEntityType, $destinationEntityBundle)[$destinationProperty]->getConfig($destinationEntityBundle); - if ($fieldConfig->getType() != 'entity_reference') { - throw new MigrateException('The entity_lookup plugin found no entity reference field.'); - } - - if (empty($this->lookupBundle)) { - $handlerSettings = $fieldConfig->getSetting('handler_settings'); - $bundles = array_filter((array) $handlerSettings['target_bundles']); - if (count($bundles) == 1) { - $this->lookupBundle = reset($bundles); - } - // This was added in 8.1.x is not supported in 8.0.x. - elseif (!empty($handlerSettings['auto_create']) && !empty($handlerSettings['auto_create_bundle'])) { - $this->lookupBundle = reset($handlerSettings['auto_create_bundle']); - } - } - - // Make an assumption that if the selection handler can target more than - // one type of entity that we will use the first entity type. - $this->lookupEntityType = $this->lookupEntityType ?: reset($this->selectionPluginManager->createInstance($fieldConfig->getSetting('handler'))->getPluginDefinition()['entity_types']); - $this->lookupValueKey = $this->lookupValueKey ?: $this->entityManager->getDefinition($this->lookupEntityType)->getKey('label'); - $this->lookupBundleKey = $this->lookupBundleKey ?: $this->entityManager->getDefinition($this->lookupEntityType)->getKey('bundle'); - } - } - - // If there aren't enough lookup properties available by now, then bail. - if (empty($this->lookupValueKey)) { - throw new MigrateException('The entity_lookup plugin requires a value_key, none located.'); - } - if (!empty($this->lookupBundleKey) && empty($this->lookupBundle)) { - throw new MigrateException('The entity_lookup plugin found no bundle but destination entity requires one.'); - } - if (empty($this->lookupEntityType)) { - throw new MigrateException('The entity_lookup plugin requires a entity_type, none located.'); - } - } - - /** - * Checks for the existence of some value. - * - * @param $value - * The value to query. - * - * @return mixed|null - * Entity id if the queried entity exists. Otherwise NULL. - */ - protected function query($value) { - // Entity queries typically are case-insensitive. Therefore, we need to - // handle case sensitive filtering as a post-query step. By default, it - // filters case insensitive. Change to true if that is not the desired - // outcome. - $ignoreCase = !empty($this->configuration['ignore_case']) ?: FALSE; - - $multiple = is_array($value); - - $query = $this->entityManager->getStorage($this->lookupEntityType) - ->getQuery() - ->condition($this->lookupValueKey, $value, $multiple ? 'IN' : NULL); - - if ($this->lookupBundleKey) { - $query->condition($this->lookupBundleKey, $this->lookupBundle); - } - $results = $query->execute(); - - if (empty($results)) { - return NULL; - } - - if ($multiple && !empty($this->destinationProperty)) { - array_walk($results, function (&$value) { - $value = [$this->destinationProperty => $value]; - }); - - return array_values($results); - } - - // By default do a case-sensitive comparison. - if (!$ignoreCase) { - // Returns the entity's identifier. - foreach ($results as $identifier) { - if ($value === $this->entityManager->getStorage($this->lookupEntityType)->load($identifier)->{$this->lookupValueKey}->value) { - return $identifier; - } - } - } - - return reset($results); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/migrate/source/SourcePluginExtension.php --- a/modules/contrib/migrate_plus/src/Plugin/migrate/source/SourcePluginExtension.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -fields = $configuration['fields']; - $this->ids = $configuration['ids']; - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = []; - foreach ($this->fields as $field_info) { - $fields[$field_info['name']] = isset($field_info['label']) ? $field_info['label'] : $field_info['name']; - } - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return $this->ids; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/migrate/source/Url.php --- a/modules/contrib/migrate_plus/src/Plugin/migrate/source/Url.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -sourceUrls = $configuration['urls']; - - // Set a default Accept header. -/* $this->headers = array_merge(['Accept' => 'application/json'], - $configuration['headers'] ?: []);*/ - - // See if this is a paged response with next links. If so, add to the source_urls array. -/* foreach ( (array) $configuration['urls'] as $url) { - $this->sourceUrls += $this->getNextLinks($url); - }*/ - } - - /** - * Return a string representing the source URLs. - * - * @return string - * Comma-separated list of URLs being imported. - */ - public function __toString() { - // This could cause a problem when using a lot of urls, may need to hash. - $urls = implode(', ', $this->sourceUrls); - return $urls; - } - - /** - * Returns the initialized data parser plugin. - * - * @return \Drupal\migrate_plus\DataParserPluginInterface - * The data parser plugin. - */ - public function getDataParserPlugin() { - if (!isset($this->dataParserPlugin)) { - $this->dataParserPlugin = \Drupal::service('plugin.manager.migrate_plus.data_parser')->createInstance($this->configuration['data_parser_plugin'], $this->configuration); - } - return $this->dataParserPlugin; - } - - /** - * Creates and returns a filtered Iterator over the documents. - * - * @return \Iterator - * An iterator over the documents providing source rows that match the - * configured item_selector. - */ - protected function initializeIterator() { - return $this->getDataParserPlugin(); - } - - /** - * Collect an array of next links from a paged response. - */ -/* protected function getNextLinks($url) { - $urls = array(); - $more = TRUE; - while ($more == TRUE) { - $response = $this->dataParserPlugin->getDataFetcher()->getResponse($url); - if ($url = $this->getNextFromHeaders($response)) { - $urls[] = $url; - } - elseif ($url = $this->getNextFromLinks($response)) { - $urls[] = $url; - } - else { - $more = FALSE; - } - } - return $urls; - } -*/ - /** - * See if the next link is in a 'links' group in the response. - * - * @param \Psr\Http\Message\ResponseInterface $response - */ -/* protected function getNextFromLinks(ResponseInterface $response) { - $body = json_decode($response->getBody(), TRUE); - if (!empty($body['links']) && array_key_exists('next', $body['links'])) { - return $body['links']['next']; - } - return FALSE; - } -*/ - /** - * See if the next link is in the header. - * - * @param \Psr\Http\Message\ResponseInterface $response - */ -/* protected function getNextFromHeaders(ResponseInterface $response) { - $headers = $response->getHeader('Link'); - foreach ($headers as $header) { - $matches = array(); - preg_match('/^<(.*)>; rel="next"$/', $header, $matches); - if (!empty($matches) && !empty($matches[1])) { - return $matches[1]; - } - } - return FALSE; - } -*/ -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/migrate_plus/data_fetcher/Http.php --- a/modules/contrib/migrate_plus/src/Plugin/migrate_plus/data_fetcher/Http.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -httpClient = \Drupal::httpClient(); - } - - /** - * {@inheritdoc} - */ - public function setRequestHeaders(array $headers) { - $this->headers = $headers; - } - - /** - * {@inheritdoc} - */ - public function getRequestHeaders() { - return !empty($this->headers) ? $this->headers : array(); - } - - /** - * {@inheritdoc} - */ - public function getResponse($url) { - try { - $response = $this->httpClient->get($url, array( - 'headers' => $this->getRequestHeaders(), - // Uncomment the following to debug the request. - //'debug' => true, - )); - if (empty($response)) { - throw new MigrateException('No response at ' . $url . '.'); - } - } - catch (RequestException $e) { - throw new MigrateException('Error message: ' . $e->getMessage() . ' at ' . $url .'.'); - } - return $response; - } - - /** - * {@inheritdoc} - */ - public function getResponseContent($url) { - $response = $this->getResponse($url); - return $response->getBody(); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/migrate_plus/data_parser/Json.php --- a/modules/contrib/migrate_plus/src/Plugin/migrate_plus/data_parser/Json.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -getSourceIterator($url); - - // Recurse through the result array. When there is an array of items at the - // expected depth, pull that array out as a distinct item. - $identifierDepth = $this->itemSelector; - $items = []; - $iterator->rewind(); - while ($iterator->valid()) { - $item = $iterator->current(); - if (is_array($item) && $iterator->getDepth() == $identifierDepth) { - $items[] = $item; - } - $iterator->next(); - } - return $items; - } - - /** - * Get the source data for reading. - * - * @param string $url - * The URL to read the source data from. - * - * @return \RecursiveIteratorIterator|resource - * - * @throws \Drupal\migrate\MigrateException - */ - protected function getSourceIterator($url) { - try { - $response = $this->getDataFetcherPlugin()->getResponseContent($url); - // The TRUE setting means decode the response into an associative array. - $array = json_decode($response, TRUE); - - // Return the results in a recursive iterator that - // can traverse multidimensional arrays. - return new \RecursiveIteratorIterator( - new \RecursiveArrayIterator($array), - \RecursiveIteratorIterator::SELF_FIRST); - } - catch (RequestException $e) { - throw new MigrateException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - protected function openSourceUrl($url) { - // (Re)open the provided URL. - $source_data = $this->getSourceData($url); - $this->iterator = new \ArrayIterator($source_data); - return TRUE; - } - - /** - * {@inheritdoc} - */ - protected function fetchNextRow() { - $current = $this->iterator->current(); - if ($current) { - foreach ($this->fieldSelectors() as $field_name => $selector) { - $this->currentItem[$field_name] = $current[$selector]; - } - $this->iterator->next(); - } - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/migrate_plus/data_parser/Soap.php --- a/modules/contrib/migrate_plus/src/Plugin/migrate_plus/data_parser/Soap.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -function = $configuration['function']; - $this->parameters = $configuration['parameters']; - $this->responseType = $configuration['response_type']; - } - - /** - * {@inheritdoc} - * - * @throws \SoapFault - * If there's an error in a SOAP call. - * @throws \Drupal\migrate\MigrateException - * If we can't resolve the SOAP function or its response property. - */ - protected function openSourceUrl($url) { - // Will throw SoapFault if there's - $client = new \SoapClient($url); - // Determine the response property name. - $function_found = FALSE; - foreach ($client->__getFunctions() as $function_signature) { - // E.g., "GetWeatherResponse GetWeather(GetWeather $parameters)". - $response_type = strtok($function_signature, ' '); - $function_name = strtok('('); - if (strcasecmp($function_name, $this->function) === 0) { - $function_found = TRUE; - foreach ($client->__getTypes() as $type_info) { - // E.g., "struct GetWeatherResponse {\n string GetWeatherResult;\n}". - if (preg_match('|struct (.*?) {\s*[a-z]+ (.*?);|is', $type_info, $matches)) { - if ($matches[1] == $response_type) { - $response_property = $matches[2]; - } - } - } - break; - } - } - if (!$function_found) { - throw new MigrateException("SOAP function {$this->function} not found."); - } - elseif (!isset($response_property)) { - throw new MigrateException("Response property not found for SOAP function {$this->function}."); - } - $response = $client->{$this->function}($this->parameters); - $response_value = $response->$response_property; - switch ($this->responseType) { - case 'xml': - $xml = simplexml_load_string($response_value); - $this->iterator = new \ArrayIterator($xml->xpath($this->itemSelector)); - break; - case 'object': - $this->iterator = new \ArrayIterator($response_value->{$this->itemSelector}); - break; - case 'array': - $this->iterator = new \ArrayIterator($response_value[$this->itemSelector]); - break; - } - return TRUE; - } - - /** - * {@inheritdoc} - */ - protected function fetchNextRow() { - $current = $this->iterator->current(); - if ($current) { - foreach ($this->fieldSelectors() as $field_name => $selector) { - $this->currentItem[$field_name] = $current->$selector; - } - $this->iterator->next(); - } - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Plugin/migrate_plus/data_parser/Xml.php --- a/modules/contrib/migrate_plus/src/Plugin/migrate_plus/data_parser/Xml.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,351 +0,0 @@ - 'file', 1 => 'article']. - * - * @var array - */ - protected $elementsToMatch = []; - - /** - * An optional xpath predicate. - * - * Restricts the matching elements based on values in their children. Parsed - * from the element query at construct time. - * - * @var string - */ - protected $xpathPredicate = NULL; - - /** - * Array representing the path to the current element as we traverse the XML. - * - * For example, if in an XML string like '
    ...
    ' - * we are positioned within the article element, currentPath will be - * [0 => 'file', 1 => 'article']. - * - * @var array - */ - protected $currentPath = []; - - /** - * Retains all elements with a given name to support extraction from parents. - * - * This is a hack to support field extraction of values in parents - * of the 'context node' - ie, if $this->fields() has something like '..\nid'. - * Since we are using a streaming xml processor, it is too late to snoop - * around parent elements again once we've located an element of interest. So, - * grab elements with matching names and their depths, and refer back to it - * when building the source row. - * - * @var array - */ - protected $parentXpathCache = []; - - /** - * Hash of the element names that should be captured into $parentXpathCache. - * - * @var array - */ - protected $parentElementsOfInterest = []; - - /** - * Element name matching mode. - * - * When matching element names, whether to compare to the namespace-prefixed - * name, or the local name. - * - * @var bool - */ - protected $prefixedName = FALSE; - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - - $this->reader = new \XMLReader(); - - // Suppress errors during parsing, so we can pick them up after. - libxml_use_internal_errors(TRUE); - - // Parse the element query. First capture group is the element path, second - // (if present) is the attribute. - preg_match_all('|^/([^\[]+)\[?(.*?)]?$|', $configuration['item_selector'], $matches); - $element_path = $matches[1][0]; - $this->elementsToMatch = explode('/', $element_path); - $predicate = $matches[2][0]; - if ($predicate) { - $this->xpathPredicate = $predicate; - } - - // If the element path contains any colons, it must be specifying - // namespaces, so we need to compare using the prefixed element - // name in next(). - if (strpos($element_path, ':')) { - $this->prefixedName = TRUE; - } - - foreach ($this->fieldSelectors() as $field_name => $xpath) { - $prefix = substr($xpath, 0, 3); - if ($prefix === '../') { - $this->parentElementsOfInterest[] = str_replace('../', '', $xpath); - } - elseif ($prefix === '..\\') { - $this->parentElementsOfInterest[] = str_replace('..\\', '', $xpath); - } - } - } - - /** - * Builds a \SimpleXmlElement rooted at the iterator's current location. - * - * The resulting SimpleXmlElement also contains any child nodes of the current - * element. - * - * @return \SimpleXmlElement|false - * A \SimpleXmlElement when the document is parseable, or false if a - * parsing error occurred. - * - * @throws MigrateException - */ - protected function getSimpleXml() { - $node = $this->reader->expand(); - if ($node) { - // We must associate the DOMNode with a DOMDocument to be able to import - // it into SimpleXML. Despite appearances, this is almost twice as fast as - // simplexml_load_string($this->readOuterXML()); - $dom = new \DOMDocument(); - $node = $dom->importNode($node, TRUE); - $dom->appendChild($node); - $sxml_elem = simplexml_import_dom($node); - $this->registerNamespaces($sxml_elem); - return $sxml_elem; - } - else { - foreach (libxml_get_errors() as $error) { - $error_string = self::parseLibXmlError($error); - throw new MigrateException($error_string); - } - return FALSE; - } - } - - /** - * {@inheritdoc} - */ - public function rewind() { - // Reset our path tracker. - $this->currentPath = []; - parent::rewind(); - } - - /** - * {@inheritdoc} - */ - protected function openSourceUrl($url) { - // (Re)open the provided URL. - $this->reader->close(); - return $this->reader->open($url, NULL, \LIBXML_NOWARNING); - } - - /** - * {@inheritdoc} - */ - protected function fetchNextRow() { - $target_element = NULL; - - // Loop over each node in the XML file, looking for elements at a path - // matching the input query string (represented in $this->elementsToMatch). - while ($this->reader->read()) { - if ($this->reader->nodeType == \XMLReader::ELEMENT) { - if ($this->prefixedName) { - $this->currentPath[$this->reader->depth] = $this->reader->name; - if (array_key_exists($this->reader->name, $this->parentElementsOfInterest)) { - $this->parentXpathCache[$this->reader->depth][$this->reader->name][] = $this->getSimpleXml(); - } - } - else { - $this->currentPath[$this->reader->depth] = $this->reader->localName; - if (array_key_exists($this->reader->localName, $this->parentElementsOfInterest)) { - $this->parentXpathCache[$this->reader->depth][$this->reader->name][] = $this->getSimpleXml(); - } - } - if ($this->currentPath == $this->elementsToMatch) { - // We're positioned to the right element path - build the SimpleXML - // object to enable proper xpath predicate evaluation. - $target_element = $this->getSimpleXml(); - if ($target_element !== FALSE) { - if (empty($this->xpathPredicate) || $this->predicateMatches($target_element)) { - break; - } - } - } - } - elseif ($this->reader->nodeType == \XMLReader::END_ELEMENT) { - // Remove this element and any deeper ones from the current path. - foreach ($this->currentPath as $depth => $name) { - if ($depth >= $this->reader->depth) { - unset($this->currentPath[$depth]); - } - } - foreach ($this->parentXpathCache as $depth => $elements) { - if ($depth > $this->reader->depth) { - unset($this->parentXpathCache[$depth]); - } - } - } - } - - // If we've found the desired element, populate the currentItem and - // currentId with its data. - if ($target_element !== FALSE && !is_null($target_element)) { - foreach ($this->fieldSelectors() as $field_name => $xpath) { - foreach ($target_element->xpath($xpath) as $value) { - $this->currentItem[$field_name][] = (string) $value; - } - } - // Reduce single-value results to scalars. - foreach ($this->currentItem as $field_name => $values) { - if (count($values) == 1) { - $this->currentItem[$field_name] = reset($values); - } - } - } - } - - /** - * Tests whether the iterator's xpath predicate matches the provided element. - * - * Has some limitations esp. in that it is easy to write predicates that - * reference things outside this SimpleXmlElement's tree, but "simpler" - * predicates should work as expected. - * - * @param \SimpleXMLElement $elem - * The element to test. - * - * @return bool - * True if the element matches the predicate, false if not. - */ - protected function predicateMatches(\SimpleXMLElement $elem) { - return !empty($elem->xpath('/*[' . $this->xpathPredicate . ']')); - } - - /** - * Gets an ancestor SimpleXMLElement, if the element name was registered. - * - * Gets the SimpleXMLElement some number of levels above the iterator - * having the given name, but only for element names that this - * Xml data parser was told to retain for future reference through the - * constructor's $parent_elements_of_interest. - * - * @param int $levels_up - * The number of levels back towards the root of the DOM tree to ascend - * before searching for the named element. - * @param string $name - * The name of the desired element. - * - * @return \SimpleXMLElement|false - * The element matching the level and name requirements, or false if it is - * not present or was not retained. - */ - public function getAncestorElements($levels_up, $name) { - if ($levels_up > 0) { - $levels_up *= -1; - } - $ancestor_depth = $this->reader->depth + $levels_up + 1; - if ($ancestor_depth < 0) { - return FALSE; - } - - if (array_key_exists($ancestor_depth, $this->parentXpathCache) && array_key_exists($name, $this->parentXpathCache[$ancestor_depth])) { - return $this->parentXpathCache[$ancestor_depth][$name]; - } - else { - return FALSE; - } - } - - /** - * Registers the iterator's namespaces to a SimpleXMLElement. - * - * @param \SimpleXMLElement $xml - * The element to apply namespace registrations to. - */ - protected function registerNamespaces(\SimpleXMLElement $xml) { - if (is_array($this->configuration['namespaces'])) { - foreach ($this->configuration['namespaces'] as $prefix => $ns) { - $xml->registerXPathNamespace($prefix, $ns); - } - } - } - - /** - * Parses a LibXMLError to a error message string. - * - * @param \LibXMLError $error - * Error thrown by the XML. - * - * @return string - * Error message - */ - public static function parseLibXmlError(\LibXMLError $error) { - $error_code_name = 'Unknown Error'; - switch ($error->level) { - case LIBXML_ERR_WARNING: - $error_code_name = t('Warning'); - break; - - case LIBXML_ERR_ERROR: - $error_code_name = t('Error'); - break; - - case LIBXML_ERR_FATAL: - $error_code_name = t('Fatal Error'); - break; - } - - return t( - "@libxmlerrorcodename @libxmlerrorcode: @libxmlerrormessage\n" . - "Line: @libxmlerrorline\n" . - "Column: @libxmlerrorcolumn\n" . - "File: @libxmlerrorfile", - [ - '@libxmlerrorcodename' => $error_code_name, - '@libxmlerrorcode' => $error->code, - '@libxmlerrormessage' => trim($error->message), - '@libxmlerrorline' => $error->line, - '@libxmlerrorcolumn' => $error->column, - '@libxmlerrorfile' => (($error->file)) ? $error->file : NULL, - ] - ); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Tests/MigrationConfigEntityTest.php --- a/modules/contrib/migrate_plus/src/Tests/MigrationConfigEntityTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -pluginMananger = \Drupal::service('plugin.manager.config_entity_migration'); - } - - public function testCacheInvalidation() { - $config = Migration::create([ - 'id' => 'test', - 'label' => 'Label A', - 'migration_tags' => [], - 'source' => [], - 'destination' => [], - 'migration_dependencies' => [], - ]); - $config->save(); - - $this->assertTrue($this->pluginMananger->getDefinition('test')); - $this->assertSame('Label A', $this->pluginMananger->getDefinition('test')['label']); - - // Clear static cache in the plugin manager, the cache tag take care of the - // persistent cache. - $this->pluginMananger->useCaches(FALSE); - $this->pluginMananger->useCaches(TRUE); - - $config->set('label', 'Label B'); - $config->save(); - - $this->assertSame('Label B', $this->pluginMananger->getDefinition('test')['label']); - $this->assertSame('Label B', \Drupal::service('plugin.manager.migration')->getDefinition('test')['label']); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_plus/src/Tests/MigrationGroupTest.php --- a/modules/contrib/migrate_plus/src/Tests/MigrationGroupTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ - $group_id, - 'shared_configuration' => [ - 'migration_tags' => ['Drupal 6'], // In migration, so will be overridden. - 'source' => [ - 'constants' => [ - 'type' => 'image', // Not in migration, so will be added. - 'cardinality' => '1', // In migration, so will be overridden. - ], - ], - 'destination' => ['plugin' => 'field_storage_config'], // Not in migration, so will be added. - ], - ]; - $this->container->get('entity_type.manager')->getStorage('migration_group') - ->create($group_configuration)->save(); - - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */ - $migration = $this->container->get('entity_type.manager') - ->getStorage('migration')->create([ - 'id' => 'specific_migration', - 'load' => [], - 'migration_group' => $group_id, - 'label' => 'Unaffected by the group', - 'migration_tags' => ['Drupal 7'], // Overrides group. - 'destination' => [], - 'source' => [], - 'migration_dependencies' => [], - ]); - $migration->set('source', [ - 'plugin' => 'empty', // Not in group, persists. - 'constants' => [ - 'entity_type' => 'user', // Not in group, persists. - 'cardinality' => '3', // Overrides group. - ], - ]); - $migration->save(); - - $expected_config = [ - 'migration_group' => $group_id, - 'label' => 'Unaffected by the group', - 'migration_tags' => ['Drupal 7'], - 'source' => [ - 'plugin' => 'empty', - 'constants' => [ - 'entity_type' => 'user', - 'type' => 'image', - 'cardinality' => '3', - ], - ], - 'destination' => ['plugin' => 'field_storage_config'], - ]; - /** @var \Drupal\migrate\Plugin\MigrationInterface $loaded_migration */ - $loaded_migration = $this->container->get('plugin.manager.config_entity_migration') - ->createInstance('specific_migration'); - foreach ($expected_config as $key => $expected_value) { - $actual_value = $loaded_migration->get($key); - $this->assertEquals($expected_value, $actual_value); - } - } - - /** - * Test that deleting a group deletes its migrations. - */ - public function testDelete() { - /** @var MigrationGroupInterface $migration_group */ - $group_configuration = [ - 'id' => 'test_group', - ]; - $migration_group = $this->container->get('entity_type.manager') - ->getStorage('migration_group')->create($group_configuration); - $migration_group->save(); - - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */ - $migration = $this->container->get('entity_type.manager') - ->getStorage('migration')->create([ - 'id' => 'specific_migration', - 'migration_group' => 'test_group', - 'migration_tags' => [], - 'load' => [], - 'destination' => [], - 'source' => [], - 'migration_dependencies' => [], - ]); - $migration->save(); - - /** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $loaded_migration_group */ - $loaded_migration_group = MigrationGroup::load('test_group'); - $loaded_migration_group->delete(); - - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $loaded_migration */ - $loaded_migration = Migration::load('specific_migration'); - $this->assertNull($loaded_migration); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/LICENSE.txt --- a/modules/contrib/migrate_tools/LICENSE.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/README.txt --- a/modules/contrib/migrate_tools/README.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -The Migrate Tools module provides tools for running and managing Drupal 8 -migrations. - -Drush commands supported include: - -* migrate-status - Lists migrations and their status. -* migrate-import - Performs import operations. -* migrate-rollback - Performs rollback operations. -* migrate-stop - Cleanly stops a running operation. -* migrate-reset-status - Sets a migration status to Idle if it's gotten stuck. -* migrate-messages - Lists any messages associated with a migration import. - -The UI at this point provides a front-end equivalent to the migrate-status and -migrate-messages commands. It will be enhanced to allow running the other -operations, as well as provide the ability to create and alter migrations. diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/migrate_tools.drush.inc --- a/modules/contrib/migrate_tools/migrate_tools.drush.inc Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,452 +0,0 @@ - 'List all migrations with current status.', - 'options' => [ - 'group' => 'Name of the migration group to list', - 'names-only' => 'Only return names, not all the details (faster)', - ], - 'arguments' => [ - 'migration' => 'Restrict to a comma-separated list of migrations. Optional', - ], - 'examples' => [ - 'migrate-status' => 'Retrieve status for all migrations', - 'migrate-status --group=beer' => 'Retrieve status for all migrations in a given group', - 'migrate-status BeerTerm,BeerNode' => 'Retrieve status for specific migrations', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['ms'], - ]; - - $items['migrate-import'] = [ - 'description' => 'Perform one or more migration processes.', - 'options' => [ - 'all' => 'Process all migrations.', - 'group' => 'Name of the migration group to import', - 'limit' => 'Limit on the number of items to process in each migration', - 'feedback' => 'Frequency of progress messages, in items processed', - 'idlist' => 'Comma-separated list of IDs to import', - 'update' => ' In addition to processing unprocessed items from the source, update previously-imported items with the current data', - 'force' => 'Force an operation to run, even if all dependencies are not satisfied', - 'execute-dependencies' => 'Execute all dependent migrations first.', - ], - 'arguments' => [ - 'migration' => 'Name of migration(s) to import. Delimit multiple using commas.', - ], - 'examples' => [ - 'migrate-import --all' => 'Perform all migrations', - 'migrate-import --group=beer' => 'Import all migrations in the beer group', - 'migrate-import BeerTerm,BeerNode' => 'Import new terms and nodes', - 'migrate-import BeerUser --limit=2' => 'Import no more than 2 users', - 'migrate-import BeerUser --idlist=5' => 'Import the user record with source ID 5', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mi'], - ]; - - $items['migrate-rollback'] = array( - 'description' => 'Rollback one or more migrations.', - 'options' => array( - 'all' => 'Process all migrations.', - 'group' => 'Name of the migration group to rollback', - 'feedback' => 'Frequency of progress messages, in items processed', - ), - 'arguments' => array( - 'migration' => 'Name of migration(s) to rollback. Delimit multiple using commas.', - ), - 'examples' => array( - 'migrate-rollback --all' => 'Perform all migrations', - 'migrate-rollback --group=beer' => 'Rollback all migrations in the beer group', - 'migrate-rollback BeerTerm,BeerNode' => 'Rollback imported terms and nodes', - ), - 'drupal dependencies' => array('migrate_tools'), - 'aliases' => array('mr'), - ); - - $items['migrate-stop'] = [ - 'description' => 'Stop an active migration operation.', - 'arguments' => [ - 'migration' => 'Name of migration to stop', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mst'], - ]; - - $items['migrate-reset-status'] = [ - 'description' => 'Reset a active migration\'s status to idle.', - 'arguments' => [ - 'migration' => 'Name of migration to reset', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mrs'], - ]; - - $items['migrate-messages'] = [ - 'description' => 'View any messages associated with a migration.', - 'arguments' => [ - 'migration' => 'Name of the migration', - ], - 'options' => [ - 'csv' => 'Export messages as a CSV' - ], - 'examples' => [ - 'migrate-messages MyNode' => 'Show all messages for the MyNode migration', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mmsg'], - ]; - - $items['migrate-fields-source'] = [ - 'description' => 'List the fields available for mapping in a source.', - 'arguments' => [ - 'migration' => 'Name of the migration', - ], - 'examples' => [ - 'migrate-fields-source my_node' => 'List fields for the source in the my_node migration', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mfs'], - ]; - - return $items; -} - -/** - * @param string $migration_names - */ -function drush_migrate_tools_migrate_status($migration_names = '') { - $group_name = drush_get_option('group'); - $names_only = drush_get_option('names-only'); - - $migrations = drush_migrate_tools_migration_list($group_name, $migration_names); - - $table = []; - // Take it one group at a time, listing the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - if ($names_only) { - $table[] = [ - dt('Group: @name', array('@name' => $group_id)) - ]; - } - else { - $table[] = [ - dt('Group: @name', array('@name' => $group_id)), - dt('Status'), - dt('Total'), - dt('Imported'), - dt('Unprocessed'), - dt('Last imported'), - ]; - } - foreach ($migration_list as $migration_id => $migration) { - try { - $map = $migration->getIdMap(); - $imported = $map->importedCount(); - $source_plugin = $migration->getSourcePlugin(); - } - catch (Exception $e) { - drush_log(dt('Failure retrieving information on @migration: @message', - ['@migration' => $migration_id, '@message' => $e->getMessage()])); - continue; - } - try { - $source_rows = $source_plugin->count(); - // -1 indicates uncountable sources. - if ($source_rows == -1) { - $source_rows = dt('N/A'); - $unprocessed = dt('N/A'); - } - else { - $unprocessed = $source_rows - $map->processedCount(); - } - } - catch (Exception $e) { - drush_print($e->getMessage()); - drush_log(dt('Could not retrieve source count from @migration: @message', - ['@migration' => $migration_id, '@message' => $e->getMessage()])); - $source_rows = dt('N/A'); - $unprocessed = dt('N/A'); - } - - if ($names_only) { - $table[] = [$migration_id]; - } - else { - $status = $migration->getStatusLabel(); - $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported'); - $last_imported = $migrate_last_imported_store->get($migration->id(), FALSE); - if ($last_imported) { - /** @var DateFormatter $date_formatter */ - $date_formatter = \Drupal::service('date.formatter'); - $last_imported = $date_formatter->format($last_imported / 1000, - 'custom', 'Y-m-d H:i:s'); - } - else { - $last_imported = ''; - } - $table[] = [$migration_id, $status, $source_rows, $imported, $unprocessed, $last_imported]; - } - } - } - drush_print_table($table); -} - -/** - * @param string $migration_names - */ -function drush_migrate_tools_migrate_import($migration_names = '') { - $group_name = drush_get_option('group'); - $all = drush_get_option('all'); - $options = []; - if (!$all && !$group_name && !$migration_names) { - drush_set_error('MIGRATE_ERROR', dt('You must specify --all, --group, or one or more migration names separated by commas')); - return; - } - - foreach (['limit', 'feedback', 'idlist', 'update', 'force'] as $option) { - if (drush_get_option($option)) { - $options[$option] = drush_get_option($option); - } - } - - $migrations = drush_migrate_tools_migration_list($group_name, $migration_names); - - // Take it one group at a time, importing the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - array_walk($migration_list, '_drush_migrate_tools_execute_migration', $options); - } -} - -/** - * Executes a single migration. If the --execute-dependencies option was given, - * the migration's dependencies will also be executed first. - * - * @param \Drupal\migrate\Plugin\MigrationInterface $migration - * The migration to execute. - * @param string $migration_id - * The migration ID (not used, just an artifact of array_walk()). - * @param array $options - * Additional options for the migration. - */ -function _drush_migrate_tools_execute_migration(MigrationInterface $migration, $migration_id, array $options = []) { - $log = new DrushLogMigrateMessage(); - - if (drush_get_option('execute-dependencies')) { - if ($required_IDS = $migration->get('requirements')) { - $manager = \Drupal::service('plugin.manager.config_entity_migration'); - $required_migrations = $manager->createInstances($required_IDS); - $dependency_options = array_merge($options, ['is_dependency' => TRUE]); - array_walk($required_migrations, __FUNCTION__, $dependency_options); - } - } - if ($options['force']) { - $migration->set('requirements', []); - } - if ($options['update']) { - $migration->getIdMap()->prepareUpdate(); - } - $executable = new MigrateExecutable($migration, $log, $options); - // drush_op() provides --simulate support - drush_op(array($executable, 'import')); -} - -/** - * @param string $migration_names - */ -function drush_migrate_tools_migrate_rollback($migration_names = '') { - $group_name = drush_get_option('group'); - $all = drush_get_option('all'); - $options = []; - if (!$all && !$group_name && !$migration_names) { - drush_set_error('MIGRATE_ERROR', dt('You must specify --all, --group, or one or more migration names separated by commas')); - return; - } - - if (drush_get_option('feedback')) { - $options['feedback'] = drush_get_option('feedback'); - } - - $log = new DrushLogMigrateMessage(); - - $migrations = drush_migrate_tools_migration_list($group_name, $migration_names); - - // Take it one group at a time, rolling back the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - // Roll back in reverse order. - $migration_list = array_reverse($migration_list); - foreach ($migration_list as $migration_id => $migration) { - $executable = new MigrateExecutable($migration, $log, $options); - // drush_op() provides --simulate support. - drush_op(array($executable, 'rollback')); - } - } -} - -/** - * @param string $migration_id - */ -function drush_migrate_tools_migrate_stop($migration_id = '') { - /** @var MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration')->createInstance($migration_id); - if ($migration) { - $status = $migration->getStatus(); - switch ($status) { - case MigrationInterface::STATUS_IDLE: - drush_log(dt('Migration @id is idle', ['@id' => $migration_id]), 'warning'); - break; - case MigrationInterface::STATUS_DISABLED: - drush_log(dt('Migration @id is disabled', ['@id' => $migration_id]), 'warning'); - break; - case MigrationInterface::STATUS_STOPPING: - drush_log(dt('Migration @id is already stopping', ['@id' => $migration_id]), 'warning'); - break; - default: - $migration->interruptMigration(MigrationInterface::RESULT_STOPPED); - drush_log(dt('Migration @id requested to stop', ['@id' => $migration_id]), 'success'); - break; - } - } - else { - drush_log(dt('Migration @id does not exist', ['@id' => $migration_id]), 'error'); - } -} - -/** - * @param string $migration_id - */ -function drush_migrate_tools_migrate_reset_status($migration_id = '') { - /** @var MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration')->createInstance($migration_id); - if ($migration) { - $status = $migration->getStatus(); - if ($status == MigrationInterface::STATUS_IDLE) { - drush_log(dt('Migration @id is already Idle', ['@id' => $migration_id]), 'warning'); - } - else { - $migration->setStatus(MigrationInterface::STATUS_IDLE); - drush_log(dt('Migration @id reset to Idle', ['@id' => $migration_id]), 'status'); - } - } - else { - drush_log(dt('Migration @id does not exist', ['@id' => $migration_id]), 'error'); - } -} - -/** - * @param string $migration_id - */ -function drush_migrate_tools_migrate_messages($migration_id) { - /** @var MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration')->createInstance($migration_id); - if ($migration) { - $map = $migration->getIdMap(); - $first = TRUE; - $table = []; - foreach ($map->getMessageIterator() as $row) { - unset($row->msgid); - if ($first) { - // @todo: Ideally, replace sourceid* with source key names. Or, should - // getMessageIterator() do that? - foreach ($row as $column => $value) { - $table[0][] = $column; - } - $first = FALSE; - } - $table[] = (array)$row; - } - if (empty($table)) { - drush_log(dt('No messages for this migration'), 'status'); - } - else { - if (drush_get_option('csv')) { - foreach ($table as $row) { - fputcsv(STDOUT, $row); - } - } - else { - $widths = []; - foreach ($table[0] as $header) { - $widths[] = strlen($header) + 1; - } - drush_print_table($table, TRUE, $widths); - } - } - } - else { - drush_log(dt('Migration @id does not exist', ['@id' => $migration_id]), 'error'); - } -} - -/** - * @param string $migration_id - */ -function drush_migrate_tools_migrate_fields_source($migration_id) { - /** @var MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration')->createInstance($migration_id); - if ($migration) { - $source = $migration->getSourcePlugin(); - $table = []; - foreach ($source->fields() as $machine_name => $description) { - $table[] = [strip_tags($description), $machine_name]; - } - drush_print_table($table); - } - else { - drush_log(dt('Migration @id does not exist', ['@id' => $migration_id]), 'error'); - } -} - -/** - * Retrieve a list of active migrations. - * - * @param string $group_id - * Group machine name - if present, return only migrations in this group. - * @param string $migration_ids - * Comma-separated list of migrations - if present, return only these migrations. - * - * @return MigrationInterface[][] - * An array keyed by migration group, each value containing an array of migrations. - */ -function drush_migrate_tools_migration_list($group_id = '', $migration_ids = '') { - if (!empty($migration_ids)) { - $migration_ids = explode(',', Unicode::strtolower($migration_ids)); - } - else { - $migration_ids = []; - } - - $manager = \Drupal::service('plugin.manager.config_entity_migration'); - $plugins = $manager->createInstances([]); - $migrations = []; - foreach ($plugins as $id => $migration) { - $configured_group_id = $migration->get('migration_group'); - if (empty($configured_group_id)) { - $configured_group_id = 'default'; - } - if (empty($group_id) || $group_id == $configured_group_id) { - if (empty($migration_ids) || in_array(Unicode::strtolower($id), $migration_ids)) { - $migrations[$configured_group_id][$id] = $migration; - } - } - } - return $migrations; -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/migrate_tools.info.yml --- a/modules/contrib/migrate_tools/migrate_tools.info.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -type: module -name: Migrate Tools -description: 'Tools to assist in developing and running migrations.' -package: Migration -# core: 8.x -dependencies: - - system (>=8.1) - - migrate_plus - -# Information added by Drupal.org packaging script on 2016-05-05 -version: '8.x-2.0-beta1' -core: '8.x' -project: 'migrate_tools' -datestamp: 1462489459 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/migrate_tools.links.action.yml --- a/modules/contrib/migrate_tools/migrate_tools.links.action.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -migrate_tools.add_group_action: - route_name: entity.migration_group.add_form - title: 'Add migration group' - appears_on: - - entity.migration_group.list - -migrate_tools.add_migration_action: - route_name: entity.migration.add_form - title: 'Add migration' - appears_on: - - entity.migration.list diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/migrate_tools.links.menu.yml --- a/modules/contrib/migrate_tools/migrate_tools.links.menu.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -migrate_tools.menu: - title: Migrations - parent: system.admin_structure - description: Manage migration processes. - route_name: entity.migration_group.list diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/migrate_tools.module --- a/modules/contrib/migrate_tools/migrate_tools.module Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -set('admin_permission', 'administer migrations') - ->setHandlerClass('list_builder', 'Drupal\migrate_tools\Controller\MigrationListBuilder') -// ->setFormClass('add', 'Drupal\migrate_tools\Form\MigrationAddForm') - ->setFormClass('edit', 'Drupal\migrate_tools\Form\MigrationEditForm') - ->setFormClass('delete', 'Drupal\migrate_tools\Form\MigrationDeleteForm') -// ->setLinkTemplate('edit-form', '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}') - ->setLinkTemplate('list-form', '/admin/structure/migrate/manage/{migration_group}/migrations') -/* ->setLinkTemplate('delete-form', '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/delete')*/; - - $entity_types['migration_group'] - ->set('admin_permission', 'administer migrations') - ->setHandlerClass('list_builder', 'Drupal\migrate_tools\Controller\MigrationGroupListBuilder') - ->setFormClass('add', 'Drupal\migrate_tools\Form\MigrationGroupAddForm') - ->setFormClass('edit', 'Drupal\migrate_tools\Form\MigrationGroupEditForm') - ->setFormClass('delete', 'Drupal\migrate_tools\Form\MigrationGroupDeleteForm') - ->setLinkTemplate('edit-form', '/admin/structure/migrate/manage/{migration_group}') -/* ->setLinkTemplate('list-form', '/admin/structure/migrate/manage/{migration_group}/migrations')*/ - ->setLinkTemplate('delete-form', '/admin/structure/migrate/manage/{migration_group}/delete'); -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/migrate_tools.permissions.yml --- a/modules/contrib/migrate_tools/migrate_tools.permissions.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -'administer migrations': - title: 'Administer migrations' - description: Create, edit, and manage migration processed. diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/migrate_tools.routing.yml --- a/modules/contrib/migrate_tools/migrate_tools.routing.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -# This is the router item for listing all migration group entities. -entity.migration_group.list: - path: '/admin/structure/migrate' - defaults: - _entity_list: 'migration_group' - _title: 'Migrations' - requirements: - _permission: 'administer migrations' - -# This is the router item for adding our migration group entity. -entity.migration_group.add_form: - path: '/admin/structure/migrate/add' - defaults: - _title: 'Add migration group' - _entity_form: migration_group.add - requirements: - _entity_create_access: migration_group - -# This is the router item for editing our migration group entity. -entity.migration_group.edit_form: - path: '/admin/structure/migrate/manage/{migration_group}' - defaults: - _title: 'Edit migration group' - _entity_form: migration_group.edit - requirements: - _entity_access: migration_group.update - -# This is the router item for deleting an instance of our migration group entity. -entity.migration_group.delete_form: - path: '/admin/structure/migrate/manage/{migration_group}/delete' - defaults: - _title: 'Delete migration group' - _entity_form: migration_group.delete - requirements: - _entity_access: migration_group.delete - -# This is the router item for listing all migration entities. -entity.migration.list: - path: '/admin/structure/migrate/manage/{migration_group}/migrations' - defaults: - _entity_list: 'migration' - _title: 'Migrations' - requirements: - _permission: 'administer migrations' - -# This is the router item for adding our migration entity. -entity.migration.add_form: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/add' - defaults: - _title: 'Add migration' - _entity_form: migration.add - requirements: - _entity_create_access: migration - -# This is the router item for editing our migration entity. -entity.migration.edit_form: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}' - defaults: - _title: 'Edit migration' - _entity_form: migration.edit - requirements: - _entity_access: migration.update - -# This is the router item for deleting an instance of our migration entity. -entity.migration.delete_form: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/delete' - defaults: - _title: 'Delete migration' - _entity_form: migration.delete - requirements: - _entity_access: migration.delete - -migrate_tools.messages: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/messages' - defaults: - _controller: '\Drupal\migrate_tools\Controller\MessageController::overview' - _title: 'Messages' - requirements: - _permission: 'administer migrations' diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Controller/MessageController.php --- a/modules/contrib/migrate_tools/src/Controller/MessageController.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -get('database'), - $container->get('plugin.manager.config_entity_migration') - ); - } - - /** - * Constructs a MessageController object. - * - * @param \Drupal\Core\Database\Connection $database - * A database connection. - * @param \Drupal\migrate_plus\Plugin\MigrationConfigEntityPluginManager $migration_config_entity_plugin_manager - * The plugin manager for config entity-based migrations. - */ - public function __construct(Connection $database, MigrationConfigEntityPluginManager $migration_config_entity_plugin_manager) { - $this->database = $database; - $this->migrationConfigEntityPluginManager = $migration_config_entity_plugin_manager; - } - - /** - * Gets an array of log level classes. - * - * @return array - * An array of log level classes. - */ - public static function getLogLevelClassMap() { - return [ - MigrationInterface::MESSAGE_INFORMATIONAL => 'migrate-message-4', - MigrationInterface::MESSAGE_NOTICE => 'migrate-message-3', - MigrationInterface::MESSAGE_WARNING => 'migrate-message-2', - MigrationInterface::MESSAGE_ERROR => 'migrate-message-1', - ]; - } - - /** - * Displays a listing of migration messages. - * - * Messages are truncated at 56 chars. - * - * @param string $migration_group - * Machine name of the migration's group. - * - * @param string $migration - * Machine name of the migration. - * - * @return array - * A render array as expected by drupal_render(). - */ - public function overview($migration_group, $migration) { - $rows = []; - $classes = static::getLogLevelClassMap(); - /** @var MigrationInterface $migration */ - $migration = $this->migrationConfigEntityPluginManager->createInstance($migration); - $source_id_field_names = array_keys($migration->getSourcePlugin()->getIds()); - $column_number = 1; - foreach ($source_id_field_names as $source_id_field_name) { - $header[] = [ - 'data' => $source_id_field_name, - 'field' => 'sourceid' . $column_number++, - 'class' => [RESPONSIVE_PRIORITY_MEDIUM], - ]; - } - $header[] = [ - 'data' => $this->t('Severity level'), - 'field' => 'level', - 'class' => [RESPONSIVE_PRIORITY_LOW], - ]; - $header[] = [ - 'data' => $this->t('Message'), - 'field' => 'message', - ]; - - $message_table = $migration->getIdMap()->messageTableName(); - $map_table = $migration->getIdMap()->mapTableName(); - $query = $this->database->select($message_table, 'msg') - ->extend('\Drupal\Core\Database\Query\PagerSelectExtender') - ->extend('\Drupal\Core\Database\Query\TableSortExtender'); - $query->innerJoin($map_table, 'map', 'msg.source_ids_hash=map.source_ids_hash'); - $query->fields('msg'); - $query->fields('map'); - $result = $query - ->limit(50) - ->orderByHeader($header) - ->execute(); - - foreach ($result as $message_row) { - $column_number = 1; - foreach ($source_id_field_names as $source_id_field_name) { - $column_name = 'sourceid' . $column_number++; - $row[$column_name] = $message_row->$column_name; - } - $row['level'] = $message_row->level; - $row['message'] = $message_row->message; - $row['class'] = [Html::getClass('migrate-message-' . $message_row->level), $classes[$message_row->level]]; - $rows[] = $row; - } - - $build['message_table'] = [ - '#type' => 'table', - '#header' => $header, - '#rows' => $rows, - '#attributes' => ['id' => $message_table, 'class' => [$message_table]], - '#empty' => $this->t('No messages for this migration.'), - ]; - $build['message_pager'] = ['#type' => 'pager']; - - return $build; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Controller/MigrationGroupListBuilder.php --- a/modules/contrib/migrate_tools/src/Controller/MigrationGroupListBuilder.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -t('Migration Group'); - $header['machine_name'] = $this->t('Machine Name'); - $header['description'] = $this->t('Description'); - $header['source_type'] = $this->t('Source Type'); - return $header + parent::buildHeader(); - } - - /** - * Builds a row for an entity in the entity listing. - * - * @param EntityInterface $entity - * The entity for which to build the row. - * - * @return array - * A render array of the table row for displaying the entity. - * - * @see Drupal\Core\Entity\EntityListController::render() - */ - public function buildRow(EntityInterface $entity) { - $row['label'] = $entity->label(); - $row['machine_name'] = $entity->id(); - $row['description'] = $entity->get('description'); - $row['source_type'] = $entity->get('source_type'); - - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function getDefaultOperations(EntityInterface $entity) { - $operations = parent::getDefaultOperations($entity); - $operations['list'] = [ - 'title' => $this->t('List migrations'), - 'weight' => 0, - 'url' => Url::fromRoute('entity.migration.list', ['migration_group' => $entity->id()]), - ]; - - return $operations; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Controller/MigrationListBuilder.php --- a/modules/contrib/migrate_tools/src/Controller/MigrationListBuilder.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -currentRouteMatch = $current_route_match; - $this->migrationConfigEntityPluginManager = $migration_config_entity_plugin_manager; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), - $container->get('current_route_match'), - $container->get('plugin.manager.config_entity_migration') - ); - } - - /** - * Builds the header row for the entity listing. - * - * @return array - * A render array structure of header strings. - * - * @see Drupal\Core\Entity\EntityListController::render() - */ - public function buildHeader() { - $header['label'] = $this->t('Migration'); - $header['machine_name'] = $this->t('Machine Name'); - $header['status'] = $this->t('Status'); - $header['total'] = $this->t('Total'); - $header['imported'] = $this->t('Imported'); - $header['unprocessed'] = $this->t('Unprocessed'); - $header['messages'] = $this->t('Messages'); - $header['last_imported'] = $this->t('Last Imported'); - return $header; // + parent::buildHeader(); - } - - /** - * Builds a row for a migration plugin. - * - * @param \Drupal\Core\Entity\EntityInterface $migration - * The migration plugin for which to build the row. - * - * @return array - * A render array of the table row for displaying the plugin information. - * - * @see Drupal\Core\Entity\EntityListController::render() - */ - public function buildRow(EntityInterface $migration_entity) { - $migration = $this->migrationConfigEntityPluginManager->createInstance($migration_entity->id()); - $row['label'] = $migration->label(); - $row['machine_name'] = $migration->id(); - $row['status'] = $migration->getStatusLabel(); - - // Derive the stats. - $source_plugin = $migration->getSourcePlugin(); - $row['total'] = $source_plugin->count(); - $map = $migration->getIdMap(); - $row['imported'] = $map->importedCount(); - // -1 indicates uncountable sources. - if ($row['total'] == -1) { - $row['total'] = $this->t('N/A'); - $row['unprocessed'] = $this->t('N/A'); - } - else { - $row['unprocessed'] = $row['total'] - $map->processedCount(); - } - $migration_group = $migration->get('migration_group'); - if (!$migration_group) { - $migration_group = 'default'; - } - $route_parameters = array( - 'migration_group' => $migration_group, - 'migration' => $migration->id() - ); - $row['messages'] = array( - 'data' => array( - '#type' => 'link', - '#title' => $map->messageCount(), - '#url' => Url::fromRoute("migrate_tools.messages", $route_parameters), - ), - ); - $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported'); - $last_imported = $migrate_last_imported_store->get($migration->id(), FALSE); - if ($last_imported) { - /** @var DateFormatter $date_formatter */ - $date_formatter = \Drupal::service('date.formatter'); - $row['last_imported'] = $date_formatter->format($last_imported / 1000, - 'custom', 'Y-m-d H:i:s'); - } - else { - $row['last_imported'] = ''; - } - return $row + parent::buildRow($migration_entity); - } - - /** - * {@inheritdoc} - */ - public function getDefaultOperations(EntityInterface $entity) { - $operations = parent::getDefaultOperations($entity); - $migration_group = $entity->get('migration_group'); - if (!$migration_group) { - $migration_group = 'default'; - } -// $this->addGroupParameter($operations['edit']['url'], $migration_group); -// $this->addGroupParameter($operations['delete']['url'], $migration_group); - return $operations; - } - - /** - * @param \Drupal\Core\Url $url - * The URL associated with an operation. - * - * @param $migration_group - * The migration's parent group. - */ - protected function addGroupParameter(Url $url, $migration_group) { - if (!$migration_group) { - $migration_group = 'default'; - } - $route_parameters = $url->getRouteParameters() + ['migration_group' => $migration_group]; - $url->setRouteParameters($route_parameters); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/DrushLogMigrateMessage.php --- a/modules/contrib/migrate_tools/src/DrushLogMigrateMessage.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -t('Create Migration'); - unset($actions['submit']); - return $actions; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Form/MigrationDeleteForm.php --- a/modules/contrib/migrate_tools/src/Form/MigrationDeleteForm.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -t('Are you sure you want to delete migration %label?', array( - '%label' => $this->entity->label(), - )); - } - - /** - * Gather the confirmation text. - * - * @return string - * Translated string. - */ - public function getConfirmText() { - return $this->t('Delete Migration'); - } - - /** - * Gets the cancel URL. - * - * @return \Drupal\Core\Url - * The URL to go to if the user cancels the deletion. - */ - public function getCancelUrl() { - return new Url('entity.migration.list', array('migration_group' => $this->entity->get('migration_group'))); - } - - /** - * The submit handler for the confirm form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Delete the entity. - $this->entity->delete(); - - // Set a message that the entity was deleted. - drupal_set_message(t('Migration %label was deleted.', array( - '%label' => $this->entity->label(), - ))); - - // Redirect the user to the list controller when complete. - $form_state->setRedirectUrl($this->getCancelUrl(), - array('migration_group' => $this->entity->get('migration_group'))); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Form/MigrationEditForm.php --- a/modules/contrib/migrate_tools/src/Form/MigrationEditForm.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -addGroupParameter($actions['delete']['#url'], $this->getEntity()->get('migration_group')); - - return $actions; - } - - /** - * @param \Drupal\Core\Url $url - * The URL associated with an operation. - * - * @param $migration_group - * The migration's parent group. - */ - protected function addGroupParameter(Url $url, $migration_group) { - $route_parameters = $url->getRouteParameters() + array('migration_group' => $migration_group); - $url->setRouteParameters($route_parameters); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Form/MigrationFormBase.php --- a/modules/contrib/migrate_tools/src/Form/MigrationFormBase.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -entityQueryFactory = $query_factory; - } - - /** - * Factory method for MigrationFormBase. - * - * @param \Symfony\Component\DependencyInjection\ContainerInterface $container - * A container interface service. - * - * @return \Drupal\migrate_tools\Form\MigrationGroupFormBase - */ - public static function create(ContainerInterface $container) { - return new static($container->get('entity.query')); - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::form(). - * - * Builds the entity add/edit form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return array - * An associative array containing the migration add/edit form. - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Get anything we need from the base class. - $form = parent::buildForm($form, $form_state); - - /** @var MigrationInterface $migration */ - $migration = $this->entity; - - $form['warning'] = [ - '#markup' => $this->t('Creating migrations is not yet supported. See :url', [ - ':url' => 'https://www.drupal.org/node/2573241', - ]) - ]; - - // Build the form. - $form['label'] = array( - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#maxlength' => 255, - '#default_value' => $migration->label(), - '#required' => TRUE, - ); - $form['id'] = array( - '#type' => 'machine_name', - '#title' => $this->t('Machine name'), - '#default_value' => $migration->id(), - '#machine_name' => array( - 'exists' => array($this, 'exists'), - 'replace_pattern' => '([^a-z0-9_]+)|(^custom$)', - 'error' => 'The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores. Additionally, it can not be the reserved word "custom".', - ), - '#disabled' => !$migration->isNew(), - ); - - $groups = MigrationGroup::loadMultiple(); - $group_options = []; - foreach ($groups as $group) { - $group_options[$group->id()] = $group->label(); - } - if (!$migration->get('migration_group') && isset($group_options['default'])) { - $migration->set('migration_group', 'default'); - } - - $form['migration_group'] = array( - '#type' => 'select', - '#title' => $this->t('Migration Group'), - '#empty_value' => '', - '#default_value' => $migration->get('migration_group'), - '#options' => $group_options, - '#description' => $this->t('Assign this migration to an existing group.'), - ); - - return $form; - } - - /** - * Checks for an existing migration group. - * - * @param string|int $entity_id - * The entity ID. - * @param array $element - * The form element. - * @param FormStateInterface $form_state - * The form state. - * - * @return bool - * TRUE if this format already exists, FALSE otherwise. - */ - public function exists($entity_id, array $element, FormStateInterface $form_state) { - // Use the query factory to build a new migration entity query. - $query = $this->entityQueryFactory->get('migration'); - - // Query the entity ID to see if its in use. - $result = $query->condition('id', $element['#field_prefix'] . $entity_id) - ->execute(); - - // We don't need to return the ID, only if it exists or not. - return (bool) $result; - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::actions(). - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return array - * An array of supported actions for the current entity form. - */ - protected function actions(array $form, FormStateInterface $form_state) { - // Get the basic actins from the base class. - $actions = parent::actions($form, $form_state); - - // Change the submit button text. - $actions['submit']['#value'] = $this->t('Save'); - - // Return the result. - return $actions; - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::save(). - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return $this - */ - public function save(array $form, FormStateInterface $form_state) { - $migration = $this->getEntity(); - $status = $migration->save(); - - if ($status == SAVED_UPDATED) { - // If we edited an existing entity... - drupal_set_message($this->t('Migration %label has been updated.', array('%label' => $migration->label()))); - } - else { - // If we created a new entity... - drupal_set_message($this->t('Migration %label has been added.', array('%label' => $migration->label()))); - } - - // Redirect the user back to the listing route after the save operation. - $form_state->setRedirect('entity.migration.list', - array('migration_group' => $migration->get('migration_group'))); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Form/MigrationGroupAddForm.php --- a/modules/contrib/migrate_tools/src/Form/MigrationGroupAddForm.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -t('Create Migration Group'); - return $actions; - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Form/MigrationGroupDeleteForm.php --- a/modules/contrib/migrate_tools/src/Form/MigrationGroupDeleteForm.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -t('Are you sure you want to delete migration group %label?', array( - '%label' => $this->entity->label(), - )); - } - - /** - * Gather the confirmation text. - * - * @return string - * Translated string. - */ - public function getConfirmText() { - return $this->t('Delete Migration Group'); - } - - /** - * Gets the cancel URL. - * - * @return \Drupal\Core\Url - * The URL to go to if the user cancels the deletion. - */ - public function getCancelUrl() { - return new Url('entity.migration_group.list'); - } - - /** - * The submit handler for the confirm form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Delete the entity. - $this->entity->delete(); - - // Set a message that the entity was deleted. - drupal_set_message(t('Migration group %label was deleted.', array( - '%label' => $this->entity->label(), - ))); - - // Redirect the user to the list controller when complete. - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/Form/MigrationGroupEditForm.php --- a/modules/contrib/migrate_tools/src/Form/MigrationGroupEditForm.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -entityQueryFactory = $query_factory; - } - - /** - * Factory method for MigrationGroupFormBase. - * - * @param \Symfony\Component\DependencyInjection\ContainerInterface $container - * A container interface service. - * - * @return \Drupal\migrate_tools\Form\MigrationFormBase - * - */ - public static function create(ContainerInterface $container) { - return new static($container->get('entity.query')); - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::form(). - * - * Builds the entity add/edit form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return array - * An associative array containing the migration group add/edit form. - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Get anything we need from the base class. - $form = parent::buildForm($form, $form_state); - - /** @var MigrationGroupInterface $migration_group */ - $migration_group = $this->entity; - - // Build the form. - $form['label'] = array( - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#maxlength' => 255, - '#default_value' => $migration_group->label(), - '#required' => TRUE, - ); - $form['id'] = array( - '#type' => 'machine_name', - '#title' => $this->t('Machine name'), - '#default_value' => $migration_group->id(), - '#machine_name' => array( - 'exists' => array($this, 'exists'), - 'replace_pattern' => '([^a-z0-9_]+)|(^custom$)', - 'error' => 'The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores. Additionally, it can not be the reserved word "custom".', - ), - '#disabled' => !$migration_group->isNew(), - ); - $form['description'] = array( - '#type' => 'textfield', - '#title' => $this->t('Description'), - '#maxlength' => 255, - '#default_value' => $migration_group->get('description'), - ); - $form['source_type'] = array( - '#type' => 'textfield', - '#title' => $this->t('Source type'), - '#description' => $this->t('Type of source system the group is migrating from, for example "Drupal 6" or "WordPress 4".'), - '#maxlength' => 255, - '#default_value' => $migration_group->get('source_type'), - ); - - // Return the form. - return $form; - } - - /** - * Checks for an existing migration group. - * - * @param string|int $entity_id - * The entity ID. - * @param array $element - * The form element. - * @param FormStateInterface $form_state - * The form state. - * - * @return bool - * TRUE if this format already exists, FALSE otherwise. - */ - public function exists($entity_id, array $element, FormStateInterface $form_state) { - // Use the query factory to build a new migration group entity query. - $query = $this->entityQueryFactory->get('migration_group'); - - // Query the entity ID to see if its in use. - $result = $query->condition('id', $element['#field_prefix'] . $entity_id) - ->execute(); - - // We don't need to return the ID, only if it exists or not. - return (bool) $result; - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::actions(). - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return array - * An array of supported actions for the current entity form. - */ - protected function actions(array $form, FormStateInterface $form_state) { - // Get the basic actins from the base class. - $actions = parent::actions($form, $form_state); - - // Change the submit button text. - $actions['submit']['#value'] = $this->t('Save'); - - // Return the result. - return $actions; - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::save(). - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return $this - */ - public function save(array $form, FormStateInterface $form_state) { - $migration_group = $this->getEntity(); - $status = $migration_group->save(); - - if ($status == SAVED_UPDATED) { - // If we edited an existing entity... - drupal_set_message($this->t('Migration group %label has been updated.', array('%label' => $migration_group->label()))); - } - else { - // If we created a new entity... - drupal_set_message($this->t('Migration group %label has been added.', array('%label' => $migration_group->label()))); - } - - // Redirect the user back to the listing route after the save operation. - $form_state->setRedirect('entity.migration_group.list'); - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_tools/src/MigrateExecutable.php --- a/modules/contrib/migrate_tools/src/MigrateExecutable.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,355 +0,0 @@ - 0, - MigrateIdMapInterface::STATUS_IGNORED => 0, - MigrateIdMapInterface::STATUS_IMPORTED => 0, - MigrateIdMapInterface::STATUS_NEEDS_UPDATE => 0, - ); - - /** - * Counter of map deletions. - * - * @var int - */ - protected $deleteCounter = 0; - - /** - * Maximum number of items to process in this migration. 0 indicates no limit - * is to be applied. - * - * @var int - */ - protected $itemLimit = 0; - - /** - * Frequency (in items) at which progress messages should be emitted. - * - * @var int - */ - protected $feedback = 0; - - /** - * List of specific source IDs to import. - * - * @var array - */ - protected $idlist = []; - - /** - * Count of number of items processed so far in this migration. - * @var int - */ - protected $counter = 0; - - /** - * Whether the destination item exists before saving. - * - * @var bool - */ - protected $preExistingItem = FALSE; - - /** - * List of event listeners we have registered. - * - * @var array - */ - protected $listeners = []; - - /** - * {@inheritdoc} - */ - public function __construct(MigrationInterface $migration, MigrateMessageInterface $message, array $options = []) { - parent::__construct($migration, $message); - if (isset($options['limit'])) { - $this->itemLimit = $options['limit']; - } - if (isset($options['feedback'])) { - $this->feedback = $options['feedback']; - } - if (isset($options['idlist'])) { - $this->idlist = explode(',', $options['idlist']); - } - - $this->listeners[MigrateEvents::MAP_SAVE] = [$this, 'onMapSave']; - $this->listeners[MigrateEvents::MAP_DELETE] = [$this, 'onMapDelete']; - $this->listeners[MigrateEvents::POST_IMPORT] = [$this, 'onPostImport']; - $this->listeners[MigrateEvents::POST_ROLLBACK] = [$this, 'onPostRollback']; - $this->listeners[MigrateEvents::PRE_ROW_SAVE] = [$this, 'onPreRowSave']; - $this->listeners[MigrateEvents::POST_ROW_DELETE] = [$this, 'onPostRowDelete']; - $this->listeners[MigratePlusEvents::PREPARE_ROW] = [$this, 'onPrepareRow']; - foreach ($this->listeners as $event => $listener) { - \Drupal::service('event_dispatcher')->addListener($event, $listener); - } - } - - /** - * Count up any map save events. - * - * @param \Drupal\migrate\Event\MigrateMapSaveEvent $event - * The map event. - */ - public function onMapSave(MigrateMapSaveEvent $event) { - // Only count saves for this migration. - if ($event->getMap()->getQualifiedMapTableName() == $this->migration->getIdMap()->getQualifiedMapTableName()) { - $fields = $event->getFields(); - // Distinguish between creation and update. - if ($fields['source_row_status'] == MigrateIdMapInterface::STATUS_IMPORTED && - $this->preExistingItem - ) { - $this->saveCounters[MigrateIdMapInterface::STATUS_NEEDS_UPDATE]++; - } - else { - $this->saveCounters[$fields['source_row_status']]++; - } - } - } - - /** - * Count up any rollback events. - * - * @param \Drupal\migrate\Event\MigrateMapDeleteEvent $event - * The map event. - */ - public function onMapDelete(MigrateMapDeleteEvent $event) { - $this->deleteCounter++; - } - - /** - * Return the number of items created. - * - * @return int - */ - public function getCreatedCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_IMPORTED]; - } - - /** - * Return the number of items updated. - * - * @return int - */ - public function getUpdatedCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_NEEDS_UPDATE]; - } - - /** - * Return the number of items ignored. - * - * @return int - */ - public function getIgnoredCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_IGNORED]; - } - - /** - * Return the number of items that failed. - * - * @return int - */ - public function getFailedCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_FAILED]; - } - - /** - * Return the total number of items processed. Note that STATUS_NEEDS_UPDATE - * is not counted, since this is typically set on stubs created as side - * effects, not on the primary item being imported. - * - * @return int - */ - public function getProcessedCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_IMPORTED] + - $this->saveCounters[MigrateIdMapInterface::STATUS_NEEDS_UPDATE] + - $this->saveCounters[MigrateIdMapInterface::STATUS_IGNORED] + - $this->saveCounters[MigrateIdMapInterface::STATUS_FAILED]; - } - - /** - * Return the number of items rolled back. - * - * @return int - */ - public function getRollbackCount() { - return $this->deleteCounter; - } - - /** - * Reset all the per-status counters to 0. - */ - protected function resetCounters() { - foreach ($this->saveCounters as $status => $count) { - $this->saveCounters[$status] = 0; - } - $this->deleteCounter = 0; - } - - /** - * React to migration completion. - * - * @param \Drupal\migrate\Event\MigrateImportEvent $event - * The map event. - */ - public function onPostImport(MigrateImportEvent $event) { - $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported'); - $migrate_last_imported_store->set($event->getMigration()->id(), round(microtime(TRUE) * 1000)); - $this->progressMessage(); - $this->removeListeners(); - } - - /** - * Clean up all our event listeners. - */ - protected function removeListeners() { - foreach ($this->listeners as $event => $listener) { - \Drupal::service('event_dispatcher')->removeListener($event, $listener); - } - } - - /** - * Emit information on what we've done since the last feedback (or the - * beginning of this migration). - * - * @param bool $done - */ - protected function progressMessage($done = TRUE) { - $processed = $this->getProcessedCount(); - if ($done) { - $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'"; - $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'"; - } - else { - $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with '@name'"; - $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with '@name'"; - } - $this->message->display(\Drupal::translation()->formatPlural($processed, - $singular_message, $plural_message, - array('@numitems' => $processed, - '@created' => $this->getCreatedCount(), - '@updated' => $this->getUpdatedCount(), - '@failures' => $this->getFailedCount(), - '@ignored' => $this->getIgnoredCount(), - '@name' => $this->migration->id()))); - } - - /** - * React to rollback completion. - * - * @param \Drupal\migrate\Event\MigrateRollbackEvent $event - * The map event. - */ - public function onPostRollback(MigrateRollbackEvent $event) { - $this->rollbackMessage(); - $this->removeListeners(); - } - - /** - * Emit information on what we've done since the last feedback (or the - * beginning of this migration). - * - * @param bool $done - */ - protected function rollbackMessage($done = TRUE) { - $rolled_back = $this->getRollbackCount(); - if ($done) { - $singular_message = "Rolled back 1 item - done with '@name'"; - $plural_message = "Rolled back @numitems items - done with '@name'"; - } - else { - $singular_message = "Rolled back 1 item - continuing with '@name'"; - $plural_message = "Rolled back @numitems items - continuing with '@name'"; - } - $this->message->display(\Drupal::translation()->formatPlural($rolled_back, - $singular_message, $plural_message, - array('@numitems' => $rolled_back, - '@name' => $this->migration->id()))); - } - - /** - * React to an item about to be imported. - * - * @param \Drupal\migrate\Event\MigratePreRowSaveEvent $event - * The pre-save event. - */ - public function onPreRowSave(MigratePreRowSaveEvent $event) { - $id_map = $event->getRow()->getIdMap(); - if (!empty($id_map['destid1'])) { - $this->preExistingItem = TRUE; - } - else { - $this->preExistingItem = FALSE; - } - } - - /** - * React to item rollback. - * - * @param \Drupal\migrate\Event\MigrateRowDeleteEvent $event - * The post-save event. - */ - public function onPostRowDelete(MigrateRowDeleteEvent $event) { - if ($this->feedback && ($this->deleteCounter) && $this->deleteCounter % $this->feedback == 0) { - $this->rollbackMessage(FALSE); - $this->resetCounters(); - } - } - - /** - * React to a new row. - * - * @param \Drupal\migrate_plus\Event\MigratePrepareRowEvent $event - * The prepare-row event. - * - * @throws \Drupal\migrate\MigrateSkipRowException - * - */ - public function onPrepareRow(MigratePrepareRowEvent $event) { - if ($this->idlist) { - $row = $event->getRow(); - $source_id = $row->getSourceIdValues(); - if (!in_array(reset($source_id), $this->idlist)) { - throw new MigrateSkipRowException(NULL, FALSE); - } - } - if ($this->feedback && ($this->counter) && $this->counter % $this->feedback == 0) { - $this->progressMessage(FALSE); - $this->resetCounters(); - } - $this->counter++; - if ($this->itemLimit && $this->counter >= $this->itemLimit) { - $event->getMigration()->interruptMigration(MigrationInterface::RESULT_COMPLETED); - } - - } - -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_upgrade/LICENSE.txt --- a/modules/contrib/migrate_upgrade/LICENSE.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_upgrade/README.txt --- a/modules/contrib/migrate_upgrade/README.txt Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -The migrate_upgrade module provides drush support for performing upgrades from -previous versions of Drupal to Drupal 8. It implements two drush commands: - -* migrate-upgrade - performs a complete import of the source site's congiuration -and content into the target Drupal 8 site. Optionally, with the --configure-only -flag, it may create migration configurations for such an import without actually -running them, to permit customization of the import process. - -* migrate-upgrade-rollback - removes content and certain configuration -previously imported either by the migrate-upgrade command or by the core -upgrade UI. - -migrate-upgrade -=============== -The upgrade command requires a Drupal 6-style database URL of the source site's -database, and the location of the source site's public files. - -drush migrate-upgrade --legacy-db-url=mysql://user:pw@127.0.0.1/d6db --legacy-root=http://example.com - -The --legacy-root option may be either the domain of your existing Drupal site -(with the public files pulled by HTTP), or a local file directory into which you -have copied the files directory from your source site. - -If your source site used a database prefix for all tables, you may specify the -prefix with --legacy-db-prefix. Migration from sites with partial or mixed -prefixing is not supported. Note that if the source site is stored in a Postgres -schema, you must set the prefix to the schema with a period appended (e.g., ---legacy-db-prefix=drupal.). - -The migrate-upgrade command, like the core upgrade UI, is designed to be run on -a freshly installed and empty Drupal 8 site (where the only site configuration -that has been done is enabling any modules for which you wish to migrate data). - -migrate-upgrade-rollback -======================== - -The rollback command has no arguments or options: - -drush migrate-upgrade-rollback - -If it detects that an upgrade has been performed, either by migrate-upgrade or -by the core UI, it removes all content imported via the migration process (it -identifies the upgrade by the presence of the migrate_drupal_ui.performed state -key). In addition, any configuration entites created by the migration process -(such as content type and field definitions) are also removed. Because simple -configuration settings (such as the site title) are generally modified rather -than created by the upgrade process, and the original values are not preserved, -those changes are not rolled back. To completely return to the previous state, -you need to restore the site from backup, or reinstall a fresh empty site. - -migrate-upgrade --configure-only -================================ -At the time of this release, tools have not yet been developed (along the lines -of the migrate_d2d_ui module under Drupal 7) for customizing Drupal-to-Drupal -migrations in Drupal 8. For now, the best option short of doing custom -development is to use the --configure-only option on migrate-upgrade to replace -the actual execution of the migrations with export of their configuration to -configuration entities, which can then be modified as needed for a particular -migration scenario. A suggested workflow: - -1. Install a fresh empty D8 site, enabling all modules for which you wish to - migrate data. -2. Run the drush migrate-upgrade command with the --configure-only option. This - generates migration configuration entities in the D8 database (config table). -3. Create a custom module containing only a .info.yml file (with dependencies on - migrate_plus and migrate_drupal) and a config/install directory. -4. Export your site configuration, e.g. drush cex --destination=/tmp/export -5. Copy the migration configuration that was generated by migrate-upgrade into - the custom module - be sure *not* to copy the default group configuration, - which is defined by migrate_plus: - cp /tmp/export/migrate_plus.migration.* /tmp/export/migrate_plus.migration_group.migrate_*.yml migrate_custom/config/install/ -6. Look at that migrate_plus.migration_group.* file - you'll see your database - configuration captured there. In most cases, what you'll want to do is define - your database connection in settings.php with those credentials under the key - that is configured there - you won't want to commit the credentials to your - git repo. -7. Edit the generated .yml files to reflect your custom migration path. -8. Reinstall D8, enable your custom module and migrate_tools, and proceed to - work with your Drupal migrations as you would with any custom migration. - Hint: you'll probably want config_devel so you can edit .yml files in - config/install and immediately test your changes. - -Note that the configuration entities generated above need to be prefixed to -avoid conflict with the core migration plugins they originated from. For -example, by default the core d6_user plugin generates the upgrade_d6_user -configuration entity. You may modify the 'upgrade_' prefix by providing a ---migration-prefix option. diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_upgrade/migrate_upgrade.drush.inc --- a/modules/contrib/migrate_upgrade/migrate_upgrade.drush.inc Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ - 'Perform one or more upgrade processes.', - 'options' => [ - 'legacy-db-url' => 'A Drupal 6 style database URL. Required.', - 'legacy-db-prefix' => 'Prefix of the legacy Drupal installation.', - 'legacy-root' => 'Site address or root of the legacy Drupal installation', - 'configure-only' => 'Set up the appropriate upgrade processes but do not perform them', - 'migration-prefix' => 'With configure-only, a prefix to apply to generated migration ids. Defaults to \'upgrade_\'', - ], - 'examples' => [ - 'migrate-upgrade --legacy-db-url=\'mysql://root:pass@127.0.0.1/d6\'' => 'Upgrade a Drupal 6 database to Drupal 8', - 'migrate-upgrade --legacy-db-url=\'mysql://root:pass@127.0.0.1/d7\' --configure-only --migration-prefix=d7_custom_' => 'Generate migrations for a custom migration from Drupal 7 to Drupal 8', - ], - 'drupal dependencies' => ['migrate_upgrade'], - ]; - $items['migrate-upgrade-rollback'] = [ - 'description' => 'Rolls back and removes upgrade migrations.', - 'examples' => [ - 'migrate-upgrade-rollback' => 'Rolls back a previously-run upgrade', - ], - 'drupal dependencies' => ['migrate_upgrade'], - ]; - - return $items; -} - -/** - * Execute the upgrade command, configuring the necessary migrations and - * optionally perform the imports. - */ -function drush_migrate_upgrade() { - $runner = new MigrateUpgradeDrushRunner(); - - try { - $runner->configure(); - if (drush_get_option('configure-only')) { - $runner->export(); - } - else { - $runner->import(); - \Drupal::state()->set('migrate_drupal_ui.performed', REQUEST_TIME); - } - // Remove the global database state. - \Drupal::state()->delete('migrate.fallback_state_key'); - } - catch (\Exception $e) { - drush_log($e->getMessage(), 'error'); - } -} - -/** - * Rolls back any upgrade migrations that are present, and deletes the migrations - * themselves. - */ -function drush_migrate_upgrade_rollback() { - if ($date_performed = \Drupal::state()->get('migrate_drupal_ui.performed')) { - if (drush_confirm(dt('All migrations tagged as \'Drupal\' will be rolled back. Are you sure?'))) { - $runner = new MigrateUpgradeDrushRunner(); - - try { - drush_log(dt('Rolling back the upgrades performed @date', - ['@date' => \Drupal::service('date.formatter')->format($date_performed)])); - $runner->rollback(); - \Drupal::state()->delete('migrate_drupal_ui.performed'); - drush_log(dt('Rolled back upgrades')); - } - catch (\Exception $e) { - drush_log($e->getMessage(), 'error'); - } - } - else { - drush_user_abort(); - } - } - else { - drush_log(dt('No upgrade operation has been performed.'), 'warning'); - } -} diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_upgrade/migrate_upgrade.info.yml --- a/modules/contrib/migrate_upgrade/migrate_upgrade.info.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -name: Drupal Upgrade -type: module -description: 'Drush support for direct upgrades from older Drupal versions.' -package: Migration -# version: VERSION -# core: 8.x -dependencies: - - system (>=8.1) - - migrate - - migrate_drupal - - migrate_plus - - dblog - -# Information added by Drupal.org packaging script on 2016-04-14 -version: '8.x-2.0-beta1' -core: '8.x' -project: 'migrate_upgrade' -datestamp: 1460667540 diff -r bfffd8d7479a -r 7a779792577d modules/contrib/migrate_upgrade/src/DrushLogMigrateMessage.php --- a/modules/contrib/migrate_upgrade/src/DrushLogMigrateMessage.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -getConnection($db_spec); - $this->version = $this->getLegacyDrupalVersion($connection); - $this->createDatabaseStateSettings($db_spec, $this->version); - $this->databaseStateKey = 'migrate_drupal_' . $this->version; - $migrations = $this->getMigrations($this->databaseStateKey, $this->version); - $this->migrationList = []; - foreach ($migrations as $migration) { - $destination = $migration->get('destination'); - if ($destination['plugin'] === 'entity:file') { - // Make sure we have a single trailing slash. - $source_base_path = rtrim(drush_get_option('legacy-root'), '/') . '/'; - $destination['source_base_path'] = $source_base_path; - $migration->set('destination', $destination); - } - $this->migrationList[$migration->id()] = $migration; - } - } - - /** - * Run the configured migrations. - */ - public function import() { - static::$messages = new DrushLogMigrateMessage(); - if (drush_get_option('debug')) { - \Drupal::service('event_dispatcher')->addListener(MigrateEvents::IDMAP_MESSAGE, - [get_class(), 'onIdMapMessage']); - } - foreach ($this->migrationList as $migration_id => $migration) { - drush_print(dt('Upgrading @migration', ['@migration' => $migration_id])); - $executable = new MigrateExecutable($migration, static::$messages); - // drush_op() provides --simulate support. - drush_op([$executable, 'import']); - } - } - - /** - * Export the configured migration plugins as configuration entities. - */ - public function export() { - $db_info = \Drupal::state()->get($this->databaseStateKey); - - // Create a group to hold the database configuration. - $group = [ - 'id' => $this->databaseStateKey, - 'label' => 'Import from Drupal ' . $this->version, - 'description' => 'Migrations originally generated from drush migrate-upgrade --configure-only', - 'source_type' => 'Drupal ' . $this->version, - 'shared_configuration' => [ - 'source' => [ - 'key' => 'drupal_' . $this->version, - 'database' => $db_info['database'], - ] - ] - ]; - $group = MigrationGroup::create($group); - $group->save(); - foreach ($this->migrationList as $migration_id => $migration) { - drush_print(dt('Exporting @migration as @new_migration', - ['@migration' => $migration_id, '@new_migration' => $this->modifyId($migration_id)])); - $entity_array['id'] = $migration_id; - $entity_array['migration_group'] = $this->databaseStateKey; - $entity_array['migration_tags'] = $migration->get('migration_tags'); - $entity_array['label'] = $migration->get('label'); - $entity_array['source'] = $migration->getSourceConfiguration(); - $entity_array['destination'] = $migration->getDestinationConfiguration(); - $entity_array['process'] = $migration->get('process'); - $entity_array['migration_dependencies'] = $migration->getMigrationDependencies(); - $migration_entity = Migration::create($this->substituteIds($entity_array)); - $migration_entity->save(); - } - } - - /** - * Rewrite any migration plugin IDs so they won't conflict with the core - * IDs. - * - * @param $entity_array - * A configuration array for a migration. - * - * @return array - * The migration configuration array modified with new IDs. - */ - protected function substituteIds($entity_array) { - $entity_array['id'] = $this->modifyId($entity_array['id']); - foreach ($entity_array['migration_dependencies'] as $type => $dependencies) { - foreach ($dependencies as $key => $dependency) { - $entity_array['migration_dependencies'][$type][$key] = $this->modifyId($dependency); - } - } - foreach ($entity_array['process'] as $destination => $process) { - if (is_array($process)) { - if ($process['plugin'] == 'migration') { - $entity_array['process'][$destination]['migration'] = - $this->modifyId($process['migration']); - } - } - } - return $entity_array; - } - - /** - * @param $id - * The original core plugin ID. - * - * @return string - * The ID modified to serve as a configuration entity ID. - */ - protected function modifyId($id) { - return drush_get_option('migration-prefix', 'upgrade_') . str_replace(':', '_', $id); - } - - /** - * Rolls back the configured migrations. - */ - public function rollback() { - static::$messages = new DrushLogMigrateMessage(); - $database_state_key = \Drupal::state()->get('migrate.fallback_state_key'); - $database_state = \Drupal::state()->get($database_state_key); - $db_spec = $database_state['database']; - $connection = $this->getConnection($db_spec); - $version = $this->getLegacyDrupalVersion($connection); - $migrations = $this->getMigrations('migrate_drupal_' . $version, $version); - - // Roll back in reverse order. - $this->migrationList = array_reverse($migrations); - - foreach ($migrations as $migration) { - drush_print(dt('Rolling back @migration', ['@migration' => $migration->id()])); - $executable = new MigrateExecutable($migration, static::$messages); - // drush_op() provides --simulate support. - drush_op([$executable, 'rollback']); - } - } - - /** - * Display any messages being logged to the ID map. - * - * @param \Drupal\migrate\Event\MigrateIdMapMessageEvent $event - * The message event. - */ - public static function onIdMapMessage(MigrateIdMapMessageEvent $event) { - if ($event->getLevel() == MigrationInterface::MESSAGE_NOTICE || - $event->getLevel() == MigrationInterface::MESSAGE_INFORMATIONAL) { - $type = 'status'; - } - else { - $type = 'error'; - } - $source_id_string = implode(',', $event->getSourceIdValues()); - $message = t('Source ID @source_id: @message', - ['@source_id' => $source_id_string, '@message' => $event->getMessage()]); - static::$messages->display($message, $type); - } - -} diff -r bfffd8d7479a -r 7a779792577d vendor/asm89/stack-cors/README.md --- a/vendor/asm89/stack-cors/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/asm89/stack-cors/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -18,6 +18,24 @@ [stack middleware]: http://stackphp.com/ +### Options + +| Option | Description | Default value | +|------------------------|------------------------------------------------------------|---------------| +| allowedMethods | Matches the request method. | `array()` | +| allowedOrigins | Matches the request origin. | `array()` | +| allowedOriginsPatterns | Matches the request origin with `preg_match`. | `array()` | +| allowedHeaders | Sets the Access-Control-Allow-Headers response header. | `array()` | +| exposedHeaders | Sets the Access-Control-Expose-Headers response header. | `false` | +| maxAge | Sets the Access-Control-Max-Age response header. | `false` | +| supportsCredentials | Sets the Access-Control-Allow-Credentials header. | `false` | + +The _allowedMethods_ and _allowedHeaders_ options are case-insensitive. + +You don't need to provide both _allowedOrigins_ and _allowedOriginsPatterns_. If one of the strings passed matches, it is considered a valid origin. + +If `array('*')` is provided to _allowedMethods_, _allowedOrigins_ or _allowedHeaders_ all methods / origins / headers are allowed. + ### Example: using the library ```php @@ -26,12 +44,13 @@ use Asm89\Stack\CorsService; $cors = new CorsService(array( - 'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'), - 'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'), - 'allowedOrigins' => array('localhost'), - 'exposedHeaders' => false, - 'maxAge' => false, - 'supportsCredentials' => false, + 'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'), + 'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'), + 'allowedOrigins' => array('localhost'), + 'allowedOriginsPatterns' => array('/localhost:\d/'), + 'exposedHeaders' => false, + 'maxAge' => false, + 'supportsCredentials' => false, )); $cors->addActualRequestHeaders(Response $response, $origin); @@ -55,6 +74,8 @@ 'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'), // you can use array('*') to allow requests from any origin 'allowedOrigins' => array('localhost'), + // you can enter regexes that are matched to the origin request header + 'allowedOriginsPatterns' => array('/localhost:\d/'), 'exposedHeaders' => false, 'maxAge' => false, 'supportsCredentials' => false, diff -r bfffd8d7479a -r 7a779792577d vendor/asm89/stack-cors/composer.json --- a/vendor/asm89/stack-cors/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/asm89/stack-cors/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -13,8 +13,8 @@ ], "require": { "php": ">=5.5.9", - "symfony/http-foundation": "~2.7|~3.0", - "symfony/http-kernel": "~2.7|~3.0" + "symfony/http-foundation": "~2.7|~3.0|~4.0", + "symfony/http-kernel": "~2.7|~3.0|~4.0" }, "require-dev": { "phpunit/phpunit": "^5.0 || ^4.8.10", @@ -37,7 +37,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php --- a/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,12 +28,13 @@ private $cors; private $defaultOptions = array( - 'allowedHeaders' => array(), - 'allowedMethods' => array(), - 'allowedOrigins' => array(), - 'exposedHeaders' => false, - 'maxAge' => false, - 'supportsCredentials' => false, + 'allowedHeaders' => array(), + 'allowedMethods' => array(), + 'allowedOrigins' => array(), + 'allowedOriginsPatterns' => array(), + 'exposedHeaders' => false, + 'maxAge' => false, + 'supportsCredentials' => false, ); public function __construct(HttpKernelInterface $app, array $options = array()) diff -r bfffd8d7479a -r 7a779792577d vendor/asm89/stack-cors/src/Asm89/Stack/CorsService.php --- a/vendor/asm89/stack-cors/src/Asm89/Stack/CorsService.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/asm89/stack-cors/src/Asm89/Stack/CorsService.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,6 +28,7 @@ { $options += array( 'allowedOrigins' => array(), + 'allowedOriginsPatterns' => array(), 'supportsCredentials' => false, 'allowedHeaders' => array(), 'exposedHeaders' => array(), @@ -176,7 +177,17 @@ } $origin = $request->headers->get('Origin'); - return in_array($origin, $this->options['allowedOrigins']); + if (in_array($origin, $this->options['allowedOrigins'])) { + return true; + } + + foreach ($this->options['allowedOriginsPatterns'] as $pattern) { + if (preg_match($pattern, $origin)) { + return true; + } + } + + return false; } private function checkMethod(Request $request) diff -r bfffd8d7479a -r 7a779792577d vendor/behat/mink/composer.json --- a/vendor/behat/mink/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/behat/mink/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -16,11 +16,11 @@ "require": { "php": ">=5.3.1", - "symfony/css-selector": "~2.1|~3.0" + "symfony/css-selector": "^2.7|^3.0|^4.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" + "symfony/phpunit-bridge": "^3.3|^4.0" }, "suggest": { diff -r bfffd8d7479a -r 7a779792577d vendor/behat/mink/src/Selector/NamedSelector.php --- a/vendor/behat/mink/src/Selector/NamedSelector.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/behat/mink/src/Selector/NamedSelector.php Fri Feb 23 15:52:07 2018 +0000 @@ -199,11 +199,11 @@ */ public function translateToXPath($locator) { - if (2 < count($locator)) { - throw new \InvalidArgumentException('NamedSelector expects array(name, locator) as argument'); - } + if (\is_array($locator)) { + if (2 !== \count($locator)) { + throw new \InvalidArgumentException('NamedSelector expects array(name, locator) as argument'); + } - if (2 == count($locator)) { $selector = $locator[0]; $locator = $locator[1]; } else { diff -r bfffd8d7479a -r 7a779792577d vendor/behat/mink/src/WebAssert.php --- a/vendor/behat/mink/src/WebAssert.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/behat/mink/src/WebAssert.php Fri Feb 23 15:52:07 2018 +0000 @@ -319,10 +319,9 @@ public function responseContains($text) { $actual = $this->session->getPage()->getContent(); - $regex = '/'.preg_quote($text, '/').'/ui'; $message = sprintf('The string "%s" was not found anywhere in the HTML response of the current page.', $text); - $this->assert((bool) preg_match($regex, $actual), $message); + $this->assert(stripos($actual, $text) !== false, $message); } /** @@ -335,10 +334,9 @@ public function responseNotContains($text) { $actual = $this->session->getPage()->getContent(); - $regex = '/'.preg_quote($text, '/').'/ui'; $message = sprintf('The string "%s" appears in the HTML response of this page, but it should not.', $text); - $this->assert(!preg_match($regex, $actual), $message); + $this->assert(stripos($actual, $text) === false, $message); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/composer/autoload_classmap.php --- a/vendor/composer/autoload_classmap.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/autoload_classmap.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,6 +35,7 @@ 'Generic_Sniffs_ControlStructures_InlineControlStructureSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php', 'Generic_Sniffs_Debug_CSSLintSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/CSSLintSniff.php', 'Generic_Sniffs_Debug_ClosureLinterSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php', + 'Generic_Sniffs_Debug_ESLintSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/ESLintSniff.php', 'Generic_Sniffs_Debug_JSHintSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/JSHintSniff.php', 'Generic_Sniffs_Files_ByteOrderMarkSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php', 'Generic_Sniffs_Files_EndFileNewlineSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php', diff -r bfffd8d7479a -r 7a779792577d vendor/composer/autoload_files.php --- a/vendor/composer/autoload_files.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/autoload_files.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,7 +13,6 @@ '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 'e7223560d890eab89cda23685e711e2c' => $vendorDir . '/psy/psysh/src/Psy/functions.php', + 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', - 'e40631d46120a9c38ea139981f8dab26' => $vendorDir . '/ircmaxell/password-compat/lib/password.php', ); diff -r bfffd8d7479a -r 7a779792577d vendor/composer/autoload_namespaces.php --- a/vendor/composer/autoload_namespaces.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/autoload_namespaces.php Fri Feb 23 15:52:07 2018 +0000 @@ -6,7 +6,6 @@ $baseDir = dirname($vendorDir); return array( - 'phpDocumentor' => array($vendorDir . '/phpdocumentor/reflection-docblock/src'), 'org\\bovigo\\vfs\\' => array($vendorDir . '/mikey179/vfsStream/src/main/php'), 'Twig_' => array($vendorDir . '/twig/twig/lib'), 'Stack' => array($vendorDir . '/stack/builder/src'), @@ -17,8 +16,6 @@ 'EasyRdf_' => array($vendorDir . '/easyrdf/easyrdf/lib'), 'Drush' => array($vendorDir . '/drush/drush/lib'), 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'), - 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'), 'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'), - 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib'), 'Consolidation' => array($vendorDir . '/drush/drush/lib'), ); diff -r bfffd8d7479a -r 7a779792577d vendor/composer/autoload_psr4.php --- a/vendor/composer/autoload_psr4.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/autoload_psr4.php Fri Feb 23 15:52:07 2018 +0000 @@ -6,6 +6,7 @@ $baseDir = dirname($vendorDir); return array( + 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'), 'Zumba\\Mink\\Driver\\' => array($vendorDir . '/jcalderonzumba/mink-phantomjs-driver/src'), 'Zumba\\GastonJS\\' => array($vendorDir . '/jcalderonzumba/gastonjs/src'), 'Zend\\Stdlib\\' => array($vendorDir . '/zendframework/zend-stdlib/src'), @@ -16,6 +17,7 @@ 'Wikimedia\\Composer\\' => array($vendorDir . '/wikimedia/composer-merge-plugin/src'), 'Webmozart\\PathUtil\\' => array($vendorDir . '/webmozart/path-util/src'), 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), + 'Twig\\' => array($vendorDir . '/twig/twig/src'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Polyfill\\Iconv\\' => array($vendorDir . '/symfony/polyfill-iconv'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), @@ -48,12 +50,14 @@ 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'Goutte\\' => array($vendorDir . '/fabpot/goutte/Goutte'), - 'Drupal\\Driver\\' => array($baseDir . '/drivers/lib/Drupal/Driver'), + 'Drupal\\Driver\\' => array($baseDir . '/drivers/lib/Drupal/Driver', $baseDir . '/drivers/lib/Drupal/Driver'), 'Drupal\\Core\\Composer\\' => array($baseDir . '/core/lib/Drupal/Core/Composer'), - 'Drupal\\Core\\' => array($baseDir . '/core/lib/Drupal/Core'), - 'Drupal\\Component\\' => array($baseDir . '/core/lib/Drupal/Component'), + 'Drupal\\Core\\' => array($baseDir . '/core/lib/Drupal/Core', $baseDir . '/core/lib/Drupal/Core'), + 'Drupal\\Component\\' => array($baseDir . '/core/lib/Drupal/Component', $baseDir . '/core/lib/Drupal/Component'), 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), + 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'), 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'), + 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'), 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib/Doctrine/Common'), 'Consolidation\\OutputFormatters\\' => array($vendorDir . '/consolidation/output-formatters/src'), 'Consolidation\\AnnotatedCommand\\' => array($vendorDir . '/consolidation/annotated-command/src'), diff -r bfffd8d7479a -r 7a779792577d vendor/composer/autoload_static.php --- a/vendor/composer/autoload_static.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/autoload_static.php Fri Feb 23 15:52:07 2018 +0000 @@ -14,12 +14,15 @@ '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 'e7223560d890eab89cda23685e711e2c' => __DIR__ . '/..' . '/psy/psysh/src/Psy/functions.php', + 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', - 'e40631d46120a9c38ea139981f8dab26' => __DIR__ . '/..' . '/ircmaxell/password-compat/lib/password.php', ); public static $prefixLengthsPsr4 = array ( + 'p' => + array ( + 'phpDocumentor\\Reflection\\' => 25, + ), 'Z' => array ( 'Zumba\\Mink\\Driver\\' => 18, @@ -39,6 +42,10 @@ 'Webmozart\\PathUtil\\' => 19, 'Webmozart\\Assert\\' => 17, ), + 'T' => + array ( + 'Twig\\' => 5, + ), 'S' => array ( 'Symfony\\Polyfill\\Mbstring\\' => 26, @@ -90,7 +97,9 @@ 'Drupal\\Core\\' => 12, 'Drupal\\Component\\' => 17, 'Doctrine\\Instantiator\\' => 22, + 'Doctrine\\Common\\Inflector\\' => 26, 'Doctrine\\Common\\Cache\\' => 22, + 'Doctrine\\Common\\Annotations\\' => 28, 'Doctrine\\Common\\' => 16, ), 'C' => @@ -112,6 +121,12 @@ ); public static $prefixDirsPsr4 = array ( + 'phpDocumentor\\Reflection\\' => + array ( + 0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src', + 1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src', + 2 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src', + ), 'Zumba\\Mink\\Driver\\' => array ( 0 => __DIR__ . '/..' . '/jcalderonzumba/mink-phantomjs-driver/src', @@ -152,6 +167,10 @@ array ( 0 => __DIR__ . '/..' . '/webmozart/assert/src', ), + 'Twig\\' => + array ( + 0 => __DIR__ . '/..' . '/twig/twig/src', + ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', @@ -283,6 +302,7 @@ 'Drupal\\Driver\\' => array ( 0 => __DIR__ . '/../..' . '/drivers/lib/Drupal/Driver', + 1 => __DIR__ . '/../..' . '/drivers/lib/Drupal/Driver', ), 'Drupal\\Core\\Composer\\' => array ( @@ -291,19 +311,29 @@ 'Drupal\\Core\\' => array ( 0 => __DIR__ . '/../..' . '/core/lib/Drupal/Core', + 1 => __DIR__ . '/../..' . '/core/lib/Drupal/Core', ), 'Drupal\\Component\\' => array ( 0 => __DIR__ . '/../..' . '/core/lib/Drupal/Component', + 1 => __DIR__ . '/../..' . '/core/lib/Drupal/Component', ), 'Doctrine\\Instantiator\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator', ), + 'Doctrine\\Common\\Inflector\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector', + ), 'Doctrine\\Common\\Cache\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache', ), + 'Doctrine\\Common\\Annotations\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/annotations/lib/Doctrine/Common/Annotations', + ), 'Doctrine\\Common\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/common/lib/Doctrine/Common', @@ -340,13 +370,6 @@ ); public static $prefixesPsr0 = array ( - 'p' => - array ( - 'phpDocumentor' => - array ( - 0 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src', - ), - ), 'o' => array ( 'org\\bovigo\\vfs\\' => @@ -407,18 +430,10 @@ array ( 0 => __DIR__ . '/..' . '/doctrine/lexer/lib', ), - 'Doctrine\\Common\\Inflector\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/inflector/lib', - ), 'Doctrine\\Common\\Collections\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/collections/lib', ), - 'Doctrine\\Common\\Annotations\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/annotations/lib', - ), ), 'C' => array ( @@ -459,6 +474,7 @@ 'Generic_Sniffs_ControlStructures_InlineControlStructureSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php', 'Generic_Sniffs_Debug_CSSLintSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/CSSLintSniff.php', 'Generic_Sniffs_Debug_ClosureLinterSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php', + 'Generic_Sniffs_Debug_ESLintSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/ESLintSniff.php', 'Generic_Sniffs_Debug_JSHintSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/JSHintSniff.php', 'Generic_Sniffs_Files_ByteOrderMarkSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php', 'Generic_Sniffs_Files_EndFileNewlineSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php', diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installed.json --- a/vendor/composer/installed.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installed.json Fri Feb 23 15:52:07 2018 +0000 @@ -1,17 +1,1882 @@ [ { + "name": "wikimedia/composer-merge-plugin", + "version": "v1.4.1", + "version_normalized": "1.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/composer-merge-plugin.git", + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": ">=5.3.2" + }, + "require-dev": { + "composer/composer": "~1.0.0", + "jakub-onderka/php-parallel-lint": "~0.8", + "phpunit/phpunit": "~4.8|~5.0", + "squizlabs/php_codesniffer": "~2.1.0" + }, + "time": "2017-04-25T02:31:25+00:00", + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + }, + "class": "Wikimedia\\Composer\\MergePlugin" + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Wikimedia\\Composer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bryan Davis", + "email": "bd808@wikimedia.org" + } + ], + "description": "Composer plugin to merge multiple composer.json files" + }, + { + "name": "psr/log", + "version": "1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-10-10T12:19:37+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ] + }, + { + "name": "composer/semver", + "version": "1.4.2", + "version_normalized": "1.4.2.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "time": "2016-08-30T16:08:34+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ] + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "time": "2014-09-09T13:34:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ] + }, + { + "name": "easyrdf/easyrdf", + "version": "0.9.1", + "version_normalized": "0.9.1.0", + "source": { + "type": "git", + "url": "https://github.com/njh/easyrdf.git", + "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/njh/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566", + "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-pcre": "*", + "php": ">=5.2.8" + }, + "require-dev": { + "phpunit/phpunit": "~3.5", + "sami/sami": "~1.4", + "squizlabs/php_codesniffer": "~1.4.3" + }, + "suggest": { + "ml/json-ld": "~1.0" + }, + "time": "2015-02-27T09:45:49+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "EasyRdf_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nicholas Humfrey", + "email": "njh@aelius.com", + "homepage": "http://www.aelius.com/njh/", + "role": "Developer" + }, + { + "name": "Alexey Zakhlestin", + "email": "indeyets@gmail.com", + "role": "Developer" + } + ], + "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", + "homepage": "http://www.easyrdf.org/", + "keywords": [ + "Linked Data", + "RDF", + "Semantic Web", + "Turtle", + "rdfa", + "sparql" + ] + }, + { + "name": "egulias/email-validator", + "version": "1.2.14", + "version_normalized": "1.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "5642614492f0ca2064c01d60cc33284cc2f731a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/5642614492f0ca2064c01d60cc33284cc2f731a9", + "reference": "5642614492f0ca2064c01d60cc33284cc2f731a9", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^1.0.1", + "php": ">= 5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.24" + }, + "time": "2017-02-03T22:48:59+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Egulias\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ] + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "version_normalized": "1.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "time": "2016-12-20T10:07:11+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ] + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-08-06T14:39:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ] + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "version_normalized": "1.4.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2017-03-20T17:10:46+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ] + }, + { + "name": "masterminds/html5", + "version": "2.3.0", + "version_normalized": "2.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "2c37c6c520b995b761674de3be8455a381679067" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/2c37c6c520b995b761674de3be8455a381679067", + "reference": "2c37c6c520b995b761674de3be8455a381679067", + "shasum": "" + }, + "require": { + "ext-libxml": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "sami/sami": "~2.0", + "satooshi/php-coveralls": "1.0.*" + }, + "time": "2017-09-04T12:26:28+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ] + }, + { + "name": "symfony-cmf/routing", + "version": "1.4.1", + "version_normalized": "1.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony-cmf/routing.git", + "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony-cmf/routing/zipball/fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac", + "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac", + "shasum": "" + }, + "require": { + "php": "^5.3.9|^7.0", + "psr/log": "1.*", + "symfony/http-kernel": "^2.2|3.*", + "symfony/routing": "^2.2|3.*" + }, + "require-dev": { + "friendsofsymfony/jsrouting-bundle": "^1.1", + "symfony-cmf/testing": "^1.3", + "symfony/config": "^2.2|3.*", + "symfony/dependency-injection": "^2.0.5|3.*", + "symfony/event-dispatcher": "^2.1|3.*" + }, + "suggest": { + "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version (~2.1)" + }, + "time": "2017-05-09T08:10:41+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Cmf\\Component\\Routing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony CMF Community", + "homepage": "https://github.com/symfony-cmf/Routing/contributors" + } + ], + "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers", + "homepage": "http://cmf.symfony.com", + "keywords": [ + "database", + "routing" + ] + }, + { + "name": "zendframework/zend-escaper", + "version": "2.5.2", + "version_normalized": "2.5.2.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-escaper.git", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "time": "2016-06-30T19:48:38+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zend\\Escaper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-escaper", + "keywords": [ + "escaper", + "zf2" + ] + }, + { + "name": "behat/mink", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "04ab7af68536ac2c80fd6c08a6fd3620d3409891" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/04ab7af68536ac2c80fd6c08a6fd3620d3409891", + "reference": "04ab7af68536ac2c80fd6c08a6fd3620d3409891", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "^2.7|^3.0|^4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3|^4.0" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + "time": "2018-01-07T17:25:05+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Browser controller/emulator abstraction for PHP", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ] + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.0", + "version_normalized": "6.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "time": "2017-06-22T18:50:49+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ] + }, + { + "name": "behat/mink-browserkit-driver", + "version": "v1.3.2", + "version_normalized": "1.3.2.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", + "reference": "10e67fb4a295efcd62ea0bf16025a85ea19534fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/10e67fb4a295efcd62ea0bf16025a85ea19534fb", + "reference": "10e67fb4a295efcd62ea0bf16025a85ea19534fb", + "shasum": "" + }, + "require": { + "behat/mink": "^1.7.1@dev", + "php": ">=5.3.6", + "symfony/browser-kit": "~2.3|~3.0", + "symfony/dom-crawler": "~2.3|~3.0" + }, + "require-dev": { + "silex/silex": "~1.2", + "symfony/phpunit-bridge": "~2.7|~3.0" + }, + "time": "2016-03-05T08:59:47+00:00", + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Symfony2 BrowserKit driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "Mink", + "Symfony2", + "browser", + "testing" + ] + }, + { + "name": "behat/mink-goutte-driver", + "version": "v1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkGoutteDriver.git", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "shasum": "" + }, + "require": { + "behat/mink": "~1.6@dev", + "behat/mink-browserkit-driver": "~1.2@dev", + "fabpot/goutte": "~1.0.4|~2.0|~3.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7|~3.0" + }, + "time": "2016-03-05T09:04:22+00:00", + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Goutte driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "goutte", + "headless", + "testing" + ] + }, + { + "name": "drupal/coder", + "version": "8.2.12", + "version_normalized": "8.2.12.0", + "source": { + "type": "git", + "url": "https://git.drupal.org/project/coder.git", + "reference": "984c54a7b1e8f27ff1c32348df69712afd86b17f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/klausi/coder/zipball/984c54a7b1e8f27ff1c32348df69712afd86b17f", + "reference": "984c54a7b1e8f27ff1c32348df69712afd86b17f", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.4.0", + "squizlabs/php_codesniffer": ">=2.8.1 <3.0", + "symfony/yaml": ">=2.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=3.7 <6" + }, + "time": "2017-03-18T10:28:49+00:00", + "type": "phpcodesniffer-standard", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "Coder is a library to review Drupal code.", + "homepage": "https://www.drupal.org/project/coder", + "keywords": [ + "code review", + "phpcs", + "standards" + ] + }, + { + "name": "mikey179/vfsStream", + "version": "v1.6.5", + "version_normalized": "1.6.5.0", + "source": { + "type": "git", + "url": "https://github.com/mikey179/vfsStream.git", + "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.5" + }, + "time": "2017-08-01T08:02:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "org\\bovigo\\vfs\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Frank Kleine", + "homepage": "http://frankkleine.de/", + "role": "Developer" + } + ], + "description": "Virtual file system to mock the real file system in unit tests.", + "homepage": "http://vfs.bovigo.org/" + }, + { + "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-21T13:59:46+00:00", + "type": "library", + "installation-source": "dist", + "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" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "time": "2015-10-12T03:26:01+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ] + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "version_normalized": "1.0.5.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "time": "2016-10-03T07:41:43+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "version_normalized": "1.2.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "time": "2016-06-17T09:04:28+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "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" + ] + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "version_normalized": "1.3.8.0", + "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" + }, + "time": "2016-08-18T05:49:44+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "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" + ] + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "version_normalized": "1.2.4.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "time": "2017-01-29T09:50:25+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ] + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "version_normalized": "1.2.1.0", + "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" + }, + "time": "2015-06-21T13:50:34+00:00", + "type": "library", + "installation-source": "dist", + "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" + ] + }, + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "version_normalized": "1.0.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "time": "2015-06-14T21:17:01+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ] + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "version_normalized": "2.3.8.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "time": "2015-10-02T06:51:40+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "installation-source": "dist", + "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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ] + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "version_normalized": "1.0.9.0", + "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" + }, + "time": "2017-02-26T11:10:40+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "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" + ] + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "version_normalized": "2.2.4.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "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.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "time": "2015-10-06T15:47:00+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "installation-source": "dist", + "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" + ] + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "version_normalized": "4.8.36.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.2.2", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "time": "2017-06-21T08:07:12+00:00", + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ] + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "version_normalized": "2.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "time": "2015-12-17T08:42:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths." + }, + { + "name": "jakub-onderka/php-console-color", + "version": "0.1", + "version_normalized": "0.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", + "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1", + "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "jakub-onderka/php-code-style": "1.0", + "jakub-onderka/php-parallel-lint": "0.*", + "jakub-onderka/php-var-dump-check": "0.*", + "phpunit/phpunit": "3.7.*", + "squizlabs/php_codesniffer": "1.*" + }, + "time": "2014-04-08T15:00:19+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "JakubOnderka\\PhpConsoleColor": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com", + "homepage": "http://www.acci.cz" + } + ] + }, + { + "name": "jakub-onderka/php-console-highlighter", + "version": "v0.3.2", + "version_normalized": "0.3.2.0", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", + "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", + "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", + "shasum": "" + }, + "require": { + "jakub-onderka/php-console-color": "~0.1", + "php": ">=5.3.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "~1.0", + "jakub-onderka/php-parallel-lint": "~0.5", + "jakub-onderka/php-var-dump-check": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "time": "2015-04-20T18:58:01+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "JakubOnderka\\PhpConsoleHighlighter": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "acci@acci.cz", + "homepage": "http://www.acci.cz/" + } + ] + }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "0.1", + "version_normalized": "0.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", + "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "@stable" + }, + "time": "2014-10-24T07:27:01+00:00", + "type": "project", + "installation-source": "dist", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php" + }, + { "name": "composer/installers", - "version": "v1.4.0", - "version_normalized": "1.4.0.0", + "version": "v1.5.0", + "version_normalized": "1.5.0.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b" + "reference": "049797d727261bf27f2690430d935067710049c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", - "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", + "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2", + "reference": "049797d727261bf27f2690430d935067710049c2", "shasum": "" }, "require": { @@ -23,9 +1888,9 @@ }, "require-dev": { "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" - }, - "time": "2017-08-09T07:53:48+00:00", + "phpunit/phpunit": "^4.8.36" + }, + "time": "2017-12-29T09:13:20+00:00", "type": "composer-plugin", "extra": { "class": "Composer\\Installers\\Plugin", @@ -96,15 +1961,18 @@ "lavalite", "lithium", "magento", + "majima", "mako", "mediawiki", "modulework", + "modx", "moodle", "osclass", "phpbb", "piwik", "ppi", "puppet", + "pxcms", "reindex", "roundcube", "shopware", @@ -119,42 +1987,38 @@ ] }, { - "name": "wikimedia/composer-merge-plugin", - "version": "v1.4.1", - "version_normalized": "1.4.1.0", + "name": "webmozart/assert", + "version": "1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", - "url": "https://github.com/wikimedia/composer-merge-plugin.git", - "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100" + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100", - "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": ">=5.3.2" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "composer/composer": "~1.0.0", - "jakub-onderka/php-parallel-lint": "~0.8", - "phpunit/phpunit": "~4.8|~5.0", - "squizlabs/php_codesniffer": "~2.1.0" - }, - "time": "2017-04-25T02:31:25+00:00", - "type": "composer-plugin", + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "time": "2018-01-29T19:49:41+00:00", + "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" - }, - "class": "Wikimedia\\Composer\\MergePlugin" + "dev-master": "1.3-dev" + } }, "installation-source": "dist", "autoload": { "psr-4": { - "Wikimedia\\Composer\\": "src/" + "Webmozart\\Assert\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -163,25 +2027,87 @@ ], "authors": [ { - "name": "Bryan Davis", - "email": "bd808@wikimedia.org" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Composer plugin to merge multiple composer.json files" + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ] + }, + { + "name": "symfony/yaml", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "78a0c5d7d43713212aac73d7c6a56754a5c26cea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/78a0c5d7d43713212aac73d7c6a56754a5c26cea", + "reference": "78a0c5d7d43713212aac73d7c6a56754a5c26cea", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "time": "2017-06-02T09:43:35+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-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" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", + "version": "v1.7.0", + "version_normalized": "1.7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", "shasum": "" }, "require": { @@ -190,11 +2116,11 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2016-11-14T01:06:16+00:00", + "time": "2018-01-30T19:27:44+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.7-dev" } }, "installation-source": "dist", @@ -231,38 +2157,105 @@ ] }, { - "name": "symfony/http-foundation", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", + "name": "symfony/var-dumper", + "version": "v3.4.4", + "version_normalized": "3.4.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef" + "url": "https://github.com/symfony/var-dumper.git", + "reference": "472a9849930cf21f73abdb02240f17cf5b5bd1a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9de6add7f731e5af7f5b2e9c0da365e43383ebef", - "reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/472a9849930cf21f73abdb02240f17cf5b5bd1a7", + "reference": "472a9849930cf21f73abdb02240f17cf5b5bd1a7", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.1" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "require-dev": { - "symfony/expression-language": "~2.8|~3.0" - }, - "time": "2017-05-01T14:55:58+00:00", + "ext-iconv": "*", + "twig/twig": "~1.34|~2.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "ext-symfony_debug": "" + }, + "time": "2018-01-29T09:03:43+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ] + }, + { + "name": "symfony/finder", + "version": "v3.4.4", + "version_normalized": "3.4.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/613e26310776f49a1773b6737c6bd554b8bc8c6f", + "reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "time": "2018-01-03T07:37:34+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" + "Symfony\\Component\\Finder\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -282,22 +2275,22 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony HttpFoundation Component", + "description": "Symfony Finder Component", "homepage": "https://symfony.com" }, { "name": "symfony/event-dispatcher", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b8a401f733b43251e1d088c589368b2a94155e40" + "reference": "b8de6ee252af19330dd72ad5fc0dd4658a1d6325" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8a401f733b43251e1d088c589368b2a94155e40", - "reference": "b8a401f733b43251e1d088c589368b2a94155e40", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8de6ee252af19330dd72ad5fc0dd4658a1d6325", + "reference": "b8de6ee252af19330dd72ad5fc0dd4658a1d6325", "shasum": "" }, "require": { @@ -314,7 +2307,7 @@ "symfony/dependency-injection": "", "symfony/http-kernel": "" }, - "time": "2017-05-01T14:58:48+00:00", + "time": "2017-06-02T08:26:05+00:00", "type": "library", "extra": { "branch-alias": { @@ -348,85 +2341,35 @@ "homepage": "https://symfony.com" }, { - "name": "psr/log", - "version": "1.0.2", - "version_normalized": "1.0.2.0", + "name": "symfony/debug", + "version": "v3.4.4", + "version_normalized": "3.4.4.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "url": "https://github.com/symfony/debug.git", + "reference": "53f6af2805daf52a43b393b93d2f24925d35c937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/symfony/debug/zipball/53f6af2805daf52a43b393b93d2f24925d35c937", + "reference": "53f6af2805daf52a43b393b93d2f24925d35c937", "shasum": "" }, "require": { - "php": ">=5.3.0" - }, - "time": "2016-10-10T12:19:37+00:00", + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "time": "2018-01-18T22:16:57+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ] - }, - { - "name": "symfony/debug", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/fd6eeee656a5a7b384d56f1072243fe1c0e81686", - "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/class-loader": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" - }, - "time": "2017-04-19T20:17:50+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "installation-source": "dist", @@ -456,57 +2399,38 @@ "homepage": "https://symfony.com" }, { - "name": "symfony/http-kernel", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", + "name": "symfony/console", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", "source": { "type": "git", - "url": "https://github.com/symfony/http-kernel.git", - "reference": "46e8b209abab55c072c47d72d5cd1d62c0585e05" + "url": "https://github.com/symfony/console.git", + "reference": "eced439413608647aeff243038a33ea246b2b33a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/46e8b209abab55c072c47d72d5cd1d62c0585e05", - "reference": "46e8b209abab55c072c47d72d5cd1d62c0585e05", + "url": "https://api.github.com/repos/symfony/console/zipball/eced439413608647aeff243038a33ea246b2b33a", + "reference": "eced439413608647aeff243038a33ea246b2b33a", "shasum": "" }, "require": { "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { "psr/log": "~1.0", - "symfony/debug": "~2.8|~3.0", "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "~2.8.13|~3.1.6|~3.2" - }, - "conflict": { - "symfony/config": "<2.8" - }, - "require-dev": { - "symfony/browser-kit": "~2.8|~3.0", - "symfony/class-loader": "~2.8|~3.0", - "symfony/config": "~2.8|~3.0", - "symfony/console": "~2.8|~3.0", - "symfony/css-selector": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/dom-crawler": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/finder": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0", - "symfony/routing": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0", - "symfony/templating": "~2.8|~3.0", - "symfony/translation": "~2.8|~3.0", - "symfony/var-dumper": "~3.2" + "symfony/filesystem": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { - "symfony/browser-kit": "", - "symfony/class-loader": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "", - "symfony/finder": "", - "symfony/var-dumper": "" - }, - "time": "2017-05-01T17:46:48+00:00", + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/filesystem": "", + "symfony/process": "" + }, + "time": "2017-07-29T21:27:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -516,7 +2440,7 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Component\\HttpKernel\\": "" + "Symfony\\Component\\Console\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -536,4406 +2460,22 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony HttpKernel Component", - "homepage": "https://symfony.com" - }, - { - "name": "asm89/stack-cors", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/asm89/stack-cors.git", - "reference": "65ccbd455370f043c2e3b93482a3813603d68731" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/asm89/stack-cors/zipball/65ccbd455370f043c2e3b93482a3813603d68731", - "reference": "65ccbd455370f043c2e3b93482a3813603d68731", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/http-foundation": "~2.7|~3.0", - "symfony/http-kernel": "~2.7|~3.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8.10", - "squizlabs/php_codesniffer": "^2.3" - }, - "time": "2017-04-11T20:03:41+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Asm89\\Stack\\": "src/Asm89/Stack/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alexander", - "email": "iam.asm89@gmail.com" - } - ], - "description": "Cross-origin resource sharing library and stack middleware", - "homepage": "https://github.com/asm89/stack-cors", - "keywords": [ - "cors", - "stack" - ] - }, - { - "name": "composer/semver", - "version": "1.4.2", - "version_normalized": "1.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "time": "2016-08-30T16:08:34+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ] - }, - { - "name": "doctrine/lexer", - "version": "v1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "time": "2014-09-09T13:34:57+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "lexer", - "parser" - ] - }, - { - "name": "doctrine/inflector", - "version": "v1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "time": "2015-11-06T14:35:42+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ] - }, - { - "name": "doctrine/collections", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2015-04-14T22:21:58+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ] - }, - { - "name": "doctrine/cache", - "version": "v1.6.1", - "version_normalized": "1.6.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/b6f544a20f4807e81f7044d31e679ccbb1866dc3", - "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3", - "shasum": "" - }, - "require": { - "php": "~5.5|~7.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" - }, - "time": "2016-10-29T11:16:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "cache", - "caching" - ] - }, - { - "name": "doctrine/annotations", - "version": "v1.2.7", - "version_normalized": "1.2.7.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "php": ">=5.3.2" - }, - "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" - }, - "time": "2015-08-31T12:32:49+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ] - }, - { - "name": "doctrine/common", - "version": "v2.6.2", - "version_normalized": "2.6.2.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3", - "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3", - "shasum": "" - }, - "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": "~5.5|~7.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8|~5.0" - }, - "time": "2016-11-30T16:50:46+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "collections", - "eventmanager", - "persistence", - "spl" - ] - }, - { - "name": "easyrdf/easyrdf", - "version": "0.9.1", - "version_normalized": "0.9.1.0", - "source": { - "type": "git", - "url": "https://github.com/njh/easyrdf.git", - "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/njh/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566", - "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "ext-pcre": "*", - "php": ">=5.2.8" - }, - "require-dev": { - "phpunit/phpunit": "~3.5", - "sami/sami": "~1.4", - "squizlabs/php_codesniffer": "~1.4.3" - }, - "suggest": { - "ml/json-ld": "~1.0" - }, - "time": "2015-02-27T09:45:49+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "EasyRdf_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nicholas Humfrey", - "email": "njh@aelius.com", - "homepage": "http://www.aelius.com/njh/", - "role": "Developer" - }, - { - "name": "Alexey Zakhlestin", - "email": "indeyets@gmail.com", - "role": "Developer" - } - ], - "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", - "homepage": "http://www.easyrdf.org/", - "keywords": [ - "Linked Data", - "RDF", - "Semantic Web", - "Turtle", - "rdfa", - "sparql" - ] - }, - { - "name": "egulias/email-validator", - "version": "1.2.14", - "version_normalized": "1.2.14.0", - "source": { - "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "5642614492f0ca2064c01d60cc33284cc2f731a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/5642614492f0ca2064c01d60cc33284cc2f731a9", - "reference": "5642614492f0ca2064c01d60cc33284cc2f731a9", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^1.0.1", - "php": ">= 5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.24" - }, - "time": "2017-02-03T22:48:59+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Egulias\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eduardo Gulias Davis" - } - ], - "description": "A library for validating emails", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": [ - "email", - "emailvalidation", - "emailvalidator", - "validation", - "validator" - ] - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "version_normalized": "1.3.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "time": "2016-12-20T10:07:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ] - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2016-08-06T14:39:51+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ] - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "version_normalized": "1.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2017-03-20T17:10:46+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ] - }, - { - "name": "masterminds/html5", - "version": "2.3.0", - "version_normalized": "2.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/Masterminds/html5-php.git", - "reference": "2c37c6c520b995b761674de3be8455a381679067" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/2c37c6c520b995b761674de3be8455a381679067", - "reference": "2c37c6c520b995b761674de3be8455a381679067", - "shasum": "" - }, - "require": { - "ext-libxml": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*", - "sami/sami": "~2.0", - "satooshi/php-coveralls": "1.0.*" - }, - "time": "2017-09-04T12:26:28+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Masterminds\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matt Butcher", - "email": "technosophos@gmail.com" - }, - { - "name": "Asmir Mustafic", - "email": "goetas@gmail.com" - }, - { - "name": "Matt Farina", - "email": "matt@mattfarina.com" - } - ], - "description": "An HTML5 parser and serializer.", - "homepage": "http://masterminds.github.io/html5-php", - "keywords": [ - "HTML5", - "dom", - "html", - "parser", - "querypath", - "serializer", - "xml" - ] - }, - { - "name": "paragonie/random_compat", - "version": "v2.0.10", - "version_normalized": "2.0.10.0", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "time": "2017-03-13T16:27:32+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "pseudorandom", - "random" - ] - }, - { - "name": "stack/builder", - "version": "v1.0.4", - "version_normalized": "1.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/stackphp/builder.git", - "reference": "59fcc9b448a8ce5e338a04c4e2e4aca893e83425" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/stackphp/builder/zipball/59fcc9b448a8ce5e338a04c4e2e4aca893e83425", - "reference": "59fcc9b448a8ce5e338a04c4e2e4aca893e83425", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "symfony/http-foundation": "~2.1|~3.0", - "symfony/http-kernel": "~2.1|~3.0" - }, - "require-dev": { - "silex/silex": "~1.0" - }, - "time": "2016-06-02T06:58:42+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Stack": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "description": "Builder for stack middlewares based on HttpKernelInterface.", - "keywords": [ - "stack" - ] - }, - { - "name": "symfony/routing", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "5029745d6d463585e8b487dbc83d6333f408853a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/5029745d6d463585e8b487dbc83d6333f408853a", - "reference": "5029745d6d463585e8b487dbc83d6333f408853a", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "conflict": { - "symfony/config": "<2.8" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" - }, - "time": "2017-04-12T14:13:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Routing\\": "" - }, - "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 Routing Component", - "homepage": "https://symfony.com", - "keywords": [ - "router", - "routing", - "uri", - "url" - ] - }, - { - "name": "symfony-cmf/routing", - "version": "1.4.1", - "version_normalized": "1.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony-cmf/routing.git", - "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony-cmf/routing/zipball/fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac", - "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac", - "shasum": "" - }, - "require": { - "php": "^5.3.9|^7.0", - "psr/log": "1.*", - "symfony/http-kernel": "^2.2|3.*", - "symfony/routing": "^2.2|3.*" - }, - "require-dev": { - "friendsofsymfony/jsrouting-bundle": "^1.1", - "symfony-cmf/testing": "^1.3", - "symfony/config": "^2.2|3.*", - "symfony/dependency-injection": "^2.0.5|3.*", - "symfony/event-dispatcher": "^2.1|3.*" - }, - "suggest": { - "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version (~2.1)" - }, - "time": "2017-05-09T08:10:41+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Cmf\\Component\\Routing\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony CMF Community", - "homepage": "https://github.com/symfony-cmf/Routing/contributors" - } - ], - "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers", - "homepage": "http://cmf.symfony.com", - "keywords": [ - "database", - "routing" - ] - }, - { - "name": "symfony/class-loader", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/class-loader.git", - "reference": "fc4c04bfd17130a9dccfded9578353f311967da7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/fc4c04bfd17130a9dccfded9578353f311967da7", - "reference": "fc4c04bfd17130a9dccfded9578353f311967da7", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/finder": "~2.8|~3.0", - "symfony/polyfill-apcu": "~1.1" - }, - "suggest": { - "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" - }, - "time": "2017-04-12T14:13:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - }, - "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 ClassLoader Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/console", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", - "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/debug": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/filesystem": "", - "symfony/process": "" - }, - "time": "2017-04-26T01:39:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], "description": "Symfony Console Component", "homepage": "https://symfony.com" }, { - "name": "symfony/dependency-injection", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "5e00857475b6d1fa31ff4c76f1fddf1cfa9e8d59" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5e00857475b6d1fa31ff4c76f1fddf1cfa9e8d59", - "reference": "5e00857475b6d1fa31ff4c76f1fddf1cfa9e8d59", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "conflict": { - "symfony/yaml": "<3.2" - }, - "require-dev": { - "symfony/config": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/yaml": "~3.2" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "time": "2017-04-26T01:39:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "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 DependencyInjection Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/polyfill-iconv", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "cba36f3616d9866b3e52662e88da5c090fac1e97" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/cba36f3616d9866b3e52662e88da5c090fac1e97", - "reference": "cba36f3616d9866b3e52662e88da5c090fac1e97", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-iconv": "For best performance" - }, - "time": "2016-11-14T01:06:16+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Iconv\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Iconv extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "iconv", - "polyfill", - "portable", - "shim" - ] - }, - { - "name": "symfony/process", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", - "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "time": "2017-04-12T14:13:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "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 Process Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/psr-http-message-bridge", - "version": "v1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "66085f246d3893cbdbcec5f5ad15ac60546cf0de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/66085f246d3893cbdbcec5f5ad15ac60546cf0de", - "reference": "66085f246d3893cbdbcec5f5ad15ac60546cf0de", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "psr/http-message": "~1.0", - "symfony/http-foundation": "~2.3|~3.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" - }, - "suggest": { - "psr/http-message-implementation": "To use the HttpFoundation factory", - "zendframework/zend-diactoros": "To use the Zend Diactoros factory" - }, - "time": "2016-09-14T18:37:20+00:00", - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Bridge\\PsrHttpMessage\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "PSR HTTP message bridge", - "homepage": "http://symfony.com", - "keywords": [ - "http", - "http-message", - "psr-7" - ] - }, - { - "name": "symfony/serializer", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/serializer.git", - "reference": "6eeae1ba82005b761a53b7b8cf960bbf40c95986" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/6eeae1ba82005b761a53b7b8cf960bbf40c95986", - "reference": "6eeae1ba82005b761a53b7b8cf960bbf40c95986", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "conflict": { - "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", - "symfony/property-info": "<3.1", - "symfony/yaml": "<3.1" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "phpdocumentor/reflection-docblock": "~3.0", - "symfony/cache": "~3.1", - "symfony/config": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0", - "symfony/property-access": "~2.8|~3.0", - "symfony/property-info": "~3.1", - "symfony/yaml": "~3.1" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "psr/cache-implementation": "For using the metadata cache.", - "symfony/config": "For using the XML mapping loader.", - "symfony/http-foundation": "To use the DataUriNormalizer.", - "symfony/property-access": "For using the ObjectNormalizer.", - "symfony/property-info": "To deserialize relations.", - "symfony/yaml": "For using the default YAML mapping loader." - }, - "time": "2017-05-01T14:55:58+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Serializer\\": "" - }, - "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 Serializer Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/translation", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "f4a04d2df710f81515df576b2de06bdeee518b83" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f4a04d2df710f81515df576b2de06bdeee518b83", - "reference": "f4a04d2df710f81515df576b2de06bdeee518b83", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.8" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/intl": "^2.8.18|^3.2.5", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "time": "2017-04-12T14:13:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "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 Translation Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/validator", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/validator.git", - "reference": "98bf011bf1f3b69bece3b79e19633e9c51545b2b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/98bf011bf1f3b69bece3b79e19633e9c51545b2b", - "reference": "98bf011bf1f3b69bece3b79e19633e9c51545b2b", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation": "~2.8|~3.0" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "egulias/email-validator": "^1.2.8|~2.0", - "symfony/cache": "~3.1", - "symfony/config": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0", - "symfony/intl": "^2.8.18|^3.2.5", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "egulias/email-validator": "Strict (RFC compliant) email validation", - "psr/cache-implementation": "For using the metadata cache.", - "symfony/config": "", - "symfony/expression-language": "For using the Expression validator", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For using the Expression validator", - "symfony/yaml": "" - }, - "time": "2017-04-12T14:13:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - }, - "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 Validator Component", - "homepage": "https://symfony.com" - }, - { - "name": "zendframework/zend-diactoros", - "version": "1.4.1", - "version_normalized": "1.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/424a840dc3bedcdeea510b42e056c77c2d6c4bef", - "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef", - "shasum": "" - }, - "require": { - "php": "^5.4 || ^7.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-dom": "*", - "ext-libxml": "*", - "phpunit/phpunit": "^4.6 || ^5.5", - "zendframework/zend-coding-standard": "~1.0.0" - }, - "time": "2017-08-17T21:21:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev", - "dev-develop": "1.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Diactoros\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "description": "PSR HTTP Message implementations", - "homepage": "https://github.com/zendframework/zend-diactoros", - "keywords": [ - "http", - "psr", - "psr-7" - ] - }, - { - "name": "zendframework/zend-stdlib", - "version": "3.0.1", - "version_normalized": "3.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "8bafa58574204bdff03c275d1d618aaa601588ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/8bafa58574204bdff03c275d1d618aaa601588ae", - "reference": "8bafa58574204bdff03c275d1d618aaa601588ae", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0" - }, - "require-dev": { - "athletic/athletic": "~0.1", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" - }, - "time": "2016-04-12T21:19:36+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Stdlib\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-stdlib", - "keywords": [ - "stdlib", - "zf2" - ] - }, - { - "name": "zendframework/zend-escaper", - "version": "2.5.2", - "version_normalized": "2.5.2.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/2dcd14b61a72d8b8e27d579c6344e12c26141d4e", - "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" - }, - "time": "2016-06-30T19:48:38+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Escaper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-escaper", - "keywords": [ - "escaper", - "zf2" - ] - }, - { - "name": "zendframework/zend-feed", - "version": "2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-feed.git", - "reference": "12b328d382aa5200f1de53d4147033b885776b67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/12b328d382aa5200f1de53d4147033b885776b67", - "reference": "12b328d382aa5200f1de53d4147033b885776b67", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-escaper": "^2.5", - "zendframework/zend-stdlib": "^2.7 || ^3.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "psr/http-message": "^1.0", - "zendframework/zend-cache": "^2.5", - "zendframework/zend-db": "^2.5", - "zendframework/zend-http": "^2.5", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", - "zendframework/zend-validator": "^2.5" - }, - "suggest": { - "psr/http-message": "PSR-7 ^1.0, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator", - "zendframework/zend-cache": "Zend\\Cache component, for optionally caching feeds between requests", - "zendframework/zend-db": "Zend\\Db component, for use with PubSubHubbub", - "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for easily extending ExtensionManager implementations", - "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries ehen using the Writer subcomponent" - }, - "time": "2016-02-11T18:54:29+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Feed\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides functionality for consuming RSS and Atom feeds", - "homepage": "https://github.com/zendframework/zend-feed", - "keywords": [ - "feed", - "zf2" - ] - }, - { - "name": "symfony/css-selector", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "02983c144038e697c959e6b06ef6666de759ccbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/02983c144038e697c959e6b06ef6666de759ccbc", - "reference": "02983c144038e697c959e6b06ef6666de759ccbc", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "time": "2017-05-01T14:55:58+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com" - }, - { - "name": "behat/mink", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/minkphp/Mink.git", - "reference": "9ea1cebe3dc529ba3861d87c818f045362c40484" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/9ea1cebe3dc529ba3861d87c818f045362c40484", - "reference": "9ea1cebe3dc529ba3861d87c818f045362c40484", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/css-selector": "~2.1|~3.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" - }, - "suggest": { - "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", - "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", - "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", - "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" - }, - "time": "2017-02-06T09:59:54+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Behat\\Mink\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Browser controller/emulator abstraction for PHP", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "testing", - "web" - ] - }, - { - "name": "symfony/dom-crawler", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f1ad34e8af09ed17570e027cf0c58a12eddec286", - "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "time": "2017-04-12T14:13:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "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 DomCrawler Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/browser-kit", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/9fab1ab6f77b77f3df5fc5250fc6956811699b57", - "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/dom-crawler": "~2.8|~3.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "symfony/process": "" - }, - "time": "2017-04-12T14:13:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "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 BrowserKit Component", - "homepage": "https://symfony.com" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.0", - "version_normalized": "6.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "time": "2017-06-22T18:50:49+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ] - }, - { - "name": "fabpot/goutte", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "db5c28f4a010b4161d507d5304e28a7ebf211638" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/db5c28f4a010b4161d507d5304e28a7ebf211638", - "reference": "db5c28f4a010b4161d507d5304e28a7ebf211638", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0", - "symfony/browser-kit": "~2.1|~3.0", - "symfony/css-selector": "~2.1|~3.0", - "symfony/dom-crawler": "~2.1|~3.0" - }, - "time": "2017-01-03T13:21:43+00:00", - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Goutte\\": "Goutte" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "A simple PHP Web Scraper", - "homepage": "https://github.com/FriendsOfPHP/Goutte", - "keywords": [ - "scraper" - ] - }, - { - "name": "behat/mink-browserkit-driver", - "version": "v1.3.2", - "version_normalized": "1.3.2.0", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", - "reference": "10e67fb4a295efcd62ea0bf16025a85ea19534fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/10e67fb4a295efcd62ea0bf16025a85ea19534fb", - "reference": "10e67fb4a295efcd62ea0bf16025a85ea19534fb", - "shasum": "" - }, - "require": { - "behat/mink": "^1.7.1@dev", - "php": ">=5.3.6", - "symfony/browser-kit": "~2.3|~3.0", - "symfony/dom-crawler": "~2.3|~3.0" - }, - "require-dev": { - "silex/silex": "~1.2", - "symfony/phpunit-bridge": "~2.7|~3.0" - }, - "time": "2016-03-05T08:59:47+00:00", - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Symfony2 BrowserKit driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "Mink", - "Symfony2", - "browser", - "testing" - ] - }, - { - "name": "behat/mink-goutte-driver", - "version": "v1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkGoutteDriver.git", - "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", - "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", - "shasum": "" - }, - "require": { - "behat/mink": "~1.6@dev", - "behat/mink-browserkit-driver": "~1.2@dev", - "fabpot/goutte": "~1.0.4|~2.0|~3.1", - "php": ">=5.3.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" - }, - "time": "2016-03-05T09:04:22+00:00", - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Goutte driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "goutte", - "headless", - "testing" - ] - }, - { - "name": "symfony/yaml", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/acec26fcf7f3031e094e910b94b002fa53d4e4d6", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "time": "2017-05-01T14:55:58+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-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" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "2.8.1", - "version_normalized": "2.8.1.0", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2017-03-01T22:17:45+00:00", - "bin": [ - "scripts/phpcs", - "scripts/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ] - }, - { - "name": "drupal/coder", - "version": "8.2.12", - "version_normalized": "8.2.12.0", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/coder.git", - "reference": "984c54a7b1e8f27ff1c32348df69712afd86b17f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/klausi/coder/zipball/984c54a7b1e8f27ff1c32348df69712afd86b17f", - "reference": "984c54a7b1e8f27ff1c32348df69712afd86b17f", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.4.0", - "squizlabs/php_codesniffer": ">=2.8.1 <3.0", - "symfony/yaml": ">=2.0.0" - }, - "require-dev": { - "phpunit/phpunit": ">=3.7 <6" - }, - "time": "2017-03-18T10:28:49+00:00", - "type": "phpcodesniffer-standard", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "description": "Coder is a library to review Drupal code.", - "homepage": "https://www.drupal.org/project/coder", - "keywords": [ - "code review", - "phpcs", - "standards" - ] - }, - { - "name": "ircmaxell/password-compat", - "version": "v1.0.4", - "version_normalized": "1.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "time": "2014-11-20T16:49:30+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "lib/password.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" - } - ], - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "homepage": "https://github.com/ircmaxell/password_compat", - "keywords": [ - "hashing", - "password" - ] - }, - { - "name": "twig/twig", - "version": "v1.32.0", - "version_normalized": "1.32.0.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "9935b662e24d6e634da88901ab534cc12e8c728f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/9935b662e24d6e634da88901ab534cc12e8c728f", - "reference": "9935b662e24d6e634da88901ab534cc12e8c728f", - "shasum": "" - }, - "require": { - "php": ">=5.2.7" - }, - "require-dev": { - "psr/container": "^1.0", - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~3.2" - }, - "time": "2017-02-27T00:07:03+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.32-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ] - }, - { - "name": "jcalderonzumba/gastonjs", - "version": "v1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/jcalderonzumba/gastonjs.git", - "reference": "21bebb8ca03eb0f93ec2f3fad61192fb079e2622" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/21bebb8ca03eb0f93ec2f3fad61192fb079e2622", - "reference": "21bebb8ca03eb0f93ec2f3fad61192fb079e2622", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~5.0|~6.0", - "php": ">=5.4" - }, - "require-dev": { - "phpunit/phpunit": "~4.6", - "silex/silex": "~1.2", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" - }, - "time": "2016-01-18T09:21:03+00:00", - "type": "phantomjs-api", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zumba\\GastonJS\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Juan Francisco Calderón Zumba", - "email": "juanfcz@gmail.com", - "homepage": "http://github.com/jcalderonzumba" - } - ], - "description": "PhantomJS API based server for webpage automation", - "homepage": "https://github.com/jcalderonzumba/gastonjs", - "keywords": [ - "api", - "automation", - "browser", - "headless", - "phantomjs" - ] - }, - { - "name": "jcalderonzumba/mink-phantomjs-driver", - "version": "v0.3.1", - "version_normalized": "0.3.1.0", - "source": { - "type": "git", - "url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git", - "reference": "782892dbea4af7d04024374672b3790b6c008def" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/782892dbea4af7d04024374672b3790b6c008def", - "reference": "782892dbea4af7d04024374672b3790b6c008def", - "shasum": "" - }, - "require": { - "behat/mink": "~1.6", - "jcalderonzumba/gastonjs": "~1.0", - "php": ">=5.4", - "twig/twig": "~1.20|~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.6", - "silex/silex": "~1.2", - "symfony/css-selector": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.3" - }, - "time": "2015-12-04T13:55:02+00:00", - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "0.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zumba\\Mink\\Driver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Juan Francisco Calderón Zumba", - "email": "juanfcz@gmail.com", - "homepage": "http://github.com/jcalderonzumba" - } - ], - "description": "PhantomJS driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "ajax", - "browser", - "headless", - "javascript", - "phantomjs", - "testing" - ] - }, - { - "name": "mikey179/vfsStream", - "version": "v1.6.5", - "version_normalized": "1.6.5.0", - "source": { - "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.5" - }, - "time": "2017-08-01T08:02:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "org\\bovigo\\vfs\\": "src/main/php" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Frank Kleine", - "homepage": "http://frankkleine.de/", - "role": "Developer" - } - ], - "description": "Virtual file system to mock the real file system in unit tests.", - "homepage": "http://vfs.bovigo.org/" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "version_normalized": "2.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "time": "2015-02-03T12:10:50+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ] - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.11", - "version_normalized": "1.4.11.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "time": "2017-02-27T10:12:30+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "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" - ] - }, - { - "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-21T13:59:46+00:00", - "type": "library", - "installation-source": "dist", - "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" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "time": "2015-10-12T03:26:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ] - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.5", - "version_normalized": "1.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "time": "2016-10-03T07:41:43+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context" - }, - { - "name": "sebastian/exporter", - "version": "1.2.2", - "version_normalized": "1.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "time": "2016-06-17T09:04:28+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "installation-source": "dist", - "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" - ] - }, - { - "name": "sebastian/environment", - "version": "1.3.8", - "version_normalized": "1.3.8.0", - "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" - }, - "time": "2016-08-18T05:49:44+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "installation-source": "dist", - "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" - ] - }, - { - "name": "sebastian/diff", - "version": "1.4.1", - "version_normalized": "1.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "time": "2015-12-08T07:14:41+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "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" - ] - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "version_normalized": "1.2.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "time": "2017-01-29T09:50:25+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ] - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "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" - }, - "time": "2015-06-21T13:50:34+00:00", - "type": "library", - "installation-source": "dist", - "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" - ] - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "version_normalized": "1.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "time": "2015-06-14T21:17:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ] - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "version_normalized": "2.3.8.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "time": "2015-10-02T06:51:40+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "installation-source": "dist", - "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": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ] - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "version_normalized": "1.0.9.0", - "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" - }, - "time": "2017-02-26T11:10:40+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "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" - ] - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.2", - "version_normalized": "1.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2016-10-03T07:40:28+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ] - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "version_normalized": "2.2.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "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.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "time": "2015-10-06T15:47:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "installation-source": "dist", - "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" - ] - }, - { - "name": "phpspec/prophecy", - "version": "v1.7.0", - "version_normalized": "1.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1|^2.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" - }, - "time": "2017-03-02T20:05:34+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ] - }, - { - "name": "phpunit/phpunit", - "version": "4.8.36", - "version_normalized": "4.8.36.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "time": "2017-06-21T08:07:12+00:00", - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ] - }, - { - "name": "symfony/phpunit-bridge", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "00916603c524b8048906de460b7ea0dfa1651281" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/00916603c524b8048906de460b7ea0dfa1651281", - "reference": "00916603c524b8048906de460b7ea0dfa1651281", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "conflict": { - "phpunit/phpunit": ">=6.0" - }, - "suggest": { - "ext-zip": "Zip support is required when using bin/simple-phpunit", - "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" - }, - "time": "2017-04-12T14:13:17+00:00", - "bin": [ - "bin/simple-phpunit" - ], - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Bridge\\PhpUnit\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony PHPUnit Bridge", - "homepage": "https://symfony.com" - }, - { - "name": "drupal/migrate_plus", - "version": "2.0.0-beta2", - "version_normalized": "2.0.0.0-beta2", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/migrate_plus", - "reference": "8.x-2.0-beta2" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/migrate_plus-8.x-2.0-beta2.zip", - "reference": "8.x-2.0-beta2", - "shasum": "0b29113a3c00c7ab3ba73e811da3450edca4c0bb" - }, - "require": { - "drupal/core": "^8.1" - }, - "require-dev": { - "drupal/migrate_example_advanced_setup": "*", - "drupal/migrate_example_setup": "*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, - "drupal": { - "version": "8.x-2.0-beta2", - "datestamp": "1476307439", - "security-coverage": { - "status": "not-covered", - "message": "Beta releases are not covered by Drupal security advisories." - } - } - }, - "installation-source": "dist", - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "Mike Ryan", - "homepage": "https://www.drupal.org/u/mikeryan", - "role": "Maintainer" - }, - { - "name": "mikeryan", - "homepage": "https://www.drupal.org/user/4420" - } - ], - "description": "Enhancements to core migration support.", - "homepage": "https://www.drupal.org/project/migrate_plus", - "support": { - "source": "https://cgit.drupalcode.org/migrate_plus", - "issues": "https://www.drupal.org/project/issues/migrate_plus", - "irc": "irc://irc.freenode.org/drupal-migrate" - } - }, - { - "name": "webmozart/assert", - "version": "1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "time": "2016-11-23T20:04:58+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ] - }, - { - "name": "drupal/migrate_tools", - "version": "2.0.0-beta1", - "version_normalized": "2.0.0.0-beta1", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/migrate_tools", - "reference": "8.x-2.0-beta1" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/migrate_tools-8.x-2.0-beta1.zip", - "reference": "8.x-2.0-beta1", - "shasum": "bf823a9d08d08b99d5ea1469729b30f9969ef519" - }, - "require": { - "drupal/core": "^8.1", - "drupal/migrate_plus": "*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, - "drupal": { - "version": "8.x-2.0-beta1", - "datestamp": "1476313439", - "security-coverage": { - "status": "not-covered", - "message": "Beta releases are not covered by Drupal security advisories." - } - } - }, - "installation-source": "dist", - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "heddn", - "homepage": "https://www.drupal.org/user/1463982" - }, - { - "name": "mikeryan", - "homepage": "https://www.drupal.org/user/4420" - }, - { - "name": "moshe weitzman", - "homepage": "https://www.drupal.org/user/23" - } - ], - "description": "Tools to assist in developing and running migrations.", - "homepage": "https://www.drupal.org/project/migrate_tools", - "support": { - "source": "http://cgit.drupalcode.org/migrate_tools" - } - }, - { - "name": "drupal/migrate_upgrade", - "version": "2.0.0-beta1", - "version_normalized": "2.0.0.0-beta1", - "source": { - "type": "git", - "url": "https://git.drupal.org/project/migrate_upgrade", - "reference": "8.x-2.0-beta1" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/migrate_upgrade-8.x-2.0-beta1.zip", - "reference": "8.x-2.0-beta1", - "shasum": "d5458312b74f2d6975b76d5f1115368b364c91b7" - }, - "require": { - "drupal/core": "^8.1", - "drupal/migrate_plus": "*" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, - "drupal": { - "version": "8.x-2.0-beta1", - "datestamp": "1472752139", - "security-coverage": { - "status": "not-covered", - "message": "Beta releases are not covered by Drupal security advisories." - } - } - }, - "installation-source": "dist", - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "abhishek-anand", - "homepage": "https://www.drupal.org/user/468982" - }, - { - "name": "heddn", - "homepage": "https://www.drupal.org/user/1463982" - }, - { - "name": "ksenzee", - "homepage": "https://www.drupal.org/user/139855" - }, - { - "name": "mikeryan", - "homepage": "https://www.drupal.org/user/4420" - }, - { - "name": "ultimike", - "homepage": "https://www.drupal.org/user/51132" - }, - { - "name": "xjm", - "homepage": "https://www.drupal.org/user/65776" - } - ], - "description": "Drush support for direct upgrades from older Drupal versions.", - "homepage": "https://www.drupal.org/project/migrate_upgrade", - "support": { - "source": "http://cgit.drupalcode.org/migrate_upgrade" - } - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "version_normalized": "2.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "time": "2015-12-17T08:42:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths." - }, - { - "name": "symfony/var-dumper", - "version": "v3.3.13", - "version_normalized": "3.3.13.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "805de6bd6869073e60610df1b14ab7d969c61b01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/805de6bd6869073e60610df1b14ab7d969c61b01", - "reference": "805de6bd6869073e60610df1b14ab7d969c61b01", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" - }, - "require-dev": { - "ext-iconv": "*", - "twig/twig": "~1.34|~2.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-symfony_debug": "" - }, - "time": "2017-11-07T14:16:22+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "Resources/functions/dump.php" - ], - "psr-4": { - "Symfony\\Component\\VarDumper\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony mechanism for exploring and dumping PHP variables", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ] - }, - { - "name": "symfony/finder", - "version": "v3.3.13", - "version_normalized": "3.3.13.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/138af5ec075d4b1d1bd19de08c38a34bb2d7d880", - "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "time": "2017-11-05T15:47:03+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "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 Finder Component", - "homepage": "https://symfony.com" - }, - { - "name": "jakub-onderka/php-console-color", - "version": "0.1", - "version_normalized": "0.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "jakub-onderka/php-code-style": "1.0", - "jakub-onderka/php-parallel-lint": "0.*", - "jakub-onderka/php-var-dump-check": "0.*", - "phpunit/phpunit": "3.7.*", - "squizlabs/php_codesniffer": "1.*" - }, - "time": "2014-04-08T15:00:19+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleColor": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com", - "homepage": "http://www.acci.cz" - } - ] - }, - { - "name": "jakub-onderka/php-console-highlighter", - "version": "v0.3.2", - "version_normalized": "0.3.2.0", - "source": { - "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", - "shasum": "" - }, - "require": { - "jakub-onderka/php-console-color": "~0.1", - "php": ">=5.3.0" - }, - "require-dev": { - "jakub-onderka/php-code-style": "~1.0", - "jakub-onderka/php-parallel-lint": "~0.5", - "jakub-onderka/php-var-dump-check": "~0.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5" - }, - "time": "2015-04-20T18:58:01+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleHighlighter": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "acci@acci.cz", - "homepage": "http://www.acci.cz/" - } - ] - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "0.1", - "version_normalized": "0.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "@stable" - }, - "time": "2014-10-24T07:27:01+00:00", - "type": "project", - "installation-source": "dist", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php" - }, - { "name": "nikic/php-parser", - "version": "v3.1.2", - "version_normalized": "3.1.2.0", + "version": "v3.1.4", + "version_normalized": "3.1.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "08131e7ff29de6bb9f12275c7d35df71f25f4d89" + "reference": "e57b3a09784f846411aa7ed664eedb73e3399078" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/08131e7ff29de6bb9f12275c7d35df71f25f4d89", - "reference": "08131e7ff29de6bb9f12275c7d35df71f25f4d89", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e57b3a09784f846411aa7ed664eedb73e3399078", + "reference": "e57b3a09784f846411aa7ed664eedb73e3399078", "shasum": "" }, "require": { @@ -4945,7 +2485,7 @@ "require-dev": { "phpunit/phpunit": "~4.0|~5.0" }, - "time": "2017-11-04T11:48:34+00:00", + "time": "2018-01-25T21:31:33+00:00", "bin": [ "bin/php-parse" ], @@ -4978,17 +2518,17 @@ }, { "name": "psy/psysh", - "version": "v0.8.15", - "version_normalized": "0.8.15.0", + "version": "v0.8.17", + "version_normalized": "0.8.17.0", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "b1d289c2cb03a2f8249912c53e96ced38f879926" + "reference": "5069b70e8c4ea492c2b5939b6eddc78bfe41cfec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/b1d289c2cb03a2f8249912c53e96ced38f879926", - "reference": "b1d289c2cb03a2f8249912c53e96ced38f879926", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/5069b70e8c4ea492c2b5939b6eddc78bfe41cfec", + "reference": "5069b70e8c4ea492c2b5939b6eddc78bfe41cfec", "shasum": "" }, "require": { @@ -4996,14 +2536,13 @@ "jakub-onderka/php-console-highlighter": "0.3.*", "nikic/php-parser": "~1.3|~2.0|~3.0", "php": ">=5.3.9", - "symfony/console": "~2.3.10|^2.4.2|~3.0", - "symfony/var-dumper": "~2.7|~3.0" + "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", + "symfony/var-dumper": "~2.7|~3.0|~4.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", "hoa/console": "~3.16|~1.14", "phpunit/phpunit": "^4.8.35|^5.4.3", - "symfony/finder": "~2.1|~3.0" + "symfony/finder": "~2.1|~3.0|~4.0" }, "suggest": { "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", @@ -5012,7 +2551,7 @@ "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." }, - "time": "2017-11-16T14:29:51+00:00", + "time": "2017-12-28T16:14:16+00:00", "bin": [ "bin/psysh" ], @@ -5053,17 +2592,17 @@ }, { "name": "pear/console_table", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", + "version": "v1.3.1", + "version_normalized": "1.3.1.0", "source": { "type": "git", "url": "https://github.com/pear/Console_Table.git", - "reference": "64100b9ee81852f4fa17823e55d0b385a544f976" + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Console_Table/zipball/64100b9ee81852f4fa17823e55d0b385a544f976", - "reference": "64100b9ee81852f4fa17823e55d0b385a544f976", + "url": "https://api.github.com/repos/pear/Console_Table/zipball/1930c11897ca61fd24b95f2f785e99e0f36dcdea", + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea", "shasum": "" }, "require": { @@ -5072,7 +2611,7 @@ "suggest": { "pear/Console_Color2": ">=0.1.2" }, - "time": "2016-01-21T16:14:31+00:00", + "time": "2018-01-25T20:47:17+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5110,31 +2649,31 @@ }, { "name": "consolidation/output-formatters", - "version": "3.1.12", - "version_normalized": "3.1.12.0", + "version": "3.1.13", + "version_normalized": "3.1.13.0", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a" + "reference": "3188461e965b32148c8fb85261833b2b72d34b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", - "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/3188461e965b32148c8fb85261833b2b72d34b8c", + "reference": "3188461e965b32148c8fb85261833b2b72d34b8c", "shasum": "" }, "require": { "php": ">=5.4.0", - "symfony/console": "^2.8|~3", - "symfony/finder": "~2.5|~3.0" + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", + "satooshi/php-coveralls": "^1.0.2 | dev-master", "squizlabs/php_codesniffer": "^2.7", "victorjonsson/markdowndocs": "^1.3" }, - "time": "2017-10-12T19:38:03+00:00", + "time": "2017-11-29T15:25:38+00:00", "type": "library", "extra": { "branch-alias": { @@ -5160,34 +2699,192 @@ "description": "Format text by applying transformations provided by plug-in formatters." }, { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "time": "2017-09-11T18:02:19+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ] + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "version_normalized": "0.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "time": "2017-07-14T14:27:02+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ] + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "version_normalized": "4.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "time": "2017-11-30T07:14:17+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock." + }, + { "name": "consolidation/annotated-command", - "version": "2.8.1", - "version_normalized": "2.8.1.0", + "version": "2.8.2", + "version_normalized": "2.8.2.0", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "7f94009d732922d61408536f9228aca8f22e9135" + "reference": "e97c38717eae23a2bafcf3f09438290eee6ebeb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7f94009d732922d61408536f9228aca8f22e9135", - "reference": "7f94009d732922d61408536f9228aca8f22e9135", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/e97c38717eae23a2bafcf3f09438290eee6ebeb4", + "reference": "e97c38717eae23a2bafcf3f09438290eee6ebeb4", "shasum": "" }, "require": { "consolidation/output-formatters": "^3.1.12", "php": ">=5.4.0", "psr/log": "^1", - "symfony/console": "^2.8|~3", - "symfony/event-dispatcher": "^2.5|^3", - "symfony/finder": "^2.5|^3" + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", + "satooshi/php-coveralls": "^1.0.2 | dev-master", "squizlabs/php_codesniffer": "^2.7" }, - "time": "2017-10-17T01:48:51+00:00", + "time": "2017-11-29T16:23:23+00:00", "type": "library", "extra": { "branch-alias": { @@ -5214,25 +2911,24 @@ }, { "name": "drush/drush", - "version": "8.1.15", - "version_normalized": "8.1.15.0", + "version": "8.1.16", + "version_normalized": "8.1.16.0", "source": { "type": "git", "url": "https://github.com/drush-ops/drush.git", - "reference": "f78b619806a9bc7c3d167fa425e8757eb046bb87" + "reference": "bbaff2dc725a5f3eb22006c5de3dc92a2de54b08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drush-ops/drush/zipball/f78b619806a9bc7c3d167fa425e8757eb046bb87", - "reference": "f78b619806a9bc7c3d167fa425e8757eb046bb87", + "url": "https://api.github.com/repos/drush-ops/drush/zipball/bbaff2dc725a5f3eb22006c5de3dc92a2de54b08", + "reference": "bbaff2dc725a5f3eb22006c5de3dc92a2de54b08", "shasum": "" }, "require": { - "consolidation/annotated-command": "~2", + "consolidation/annotated-command": "^2.8.1", "consolidation/output-formatters": "~3", - "pear/console_table": "~1.3.0", + "pear/console_table": "~1.3.1", "php": ">=5.4.5", - "phpdocumentor/reflection-docblock": "^2.0", "psr/log": "~1.0", "psy/psysh": "~0.6", "symfony/console": "~2.7|^3", @@ -5255,7 +2951,7 @@ "drush/config-extra": "Provides configuration workflow commands, such as config-merge.", "ext-pcntl": "*" }, - "time": "2017-10-10T02:05:46+00:00", + "time": "2018-02-06T21:18:48+00:00", "bin": [ "drush", "drush.launcher", @@ -5277,7 +2973,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { @@ -5323,5 +3019,2382 @@ ], "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", "homepage": "http://www.drush.org" + }, + { + "name": "symfony/class-loader", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/class-loader.git", + "reference": "e192d96b15fdd168bdb1c91001d26c93ba4af482" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/e192d96b15fdd168bdb1c91001d26c93ba4af482", + "reference": "e192d96b15fdd168bdb1c91001d26c93ba4af482", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/finder": "~2.8|~3.0", + "symfony/polyfill-apcu": "~1.1" + }, + "suggest": { + "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" + }, + "time": "2017-06-01T21:00:24+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\ClassLoader\\": "" + }, + "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 ClassLoader Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/dependency-injection", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "d9f2e62e1a93d52ad4e4f6faaf66f6eef723d761" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/d9f2e62e1a93d52ad4e4f6faaf66f6eef723d761", + "reference": "d9f2e62e1a93d52ad4e4f6faaf66f6eef723d761", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "conflict": { + "symfony/yaml": "<3.2" + }, + "require-dev": { + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/yaml": "~3.2" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "time": "2017-07-28T15:22:55+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "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 DependencyInjection Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/routing", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "b382d7c4f443372c118efcd0cd2bf1028434f2f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/b382d7c4f443372c118efcd0cd2bf1028434f2f5", + "reference": "b382d7c4f443372c118efcd0cd2bf1028434f2f5", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/common": "~2.2", + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/http-foundation": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/dependency-injection": "For loading routes from a service", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" + }, + "time": "2017-06-23T06:35:45+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "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 Routing Component", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ] + }, + { + "name": "symfony/serializer", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/serializer.git", + "reference": "dc98d5ab4ae29dc47bfb1507b39806bfe13d3477" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/serializer/zipball/dc98d5ab4ae29dc47bfb1507b39806bfe13d3477", + "reference": "dc98d5ab4ae29dc47bfb1507b39806bfe13d3477", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "conflict": { + "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", + "symfony/property-info": "<3.1", + "symfony/yaml": "<3.1" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "phpdocumentor/reflection-docblock": "~3.0", + "symfony/cache": "~3.1", + "symfony/config": "~2.8|~3.0", + "symfony/http-foundation": "~2.8|~3.0", + "symfony/property-access": "~2.8|~3.0", + "symfony/property-info": "~3.1", + "symfony/yaml": "~3.1" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/http-foundation": "To use the DataUriNormalizer.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/property-info": "To deserialize relations.", + "symfony/yaml": "For using the default YAML mapping loader." + }, + "time": "2017-07-06T07:39:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "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 Serializer Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/translation", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "df36a48672b929bf3995eb62c58d83004b1d0d50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/df36a48672b929bf3995eb62c58d83004b1d0d50", + "reference": "df36a48672b929bf3995eb62c58d83004b1d0d50", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/intl": "^2.8.18|^3.2.5", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "time": "2017-06-24T16:45:17+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "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 Translation Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/validator", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "39244fbf580e01acc3f5df01238a8f69b1b3e46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/39244fbf580e01acc3f5df01238a8f69b1b3e46f", + "reference": "39244fbf580e01acc3f5df01238a8f69b1b3e46f", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~2.8|~3.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.8|~2.0", + "symfony/cache": "~3.1", + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/http-foundation": "~2.8|~3.0", + "symfony/intl": "^2.8.18|^3.2.5", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "", + "symfony/expression-language": "For using the Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/yaml": "" + }, + "time": "2017-07-26T06:34:07+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "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 Validator Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/process", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "b39d805dd6c4d1cba1f00cd80361ec80eed0d7bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/b39d805dd6c4d1cba1f00cd80361ec80eed0d7bc", + "reference": "b39d805dd6c4d1cba1f00cd80361ec80eed0d7bc", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "time": "2017-07-03T08:06:20+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "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 Process Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/polyfill-iconv", + "version": "v1.7.0", + "version_normalized": "1.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-iconv.git", + "reference": "bd515d8f392730c833bc1ba993a4f598da64fa5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/bd515d8f392730c833bc1ba993a4f598da64fa5b", + "reference": "bd515d8f392730c833bc1ba993a4f598da64fa5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-iconv": "For best performance" + }, + "time": "2018-01-30T19:27:44+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Iconv\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Iconv extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "iconv", + "polyfill", + "portable", + "shim" + ] + }, + { + "name": "doctrine/inflector", + "version": "v1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "time": "2017-07-22T12:18:28+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ] + }, + { + "name": "doctrine/collections", + "version": "v1.4.0", + "version_normalized": "1.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" + }, + "time": "2017-01-03T10:49:41+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ] + }, + { + "name": "doctrine/cache", + "version": "v1.6.2", + "version_normalized": "1.6.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", + "shasum": "" + }, + "require": { + "php": "~5.5|~7.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": "~4.8|~5.0", + "predis/predis": "~1.0", + "satooshi/php-coveralls": "~0.6" + }, + "time": "2017-07-22T12:49:21+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ] + }, + { + "name": "doctrine/annotations", + "version": "v1.4.0", + "version_normalized": "1.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^5.7" + }, + "time": "2017-02-24T16:22:25+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ] + }, + { + "name": "doctrine/common", + "version": "v2.7.3", + "version_normalized": "2.7.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "4acb8f89626baafede6ee5475bc5844096eba8a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/4acb8f89626baafede6ee5475bc5844096eba8a9", + "reference": "4acb8f89626baafede6ee5475bc5844096eba8a9", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": "~5.6|~7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4.6" + }, + "time": "2017-07-22T08:35:12+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ] + }, + { + "name": "zendframework/zend-stdlib", + "version": "3.1.0", + "version_normalized": "3.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78", + "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.6.2" + }, + "time": "2016-09-13T14:38:50+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" + ] + }, + { + "name": "zendframework/zend-feed", + "version": "2.9.0", + "version_normalized": "2.9.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-feed.git", + "reference": "abe88686124d492e0a2a84656f15e5482bfbe030" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/abe88686124d492e0a2a84656f15e5482bfbe030", + "reference": "abe88686124d492e0a2a84656f15e5482bfbe030", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-escaper": "^2.5.2", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "psr/http-message": "^1.0.1", + "zendframework/zend-cache": "^2.7.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-db": "^2.8.2", + "zendframework/zend-http": "^2.7", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-validator": "^2.10.1" + }, + "suggest": { + "psr/http-message": "PSR-7 ^1.0.1, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator", + "zendframework/zend-cache": "Zend\\Cache component, for optionally caching feeds between requests", + "zendframework/zend-db": "Zend\\Db component, for use with PubSubHubbub", + "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for easily extending ExtensionManager implementations", + "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries when using the Writer subcomponent" + }, + "time": "2017-12-04T17:59:38+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9-dev", + "dev-develop": "2.10-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zend\\Feed\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides functionality for consuming RSS and Atom feeds", + "keywords": [ + "ZendFramework", + "feed", + "zf" + ] + }, + { + "name": "symfony/http-foundation", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "107b7e6c2372ad4859b8a8c8c5b4fb9d7a208fe1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/107b7e6c2372ad4859b8a8c8c5b4fb9d7a208fe1", + "reference": "107b7e6c2372ad4859b8a8c8c5b4fb9d7a208fe1", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.1" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0" + }, + "time": "2017-07-20T07:58:49+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "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 HttpFoundation Component", + "homepage": "https://symfony.com" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.11", + "version_normalized": "2.0.11.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "time": "2017-09-27T21:40:39+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ] + }, + { + "name": "symfony/http-kernel", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "18ec42e19ec676d7da5ddff13f1eed68d88fb460" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/18ec42e19ec676d7da5ddff13f1eed68d88fb460", + "reference": "18ec42e19ec676d7da5ddff13f1eed68d88fb460", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0", + "symfony/debug": "~2.8|~3.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/http-foundation": "~2.8.13|~3.1.6|~3.2" + }, + "conflict": { + "symfony/config": "<2.8", + "twig/twig": "<1.34|<2.4,>=2" + }, + "require-dev": { + "symfony/browser-kit": "~2.8|~3.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0", + "symfony/console": "~2.8|~3.0", + "symfony/css-selector": "~2.8|~3.0", + "symfony/dependency-injection": "~2.8|~3.0", + "symfony/dom-crawler": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/finder": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0", + "symfony/routing": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0", + "symfony/templating": "~2.8|~3.0", + "symfony/translation": "~2.8|~3.0", + "symfony/var-dumper": "~3.2" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/class-loader": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "", + "symfony/var-dumper": "" + }, + "time": "2017-08-01T09:40:19+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "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 HttpKernel Component", + "homepage": "https://symfony.com" + }, + { + "name": "stack/builder", + "version": "v1.0.5", + "version_normalized": "1.0.5.0", + "source": { + "type": "git", + "url": "https://github.com/stackphp/builder.git", + "reference": "fb3d136d04c6be41120ebf8c0cc71fe9507d750a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stackphp/builder/zipball/fb3d136d04c6be41120ebf8c0cc71fe9507d750a", + "reference": "fb3d136d04c6be41120ebf8c0cc71fe9507d750a", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/http-foundation": "~2.1|~3.0|~4.0", + "symfony/http-kernel": "~2.1|~3.0|~4.0" + }, + "require-dev": { + "silex/silex": "~1.0" + }, + "time": "2017-11-18T14:57:29+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Stack": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Builder for stack middlewares based on HttpKernelInterface.", + "keywords": [ + "stack" + ] + }, + { + "name": "symfony/psr-http-message-bridge", + "version": "v1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "c2b757934f2d9681a287e662efbc27c41fe8ef86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/c2b757934f2d9681a287e662efbc27c41fe8ef86", + "reference": "c2b757934f2d9681a287e662efbc27c41fe8ef86", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "psr/http-message": "~1.0", + "symfony/http-foundation": "~2.3|~3.0|~4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "~3.2|4.0" + }, + "suggest": { + "psr/http-message-implementation": "To use the HttpFoundation factory", + "zendframework/zend-diactoros": "To use the Zend Diactoros factory" + }, + "time": "2017-12-19T00:31:44+00:00", + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Bridge\\PsrHttpMessage\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "PSR HTTP message bridge", + "homepage": "http://symfony.com", + "keywords": [ + "http", + "http-message", + "psr-7" + ] + }, + { + "name": "zendframework/zend-diactoros", + "version": "1.7.0", + "version_normalized": "1.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-diactoros.git", + "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/ed6ce7e2105c400ca10277643a8327957c0384b7", + "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "psr/http-message": "^1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-dom": "*", + "ext-libxml": "*", + "phpunit/phpunit": "^5.7.16 || ^6.0.8", + "zendframework/zend-coding-standard": "~1.0" + }, + "time": "2018-01-04T18:21:48+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev", + "dev-develop": "1.8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zend\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "description": "PSR HTTP Message implementations", + "homepage": "https://github.com/zendframework/zend-diactoros", + "keywords": [ + "http", + "psr", + "psr-7" + ] + }, + { + "name": "asm89/stack-cors", + "version": "1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/asm89/stack-cors.git", + "reference": "c163e2b614550aedcf71165db2473d936abbced6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/asm89/stack-cors/zipball/c163e2b614550aedcf71165db2473d936abbced6", + "reference": "c163e2b614550aedcf71165db2473d936abbced6", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/http-foundation": "~2.7|~3.0|~4.0", + "symfony/http-kernel": "~2.7|~3.0|~4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8.10", + "squizlabs/php_codesniffer": "^2.3" + }, + "time": "2017-12-20T14:37:45+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Asm89\\Stack\\": "src/Asm89/Stack/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander", + "email": "iam.asm89@gmail.com" + } + ], + "description": "Cross-origin resource sharing library and stack middleware", + "homepage": "https://github.com/asm89/stack-cors", + "keywords": [ + "cors", + "stack" + ] + }, + { + "name": "jcalderonzumba/gastonjs", + "version": "v1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/jcalderonzumba/gastonjs.git", + "reference": "575a9c18d8b87990c37252e8d9707b29f0a313f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/575a9c18d8b87990c37252e8d9707b29f0a313f3", + "reference": "575a9c18d8b87990c37252e8d9707b29f0a313f3", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~5.0|~6.0", + "php": ">=5.4" + }, + "require-dev": { + "phpunit/phpunit": "~4.6", + "silex/silex": "~1.2", + "symfony/phpunit-bridge": "~2.7", + "symfony/process": "~2.1" + }, + "time": "2017-03-31T07:31:47+00:00", + "type": "phantomjs-api", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zumba\\GastonJS\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Juan Francisco Calderón Zumba", + "email": "juanfcz@gmail.com", + "homepage": "http://github.com/jcalderonzumba" + } + ], + "description": "PhantomJS API based server for webpage automation", + "homepage": "https://github.com/jcalderonzumba/gastonjs", + "keywords": [ + "api", + "automation", + "browser", + "headless", + "phantomjs" + ] + }, + { + "name": "twig/twig", + "version": "v1.35.0", + "version_normalized": "1.35.0.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f", + "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "~2.7", + "symfony/phpunit-bridge": "~3.3@dev" + }, + "time": "2017-09-27T18:06:46+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.35-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ] + }, + { + "name": "symfony/css-selector", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "02983c144038e697c959e6b06ef6666de759ccbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/02983c144038e697c959e6b06ef6666de759ccbc", + "reference": "02983c144038e697c959e6b06ef6666de759ccbc", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "time": "2017-05-01T14:55:58+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com" + }, + { + "name": "jcalderonzumba/mink-phantomjs-driver", + "version": "v0.3.3", + "version_normalized": "0.3.3.0", + "source": { + "type": "git", + "url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git", + "reference": "008f43670e94acd39273d15add1e7348eb23848d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/008f43670e94acd39273d15add1e7348eb23848d", + "reference": "008f43670e94acd39273d15add1e7348eb23848d", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7", + "jcalderonzumba/gastonjs": "~1.0", + "php": ">=5.4", + "twig/twig": "~1.20|~2.0" + }, + "require-dev": { + "mink/driver-testsuite": "dev-master", + "phpunit/phpunit": "~4.6" + }, + "time": "2016-12-01T10:57:30+00:00", + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "0.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zumba\\Mink\\Driver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Juan Francisco Calderón Zumba", + "email": "juanfcz@gmail.com", + "homepage": "http://github.com/jcalderonzumba" + } + ], + "description": "PhantomJS driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "headless", + "javascript", + "phantomjs", + "testing" + ] + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "version_normalized": "1.4.3.0", + "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" + }, + "time": "2017-05-22T07:24:03+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "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" + ] + }, + { + "name": "phpspec/prophecy", + "version": "1.7.5", + "version_normalized": "1.7.5.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "time": "2018-02-19T10:16:54+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ] + }, + { + "name": "symfony/phpunit-bridge", + "version": "v3.2.14", + "version_normalized": "3.2.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/phpunit-bridge.git", + "reference": "9e5c470da4b1e3e9cd8e29fecbd7c91eb961d15f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/9e5c470da4b1e3e9cd8e29fecbd7c91eb961d15f", + "reference": "9e5c470da4b1e3e9cd8e29fecbd7c91eb961d15f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "conflict": { + "phpunit/phpunit": ">=6.0" + }, + "suggest": { + "ext-zip": "Zip support is required when using bin/simple-phpunit", + "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" + }, + "time": "2017-06-02T09:43:35+00:00", + "bin": [ + "bin/simple-phpunit" + ], + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Bridge\\PhpUnit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony PHPUnit Bridge", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/dom-crawler", + "version": "v3.4.4", + "version_normalized": "3.4.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "09bd97b844b3151fab82f2fdd62db9c464b3910a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/09bd97b844b3151fab82f2fdd62db9c464b3910a", + "reference": "09bd97b844b3151fab82f2fdd62db9c464b3910a", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "time": "2018-01-03T07:37:34+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "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 DomCrawler Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/browser-kit", + "version": "v3.4.4", + "version_normalized": "3.4.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "490f27762705c8489bd042fe3e9377a191dba9b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/490f27762705c8489bd042fe3e9377a191dba9b4", + "reference": "490f27762705c8489bd042fe3e9377a191dba9b4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/dom-crawler": "~2.8|~3.0|~4.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/process": "" + }, + "time": "2018-01-03T07:37:34+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "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 BrowserKit Component", + "homepage": "https://symfony.com" + }, + { + "name": "fabpot/goutte", + "version": "v3.2.2", + "version_normalized": "3.2.2.0", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "395f61d7c2e15a813839769553a4de16fa3b3c96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/395f61d7c2e15a813839769553a4de16fa3b3c96", + "reference": "395f61d7c2e15a813839769553a4de16fa3b3c96", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1|~3.0|~4.0", + "symfony/css-selector": "~2.1|~3.0|~4.0", + "symfony/dom-crawler": "~2.1|~3.0|~4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3 || ^4" + }, + "time": "2017-11-19T08:45:40+00:00", + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Goutte\\": "Goutte" + }, + "exclude-from-classmap": [ + "Goutte/Tests" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", + "keywords": [ + "scraper" + ] + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.1", + "version_normalized": "2.9.1.0", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2017-05-22T02:43:20+00:00", + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ] + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "version_normalized": "1.4.5.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2017-11-27T13:52:08+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ] + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "version_normalized": "1.4.12.0", + "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" + }, + "time": "2017-12-04T08:55:13+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "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" + ] + }, + { + "name": "drupal/core", + "version": "8.4.5", + "version_normalized": "8.4.5.0", + "source": { + "type": "git", + "url": "https://github.com/drupal/core.git", + "reference": "44a857df6f7ffd063cffed9a41767cdc50dd7474" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/drupal/core/zipball/44a857df6f7ffd063cffed9a41767cdc50dd7474", + "reference": "44a857df6f7ffd063cffed9a41767cdc50dd7474", + "shasum": "" + }, + "require": { + "asm89/stack-cors": "^1.1", + "composer/semver": "^1.0", + "doctrine/annotations": "^1.2", + "doctrine/common": "^2.5", + "easyrdf/easyrdf": "^0.9", + "egulias/email-validator": "^1.2", + "guzzlehttp/guzzle": "^6.2.1", + "masterminds/html5": "^2.1", + "paragonie/random_compat": "^1.0|^2.0", + "php": ">=5.5.9", + "stack/builder": "^1.0", + "symfony-cmf/routing": "^1.4", + "symfony/class-loader": "~3.2.8", + "symfony/console": "~3.2.8", + "symfony/dependency-injection": "~3.2.8", + "symfony/event-dispatcher": "~3.2.8", + "symfony/http-foundation": "~3.2.8", + "symfony/http-kernel": "~3.2.8", + "symfony/polyfill-iconv": "^1.0", + "symfony/process": "~3.2.8", + "symfony/psr-http-message-bridge": "^1.0", + "symfony/routing": "~3.2.8", + "symfony/serializer": "~3.2.8", + "symfony/translation": "~3.2.8", + "symfony/validator": "~3.2.8", + "symfony/yaml": "~3.2.8", + "twig/twig": "^1.23.1", + "zendframework/zend-diactoros": "^1.1", + "zendframework/zend-feed": "^2.4" + }, + "conflict": { + "drush/drush": "<8.1.10" + }, + "replace": { + "drupal/action": "self.version", + "drupal/aggregator": "self.version", + "drupal/automated_cron": "self.version", + "drupal/ban": "self.version", + "drupal/bartik": "self.version", + "drupal/basic_auth": "self.version", + "drupal/big_pipe": "self.version", + "drupal/block": "self.version", + "drupal/block_content": "self.version", + "drupal/block_place": "self.version", + "drupal/book": "self.version", + "drupal/breakpoint": "self.version", + "drupal/ckeditor": "self.version", + "drupal/classy": "self.version", + "drupal/color": "self.version", + "drupal/comment": "self.version", + "drupal/config": "self.version", + "drupal/config_translation": "self.version", + "drupal/contact": "self.version", + "drupal/content_moderation": "self.version", + "drupal/content_translation": "self.version", + "drupal/contextual": "self.version", + "drupal/core-annotation": "self.version", + "drupal/core-assertion": "self.version", + "drupal/core-bridge": "self.version", + "drupal/core-class-finder": "self.version", + "drupal/core-datetime": "self.version", + "drupal/core-dependency-injection": "self.version", + "drupal/core-diff": "self.version", + "drupal/core-discovery": "self.version", + "drupal/core-event-dispatcher": "self.version", + "drupal/core-file-cache": "self.version", + "drupal/core-filesystem": "self.version", + "drupal/core-gettext": "self.version", + "drupal/core-graph": "self.version", + "drupal/core-http-foundation": "self.version", + "drupal/core-php-storage": "self.version", + "drupal/core-plugin": "self.version", + "drupal/core-proxy-builder": "self.version", + "drupal/core-render": "self.version", + "drupal/core-serialization": "self.version", + "drupal/core-transliteration": "self.version", + "drupal/core-utility": "self.version", + "drupal/core-uuid": "self.version", + "drupal/datetime": "self.version", + "drupal/datetime_range": "self.version", + "drupal/dblog": "self.version", + "drupal/dynamic_page_cache": "self.version", + "drupal/editor": "self.version", + "drupal/entity_reference": "self.version", + "drupal/field": "self.version", + "drupal/field_layout": "self.version", + "drupal/field_ui": "self.version", + "drupal/file": "self.version", + "drupal/filter": "self.version", + "drupal/forum": "self.version", + "drupal/hal": "self.version", + "drupal/help": "self.version", + "drupal/history": "self.version", + "drupal/image": "self.version", + "drupal/inline_form_errors": "self.version", + "drupal/language": "self.version", + "drupal/layout_discovery": "self.version", + "drupal/link": "self.version", + "drupal/locale": "self.version", + "drupal/media": "self.version", + "drupal/menu_link_content": "self.version", + "drupal/menu_ui": "self.version", + "drupal/migrate": "self.version", + "drupal/migrate_drupal": "self.version", + "drupal/migrate_drupal_ui": "self.version", + "drupal/minimal": "self.version", + "drupal/node": "self.version", + "drupal/options": "self.version", + "drupal/page_cache": "self.version", + "drupal/path": "self.version", + "drupal/quickedit": "self.version", + "drupal/rdf": "self.version", + "drupal/responsive_image": "self.version", + "drupal/rest": "self.version", + "drupal/search": "self.version", + "drupal/serialization": "self.version", + "drupal/settings_tray": "self.version", + "drupal/seven": "self.version", + "drupal/shortcut": "self.version", + "drupal/simpletest": "self.version", + "drupal/standard": "self.version", + "drupal/stark": "self.version", + "drupal/statistics": "self.version", + "drupal/syslog": "self.version", + "drupal/system": "self.version", + "drupal/taxonomy": "self.version", + "drupal/telephone": "self.version", + "drupal/text": "self.version", + "drupal/toolbar": "self.version", + "drupal/tour": "self.version", + "drupal/tracker": "self.version", + "drupal/update": "self.version", + "drupal/user": "self.version", + "drupal/views": "self.version", + "drupal/views_ui": "self.version", + "drupal/workflows": "self.version" + }, + "require-dev": { + "behat/mink": "1.7.x-dev", + "behat/mink-goutte-driver": "^1.2", + "drupal/coder": "^8.2.12", + "jcalderonzumba/gastonjs": "^1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "mikey179/vfsstream": "^1.2", + "phpspec/prophecy": "^1.4", + "phpunit/phpunit": ">=4.8.35 <5", + "symfony/css-selector": "~3.2.8", + "symfony/phpunit-bridge": "~3.2.8" + }, + "time": "2018-02-20T21:35:13+00:00", + "type": "drupal-core", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Drupal\\Core\\": "lib/Drupal/Core", + "Drupal\\Component\\": "lib/Drupal/Component", + "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver" + }, + "classmap": [ + "lib/Drupal.php", + "lib/Drupal/Component/Utility/Timer.php", + "lib/Drupal/Component/Utility/Unicode.php", + "lib/Drupal/Core/Database/Database.php", + "lib/Drupal/Core/DrupalKernel.php", + "lib/Drupal/Core/DrupalKernelInterface.php", + "lib/Drupal/Core/Site/Settings.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "Drupal is an open source content management platform powering millions of websites and applications." } ] diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/.travis.yml --- a/vendor/composer/installers/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -13,6 +13,7 @@ - 5.6 - 7.0 - 7.1 + - 7.2 - hhvm - nightly diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/CHANGELOG.md --- a/vendor/composer/installers/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,23 @@ ## [Unreleased] +## v1.5.0 - 2017-12-29 +### Added +* Added WordPress dropin support. +* Added new types supported for Eliasis. +* Added support for Phoenix CMS. +* Added MODX installer. +* Added Majima instaler. +* Added SiteDirect installer. +* Added support optional prefix in OctoberCMS installers. +* Added PHP 7.2 support. + +### Changed +* Changed remove packages, see [#348](https://github.com/composer/installers/pull/348). + +### Fixed +* Fixed code style, removed unused imports. + ## v1.4.0 - 2017-08-09 ### Added * Installer for eZ Platform. diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/README.md --- a/vendor/composer/installers/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -53,7 +53,7 @@ | Dolibarr | `dolibarr-module` | Drupal | `drupal-core`
    `drupal-module`
    `drupal-theme`

    `drupal-library`
    `drupal-profile`
    `drupal-drush` | Elgg | `elgg-plugin` -| Eliasis | `eliasis-module` +| Eliasis | `eliasis-component`
    `eliasis-module`
    `eliasis-plugin`
    `eliasis-template` | ExpressionEngine 3 | `ee3-addon`
    `ee3-theme` | eZ Platform | `ezplatform-assets`
    `ezplatform-meta-assets` | FuelPHP v1.x | `fuel-module`
    `fuel-package`
    `fuel-theme` @@ -72,9 +72,11 @@ | Lavalite | `lavalite-theme`
    `lavalite-package` | Lithium | **`lithium-library`
    `lithium-source`** | Magento | `magento-library`
    `magento-skin`
    `magento-theme` +| majima | `majima-plugin` | Mako | `mako-package` | Mautic | `mautic-plugin`
    `mautic-theme` | Maya | `maya-module` +| MODX | `modx-extra` | MODX Evo | `modxevo-snippet`
    `modxevo-plugin`
    `modxevo-module`
    `modxevo-template`
    `modxevo-lib` | MediaWiki | `mediawiki-extension` | October | **`october-module`
    `october-plugin`
    `october-theme`** @@ -96,6 +98,7 @@ | Roundcube | `roundcube-plugin` | shopware | `shopware-backend-plugin`
    `shopware-core-plugin`
    `shopware-frontend-plugin`
    `shopware-theme`
    `shopware-plugin`
    `shopware-frontend-theme` | SilverStripe | `silverstripe-module`
    `silverstripe-theme` +| SiteDirect | `sitedirect-module`
    `sitedirect-plugin` | SMF | `smf-module`
    `smf-theme` | SyDES | `sydes-module`
    `sydes-theme` | symfony1 | **`symfony1-plugin`** @@ -106,7 +109,7 @@ | Vanilla | `vanilla-plugin`
    `vanilla-theme` | Vgmcp | `vgmcp-bundle`
    `vgmcp-theme` | Wolf CMS | `wolfcms-plugin` -| WordPress | `wordpress-plugin`
    `wordpress-theme`

    `wordpress-muplugin` +| WordPress | `wordpress-plugin`
    `wordpress-theme`

    `wordpress-muplugin`
    `wordpress-dropin` | YAWIK | `yawik-module` | Zend | `zend-library`
    `zend-extra`
    `zend-module` | Zikula | `zikula-module`
    `zikula-theme` diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/composer.json --- a/vendor/composer/installers/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -37,9 +37,11 @@ "Lavalite", "Lithium", "Magento", + "majima", "Mako", "Mautic", "Maya", + "MODX", "MODX Evo", "MediaWiki", "OXID", @@ -47,6 +49,7 @@ "MODULEWork", "Moodle", "Piwik", + "pxcms", "phpBB", "Plentymarkets", "PPI", @@ -94,7 +97,7 @@ }, "require-dev": { "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" + "phpunit/phpunit": "^4.8.36" }, "scripts": { "test": "phpunit" diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php --- a/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,7 +2,6 @@ namespace Composer\Installers; use Composer\DependencyResolver\Pool; -use Composer\Package\PackageInterface; class CakePHPInstaller extends BaseInstaller { diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php --- a/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,6 +4,9 @@ class EliasisInstaller extends BaseInstaller { protected $locations = array( - 'module' => 'modules/{$name}/' + 'component' => 'components/{$name}/', + 'module' => 'modules/{$name}/', + 'plugin' => 'plugins/{$name}/', + 'template' => 'templates/{$name}/', ); } diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/Installer.php --- a/vendor/composer/installers/src/Composer/Installers/Installer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/Installer.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,18 +54,21 @@ 'lavalite' => 'LavaLiteInstaller', 'lithium' => 'LithiumInstaller', 'magento' => 'MagentoInstaller', + 'majima' => 'MajimaInstaller', 'mako' => 'MakoInstaller', 'maya' => 'MayaInstaller', 'mautic' => 'MauticInstaller', 'mediawiki' => 'MediaWikiInstaller', 'microweber' => 'MicroweberInstaller', 'modulework' => 'MODULEWorkInstaller', + 'modx' => 'ModxInstaller', 'modxevo' => 'MODXEvoInstaller', 'moodle' => 'MoodleInstaller', 'october' => 'OctoberInstaller', 'ontowiki' => 'OntoWikiInstaller', 'oxid' => 'OxidInstaller', 'osclass' => 'OsclassInstaller', + 'pxcms' => 'PxcmsInstaller', 'phpbb' => 'PhpBBInstaller', 'pimcore' => 'PimcoreInstaller', 'piwik' => 'PiwikInstaller', @@ -79,6 +82,7 @@ 'reindex' => 'ReIndexInstaller', 'roundcube' => 'RoundcubeInstaller', 'shopware' => 'ShopwareInstaller', + 'sitedirect' => 'SiteDirectInstaller', 'silverstripe' => 'SilverStripeInstaller', 'smf' => 'SMFInstaller', 'sydes' => 'SyDESInstaller', @@ -120,14 +124,9 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { - if (!$repo->hasPackage($package)) { - throw new \InvalidArgumentException('Package is not installed: '.$package); - } - - $repo->removePackage($package); - - $installPath = $this->getInstallPath($package); - $this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? 'deleted' : 'not deleted')); + parent::uninstall($repo, $package); + $installPath = $this->getPackageBasePath($package); + $this->io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? 'deleted' : 'not deleted')); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,37 @@ + 'plugins/{$name}/', + ); + + /** + * Transforms the names + * @param array $vars + * @return array + */ + public function inflectPackageVars($vars) + { + return $this->correctPluginName($vars); + } + + /** + * Change hyphenated names to camelcase + * @param array $vars + * @return array + */ + private function correctPluginName($vars) + { + $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) { + return strtoupper($matches[0][1]); + }, $vars['name']); + $vars['name'] = ucfirst($camelCasedName); + return $vars; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/ModxInstaller.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,12 @@ + 'core/packages/{$name}/' + ); +} diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php --- a/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,15 +32,15 @@ protected function inflectPluginVars($vars) { - $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']); + $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']); return $vars; } protected function inflectThemeVars($vars) { - $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); + $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']); return $vars; } -} \ No newline at end of file +} diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,63 @@ + 'app/Modules/{$name}/', + 'theme' => 'themes/{$name}/', + ); + + /** + * Format package name. + * + * @param array $vars + * + * @return array + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] === 'pxcms-module') { + return $this->inflectModuleVars($vars); + } + + if ($vars['type'] === 'pxcms-theme') { + return $this->inflectThemeVars($vars); + } + + return $vars; + } + + /** + * For package type pxcms-module, cut off a trailing '-plugin' if present. + * + * return string + */ + protected function inflectModuleVars($vars) + { + $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) + $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module- + $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module + $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s + $vars['name'] = ucwords($vars['name']); // make module name camelcased + + return $vars; + } + + + /** + * For package type pxcms-module, cut off a trailing '-plugin' if present. + * + * return string + */ + protected function inflectThemeVars($vars) + { + $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) + $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme- + $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme + $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s + $vars['name'] = ucwords($vars['name']); // make module name camelcased + + return $vars; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php --- a/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -25,9 +25,9 @@ { if ($vars['type'] === 'shopware-theme') { return $this->correctThemeName($vars); - } else { - return $this->correctPluginName($vars); } + + return $this->correctPluginName($vars); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php --- a/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,9 +28,8 @@ && version_compare($package->getVersion(), '2.999.999') < 0 ) { return $this->templatePath($this->locations['module'], array('name' => 'sapphire')); - } else { - return parent::getInstallPath($package, $frameworkType); } + return parent::getInstallPath($package, $frameworkType); } } diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,25 @@ + 'modules/{$vendor}/{$name}/', + 'plugin' => 'plugins/{$vendor}/{$name}/' + ); + + public function inflectPackageVars($vars) + { + return $this->parseVars($vars); + } + + protected function parseVars($vars) + { + $vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor']; + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php --- a/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php Fri Feb 23 15:52:07 2018 +0000 @@ -7,5 +7,6 @@ 'plugin' => 'wp-content/plugins/{$name}/', 'theme' => 'wp-content/themes/{$name}/', 'muplugin' => 'wp-content/mu-plugins/{$name}/', + 'dropin' => 'wp-content/{$name}/', ); } diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,8 +4,9 @@ use Composer\Installers\AsgardInstaller; use Composer\Package\Package; use Composer\Composer; +use PHPUnit\Framework\TestCase; -class AsgardInstallerTest extends \PHPUnit_Framework_TestCase +class AsgardInstallerTest extends TestCase { /** * @var AsgardInstaller diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -3,7 +3,6 @@ namespace Composer\Installers\Test; use Composer\Installers\BitrixInstaller; -use Composer\Package\PackageInterface; use Composer\Package\Package; use Composer\Composer; @@ -73,4 +72,4 @@ ), ); } -} \ No newline at end of file +} diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -6,7 +6,6 @@ use Composer\Repository\InstalledArrayRepository; use Composer\Package\Package; use Composer\Package\RootPackage; -use Composer\Package\Link; use Composer\Package\Version\VersionParser; use Composer\Composer; use Composer\Config; diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,8 +4,9 @@ use Composer\Installers\DokuWikiInstaller; use Composer\Package\Package; use Composer\Composer; +use PHPUnit\Framework\TestCase as BaseTestCase; -class DokuWikiInstallerTest extends \PHPUnit_Framework_TestCase +class DokuWikiInstallerTest extends BaseTestCase { /** * @var DokuWikiInstaller diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -123,7 +123,10 @@ array('ee2-theme', true), array('ee2-addon', true), array('elgg-plugin', true), + array('eliasis-component', true), array('eliasis-module', true), + array('eliasis-plugin', true), + array('eliasis-template', true), array('ezplatform-assets', true), array('ezplatform-meta-assets', true), array('fuel-module', true), @@ -149,7 +152,9 @@ array('lavalite-package', true), array('lithium-library', true), array('magento-library', true), + array('majima-plugin', true), array('mako-package', true), + array('modx-extra', true), array('modxevo-snippet', true), array('modxevo-plugin', true), array('modxevo-module', true), @@ -163,6 +168,8 @@ array('october-module', true), array('october-plugin', true), array('piwik-plugin', true), + array('pxcms-module', true), + array('pxcms-theme', true), array('phpbb-extension', true), array('pimcore-plugin', true), array('plentymarkets-plugin', true), @@ -277,7 +284,10 @@ array('drupal-profile', 'profiles/my_module/', 'shama/my_module'), array('drupal-drush', 'drush/my_module/', 'shama/my_module'), array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'), + array('eliasis-component', 'components/my_component/', 'shama/my_component'), array('eliasis-module', 'modules/my_module/', 'shama/my_module'), + array('eliasis-plugin', 'plugins/my_plugin/', 'shama/my_plugin'), + array('eliasis-template', 'templates/my_template/', 'shama/my_template'), array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'), array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'), array('ee2-addon', 'system/expressionengine/third_party/ee_theme/', 'author/ee_theme'), @@ -311,6 +321,8 @@ array('lavalite-package', 'packages/my_group/my_package/', 'my_group/my_package'), array('lithium-library', 'libraries/li3_test/', 'user/li3_test'), array('magento-library', 'lib/foo/', 'test/foo'), + array('majima-plugin', 'plugins/MyPlugin/', 'shama/my-plugin'), + array('modx-extra', 'core/packages/extra/', 'vendor/extra'), array('modxevo-snippet', 'assets/snippets/my_snippet/', 'shama/my_snippet'), array('modxevo-plugin', 'assets/plugins/my_plugin/', 'shama/my_plugin'), array('modxevo-module', 'assets/modules/my_module/', 'shama/my_module'), @@ -332,6 +344,10 @@ array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'), array('prestashop-module', 'modules/a-module/', 'vendor/a-module'), array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'), + array('pxcms-module', 'app/Modules/Foo/', 'vendor/module-foo'), + array('pxcms-module', 'app/Modules/Foo/', 'vendor/pxcms-foo'), + array('pxcms-theme', 'themes/Foo/', 'vendor/theme-foo'), + array('pxcms-theme', 'themes/Foo/', 'vendor/pxcms-foo'), array('phpbb-extension', 'ext/test/foo/', 'test/foo'), array('phpbb-style', 'styles/foo/', 'test/foo'), array('phpbb-language', 'language/foo/', 'test/foo'), @@ -525,7 +541,7 @@ $package = new Package('foo', '1.0.0', '1.0.0'); $installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer)); - $installer->expects($this->once())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo')); + $installer->expects($this->atLeastOnce())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo')); $repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface'); $repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true)); diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,8 +4,9 @@ use Composer\Installers\MayaInstaller; use Composer\Package\Package; use Composer\Composer; +use PHPUnit\Framework\TestCase as BaseTestCase; -class MayaInstallerTest extends \PHPUnit_Framework_TestCase +class MayaInstallerTest extends BaseTestCase { /** * @var MayaInstaller diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,8 +4,9 @@ use Composer\Installers\MediaWikiInstaller; use Composer\Package\Package; use Composer\Composer; +use PHPUnit\Framework\TestCase as BaseTestCase; -class MediaWikiInstallerTest extends \PHPUnit_Framework_TestCase +class MediaWikiInstallerTest extends BaseTestCase { /** * @var MediaWikiInstaller diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,8 +4,9 @@ use Composer\Installers\OctoberInstaller; use Composer\Package\Package; use Composer\Composer; +use PHPUnit\Framework\TestCase as BaseTestCase; -class OctoberInstallerTest extends \PHPUnit_Framework_TestCase +class OctoberInstallerTest extends BaseTestCase { /** * @var OctoberInstaller @@ -63,4 +64,4 @@ ), ); } -} \ No newline at end of file +} diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,14 +2,13 @@ namespace Composer\Installers\Test; use Composer\Installers\OntoWikiInstaller; -use Composer\Package\Package; -use Composer\Composer; +use PHPUnit\Framework\TestCase as BaseTestCase; /** * Test for the OntoWikiInstaller * code was taken from DokuWikiInstaller */ -class OntoWikiInstallerTest extends \PHPUnit_Framework_TestCase +class OntoWikiInstallerTest extends BaseTestCase { /** * @var OntoWikiInstaller diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/SiteDirectInstallerTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/SiteDirectInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,120 @@ +package = new Package('sitedirect/some_name', '1.0.9', '1.0'); + $this->installer = new SiteDirectInstaller( + $this->package, + new Composer() + ); + + } + + /** + * @dataProvider dataProvider + */ + public function testInflectPackageVars($data, $expected) + { + $result = $this->installer->inflectPackageVars($data); + $this->assertEquals($result, $expected); + } + + /** + * @dataProvider dataProvider + */ + public function testInstallPath($data, $expected) + { + $result = $this->installer->inflectPackageVars($data); + $path = $this->createPackage($data); + + // use $result to get the proper capitalization for the vendor path + $expectedPath = "modules/{$result['vendor']}/{$result['name']}/"; + $notExpectedPath = "modules/{$data['vendor']}/{$data['name']}/"; + $this->assertEquals($expectedPath, $path); + $this->assertNotEquals($notExpectedPath, $path); + } + + /** + * @param $data + * @return string + */ + private function createPackage($data) + { + $fullName = "{$data['vendor']}/{$data['name']}"; + + $package = new Package($fullName, '1.0', '1.0'); + $package->setType('sitedirect-module'); + $installer = new SiteDirectInstaller($package, new Composer()); + + $path = $installer->getInstallPath($package, 'sitedirect'); + return $path; + } + + public function dataProvider() + { + return array( + array( + 'data' => array( + 'name' => 'kernel', + 'vendor' => 'sitedirect', + 'type' => 'sitedirect-module', + ), + 'expected' => array( + 'name' => 'Kernel', + 'vendor' => 'SiteDirect', + 'type' => 'sitedirect-module', + ) + ), + array( + 'data' => array( + 'name' => 'that_guy', + 'vendor' => 'whatGuy', + 'type' => 'sitedirect-module', + ), + 'expected' => array( + 'name' => 'ThatGuy', + 'vendor' => 'whatGuy', + 'type' => 'sitedirect-module', + ) + ), + array( + 'data' => array( + 'name' => 'checkout', + 'vendor' => 'someVendor', + 'type' => 'sitedirect-plugin', + ), + 'expected' => array( + 'name' => 'Checkout', + 'vendor' => 'someVendor', + 'type' => 'sitedirect-plugin', + ) + ), + array( + 'data' => array( + 'name' => 'checkout', + 'vendor' => 'siteDirect', + 'type' => 'sitedirect-plugin', + ), + 'expected' => array( + 'name' => 'Checkout', + 'vendor' => 'SiteDirect', + 'type' => 'sitedirect-plugin', + ) + ), + ); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,8 +4,9 @@ use Composer\Installers\SyDESInstaller; use Composer\Package\Package; use Composer\Composer; +use PHPUnit\Framework\TestCase as BaseTestCase; -class SyDESInstallerTest extends \PHPUnit_Framework_TestCase +class SyDESInstallerTest extends BaseTestCase { /** * @var SyDESInstaller diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,8 +17,9 @@ use Composer\Package\AliasPackage; use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Util\Filesystem; +use PHPUnit\Framework\TestCase as BaseTestCase; -abstract class TestCase extends \PHPUnit_Framework_TestCase +abstract class TestCase extends BaseTestCase { private static $parser; diff -r bfffd8d7479a -r 7a779792577d vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php --- a/vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,8 +4,9 @@ use Composer\Installers\VgmcpInstaller; use Composer\Package\Package; use Composer\Composer; +use PHPUnit\Framework\TestCase as BaseTestCase; -class VgmcpInstallerTest extends \PHPUnit_Framework_TestCase +class VgmcpInstallerTest extends BaseTestCase { /** * @var VgmcpInstaller diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/annotated-command/.travis.yml --- a/vendor/consolidation/annotated-command/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/annotated-command/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -4,18 +4,23 @@ # Only test the master branch and SemVer tags. only: - master - - /^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+.*$/ + - '/^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+.*$/' matrix: include: - - php: 7.1 - env: dependencies=highest - - php: 7.0 - - php: 5.6 - - php: 5.5 - env: dependencies=lowest - - php: 5.4 - env: dependencies=lowest + - + php: 7.1 + env: 'HIGHEST_LOWEST="update" STABILITY="RC"' + - + php: 7.0.11 + env: DO_POST_BUILD_ACTIONS=1 + - + php: 5.6 + - + php: 5.5 + - + php: 5.4 + env: 'HIGHEST_LOWEST="update --prefer-lowest"' sudo: false @@ -24,13 +29,71 @@ - $HOME/.composer/cache before_script: - - if [ -z "$dependencies" ]; then composer install --prefer-dist; fi; - - if [ "$dependencies" = "lowest" ]; then composer update --prefer-dist --prefer-lowest -n; fi; - - if [ "$dependencies" = "highest" ]; then composer update --prefer-dist -n; fi; + # If running a highest/lowest dependencies test, get rid of composer.lock + - | + if [ -n "$HIGHEST_LOWEST" ] ; then + rm composer.lock + composer config --unset platform.php + composer config minimum-stability ${STABILITY-stable} + fi + - 'composer -n ${HIGHEST_LOWEST-install} --prefer-dist' + - composer why symfony/console + # Print out all of the installed packages in alphabetical order, with versions + - composer licenses script: - vendor/bin/phpunit - - vendor/bin/phpcs --standard=PSR2 -n src + - 'vendor/bin/phpcs --standard=PSR2 -n src' after_success: - - travis_retry php vendor/bin/coveralls -v + - 'travis_retry php vendor/bin/coveralls -v' + - | + # Only do post-build actions in one environment, and only if there is a GITHUB token. + if [ -z "$DO_POST_BUILD_ACTIONS" ] ; then + return + fi + if [ -z "$GITHUB_TOKEN" ]; then + echo "No GITHUB_TOKEN defined; exiting." + return + fi + ### + # Run composer lock update on cron jobs. + # See: https://github.com/danielbachhuber/composer-lock-updater + ### + if [ "$TRAVIS_EVENT_TYPE" != "cron" ] ; then + echo "Not a cron job; exiting." + return + fi + ### + # Only run on one job of a master branch build + ### + if [ "master" != "$TRAVIS_BRANCH" ] ; then + echo "composer.lock update only runs on the master branch." + return + fi + ### + # Install composer-lock-updater + ### + export PATH="$HOME/.composer/vendor/bin:$PATH" + composer global require danielbachhuber/composer-lock-updater + ### + # Optional: install Sensio Labs security checker to include security advisories in PR comments + ### + mkdir -p $HOME/bin + wget -O $HOME/bin/security-checker.phar http://get.sensiolabs.org/security-checker.phar + chmod +x $HOME/bin/security-checker.phar + export PATH="$HOME/bin:$PATH" + ### + # Install hub for creating GitHub pull requests + ### + wget -O hub.tgz https://github.com/github/hub/releases/download/v2.2.9/hub-linux-amd64-2.2.9.tgz + tar -zxvf hub.tgz + export PATH=$PATH:$PWD/hub-linux-amd64-2.2.9/bin/ + ### + # Run composer-lock-updater + ### + clu + + + + diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/annotated-command/CHANGELOG.md --- a/vendor/consolidation/annotated-command/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/annotated-command/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,14 +1,18 @@ # Change Log -### 2.8.1 +### 2.8.2 - 29 Nov 2017 + +- Allow Symfony 4 components. + +### 2.8.1 - 16 Oct 2017 - Add hook methods to allow Symfony command events to be added directly to the hook manager, givig better control of hook order. (#131) -### 2.8.0 +### 2.8.0 - 13 Oct 2017 - Remove phpdocumentor/reflection-docblock in favor of using a bespoke parser (#130) -### 2.7.0 +### 2.7.0 - 18 Sept 2017 - Add support for options with a default value of 'true' (#119) - BUGFIX: Improve handling of options with optional values, which previously was not working correctly. (#118) diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/annotated-command/composer.json --- a/vendor/consolidation/annotated-command/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/annotated-command/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -22,13 +22,13 @@ "php": ">=5.4.0", "consolidation/output-formatters": "^3.1.12", "psr/log": "^1", - "symfony/console": "^2.8|~3", - "symfony/event-dispatcher": "^2.5|^3", - "symfony/finder": "^2.5|^3" + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", + "satooshi/php-coveralls": "^1.0.2 | dev-master", "squizlabs/php_codesniffer": "^2.7" }, "config": { diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/annotated-command/composer.lock --- a/vendor/consolidation/annotated-command/composer.lock Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/annotated-command/composer.lock Fri Feb 23 15:52:07 2018 +0000 @@ -4,30 +4,30 @@ "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": "2d6f92db2ccefd09bfaa429476c80ac6", + "content-hash": "0a26ebe5250ce150e1e8cbafec298926", "packages": [ { "name": "consolidation/output-formatters", - "version": "3.1.12", + "version": "3.1.13", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a" + "reference": "3188461e965b32148c8fb85261833b2b72d34b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", - "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/3188461e965b32148c8fb85261833b2b72d34b8c", + "reference": "3188461e965b32148c8fb85261833b2b72d34b8c", "shasum": "" }, "require": { "php": ">=5.4.0", - "symfony/console": "^2.8|~3", - "symfony/finder": "~2.5|~3.0" + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", + "satooshi/php-coveralls": "^1.0.2 | dev-master", "squizlabs/php_codesniffer": "^2.7", "victorjonsson/markdowndocs": "^1.3" }, @@ -53,7 +53,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-10-12T19:38:03+00:00" + "time": "2017-11-29T15:25:38+00:00" }, { "name": "psr/log", @@ -104,16 +104,16 @@ }, { "name": "symfony/console", - "version": "v3.3.10", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c" + "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c", - "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c", + "url": "https://api.github.com/repos/symfony/console/zipball/63cd7960a0a522c3537f6326706d7f3b8de65805", + "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805", "shasum": "" }, "require": { @@ -168,20 +168,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-16T15:24:32+00:00" }, { "name": "symfony/debug", - "version": "v3.3.10", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd" + "reference": "74557880e2846b5c84029faa96b834da37e29810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", - "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", + "url": "https://api.github.com/repos/symfony/debug/zipball/74557880e2846b5c84029faa96b834da37e29810", + "reference": "74557880e2846b5c84029faa96b834da37e29810", "shasum": "" }, "require": { @@ -224,20 +224,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-10T16:38:39+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.3.10", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423" + "reference": "271d8c27c3ec5ecee6e2ac06016232e249d638d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d7ba037e4b8221956ab1e221c73c9e27e05dd423", - "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/271d8c27c3ec5ecee6e2ac06016232e249d638d9", + "reference": "271d8c27c3ec5ecee6e2ac06016232e249d638d9", "shasum": "" }, "require": { @@ -287,20 +287,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-05T15:47:03+00:00" }, { "name": "symfony/finder", - "version": "v3.3.10", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "773e19a491d97926f236942484cb541560ce862d" + "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/773e19a491d97926f236942484cb541560ce862d", - "reference": "773e19a491d97926f236942484cb541560ce862d", + "url": "https://api.github.com/repos/symfony/finder/zipball/138af5ec075d4b1d1bd19de08c38a34bb2d7d880", + "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880", "shasum": "" }, "require": { @@ -336,20 +336,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-05T15:47:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -361,7 +361,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -395,7 +395,7 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-10-11T12:05:26+00:00" } ], "packages-dev": [ @@ -454,67 +454,44 @@ "time": "2015-06-14T21:17:01+00:00" }, { - "name": "guzzle/guzzle", - "version": "v3.8.1", + "name": "guzzlehttp/guzzle", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", - "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", "shasum": "" }, "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": ">=2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" }, "require-dev": { - "doctrine/cache": "*", - "monolog/monolog": "1.*", - "phpunit/phpunit": "3.7.*", - "psr/log": "1.0.*", - "symfony/class-loader": "*", - "zendframework/zend-cache": "<2.3", - "zendframework/zend-log": "<2.3" + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.8-dev" + "dev-master": "6.2-dev" } }, "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -526,25 +503,136 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-06-22T18:50:49+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" }, { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "client", - "curl", - "framework", "http", - "http client", - "rest", - "web service" + "message", + "request", + "response", + "stream", + "uri", + "url" ], - "abandoned": "guzzlehttp/guzzle", - "time": "2014-01-28T22:29:15+00:00" + "time": "2017-03-20T17:10:46+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -602,22 +690,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.2.2", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.3.0", + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -643,20 +731,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-08T06:39:58+00:00" + "time": "2017-11-10T14:09:06+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.3.0", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { @@ -690,20 +778,20 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-06-03T08:32:36+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", "shasum": "" }, "require": { @@ -715,7 +803,7 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { @@ -753,7 +841,7 @@ "spy", "stub" ], - "time": "2017-09-04T11:05:03+00:00" + "time": "2017-11-24T13:59:53+00:00" }, { "name": "phpunit/php-code-coverage", @@ -819,16 +907,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -862,7 +950,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -1132,29 +1220,82 @@ "time": "2015-10-02T06:51:40+00:00" }, { - "name": "satooshi/php-coveralls", - "version": "v1.0.1", + "name": "psr/http-message", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c" + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/da51d304fe8622bf9a6da39a8446e7afd432115c", - "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "satooshi/php-coveralls", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "c9d3fe2327c8539f1105dc19954673ba993e4ad9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/c9d3fe2327c8539f1105dc19954673ba993e4ad9", + "reference": "c9d3fe2327c8539f1105dc19954673ba993e4ad9", "shasum": "" }, "require": { "ext-json": "*", "ext-simplexml": "*", - "guzzle/guzzle": "^2.8|^3.0", - "php": ">=5.3.3", + "guzzlehttp/guzzle": "^6.0", + "php": "^5.5 || ^7.0", "psr/log": "^1.0", - "symfony/config": "^2.1|^3.0", - "symfony/console": "^2.1|^3.0", - "symfony/stopwatch": "^2.0|^3.0", - "symfony/yaml": "^2.0|^3.0" + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" }, "suggest": { "symfony/http-kernel": "Allows Symfony integration" @@ -1163,9 +1304,14 @@ "bin/coveralls" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "psr-4": { - "Satooshi\\": "src/Satooshi/" + "PhpCoveralls\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1176,18 +1322,35 @@ { "name": "Kitamura Satoshi", "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" + "homepage": "https://www.facebook.com/satooshi.jp", + "role": "Original creator" + }, + { + "name": "Takashi Matsuo", + "email": "tmatsuo@google.com" + }, + { + "name": "Google Inc" + }, + { + "name": "Dariusz Ruminski", + "email": "dariusz.ruminski@gmail.com", + "homepage": "https://github.com/keradus" + }, + { + "name": "Contributors", + "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" } ], "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", + "homepage": "https://github.com/php-coveralls/php-coveralls", "keywords": [ "ci", "coverage", "github", "test" ], - "time": "2016-01-20T17:35:46+00:00" + "time": "2017-10-14T23:16:28+00:00" }, { "name": "sebastian/comparator", @@ -1641,16 +1804,16 @@ }, { "name": "symfony/config", - "version": "v3.3.10", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "4ab62407bff9cd97c410a7feaef04c375aaa5cfd" + "reference": "8d2649077dc54dfbaf521d31f217383d82303c5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/4ab62407bff9cd97c410a7feaef04c375aaa5cfd", - "reference": "4ab62407bff9cd97c410a7feaef04c375aaa5cfd", + "url": "https://api.github.com/repos/symfony/config/zipball/8d2649077dc54dfbaf521d31f217383d82303c5f", + "reference": "8d2649077dc54dfbaf521d31f217383d82303c5f", "shasum": "" }, "require": { @@ -1699,20 +1862,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-10-04T18:56:58+00:00" + "time": "2017-11-07T14:16:22+00:00" }, { "name": "symfony/filesystem", - "version": "v3.3.10", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" + "reference": "77db266766b54db3ee982fe51868328b887ce15c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/77db266766b54db3ee982fe51868328b887ce15c", + "reference": "77db266766b54db3ee982fe51868328b887ce15c", "shasum": "" }, "require": { @@ -1748,20 +1911,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-10-03T13:33:10+00:00" + "time": "2017-11-07T14:12:55+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.3.10", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "170edf8b3247d7b6779eb6fa7428f342702ca184" + "reference": "1e93c3139ef6c799831fe03efd0fb1c7aecb3365" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/170edf8b3247d7b6779eb6fa7428f342702ca184", - "reference": "170edf8b3247d7b6779eb6fa7428f342702ca184", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1e93c3139ef6c799831fe03efd0fb1c7aecb3365", + "reference": "1e93c3139ef6c799831fe03efd0fb1c7aecb3365", "shasum": "" }, "require": { @@ -1797,20 +1960,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-10T19:02:53+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.10", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0938408c4faa518d95230deabb5f595bf0de31b9", + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9", "shasum": "" }, "require": { @@ -1852,7 +2015,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-10-05T14:43:42+00:00" + "time": "2017-11-10T18:26:04+00:00" }, { "name": "webmozart/assert", @@ -1907,7 +2070,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "satooshi/php-coveralls": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/output-formatters/.travis.yml --- a/vendor/consolidation/output-formatters/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/output-formatters/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -8,13 +8,18 @@ matrix: include: - - php: 7.1 - env: dependencies=highest - - php: 7.0 - - php: 5.6 - - php: 5.5 - - php: 5.4 - env: dependencies=lowest + - + php: 7.1 + env: 'HIGHEST_LOWEST="update" STABILITY="RC"' + - + php: 7.0.11 + - + php: 5.6 + - + php: 5.5 + - + php: 5.4 + env: 'HIGHEST_LOWEST="update --prefer-lowest"' sudo: false @@ -24,9 +29,17 @@ - $HOME/.composer/cache before_script: - - if [ -z "$dependencies" ]; then composer install --prefer-dist; fi; - - if [ "$dependencies" = "lowest" ]; then composer update --prefer-dist --prefer-lowest -n; fi; - - if [ "$dependencies" = "highest" ]; then composer update --prefer-dist -n; fi; + # If running a highest/lowest dependencies test, get rid of composer.lock + - | + if [ -n "$HIGHEST_LOWEST" ] ; then + rm composer.lock + composer config --unset platform.php + composer config minimum-stability ${STABILITY-stable} + fi + - 'composer -n ${HIGHEST_LOWEST-install} --prefer-dist' + - composer why symfony/console + # Print out all of the installed packages in alphabetical order, with versions + - composer licenses script: - vendor/bin/phpunit diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/output-formatters/CHANGELOG.md --- a/vendor/consolidation/output-formatters/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/output-formatters/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,5 +1,10 @@ # Change Log +### 3.1.13 - 29 November 2017 + +- Allow XML output for RowsOfFields (#60). +- Allow Symfony 4 components and add make tests run on three versions of Symfony. + ### 3.1.12 - 12 October 2017 - Bugfix: Use InputOption::VALUE_REQUIRED instead of InputOption::VALUE_OPTIONAL diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/output-formatters/appveyor.yml --- a/vendor/consolidation/output-formatters/appveyor.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/output-formatters/appveyor.yml Fri Feb 23 15:52:07 2018 +0000 @@ -48,7 +48,10 @@ - cd %APPVEYOR_BUILD_FOLDER% #- appveyor DownloadFile https://getcomposer.org/composer.phar - php -r "readfile('http://getcomposer.org/installer');" | php - #Install dependencies via Composer + #Install dependencies via Composer. + #Newer versions of the dependencies have whitespace differences that break tests. + #Maybe we should fix and do highest/lowest here someday. + - copy composer.windows.lock composer.lock - php composer.phar -q install --prefer-dist -n - SET PATH=%APPVEYOR_BUILD_FOLDER%;%APPVEYOR_BUILD_FOLDER%/vendor/bin;%PATH% #Create a sandbox for testing. Don't think we need this. diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/output-formatters/composer.json --- a/vendor/consolidation/output-formatters/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/output-formatters/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -20,12 +20,12 @@ }, "require": { "php": ">=5.4.0", - "symfony/console": "^2.8|~3", - "symfony/finder": "~2.5|~3.0" + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", + "satooshi/php-coveralls": "^1.0.2 | dev-master", "squizlabs/php_codesniffer": "^2.7", "victorjonsson/markdowndocs": "^1.3" }, @@ -39,5 +39,10 @@ "branch-alias": { "dev-master": "3.x-dev" } + }, + "config": { + "platform": { + "php": "5.6" + } } } diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/output-formatters/composer.lock --- a/vendor/consolidation/output-formatters/composer.lock Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/output-formatters/composer.lock Fri Feb 23 15:52:07 2018 +0000 @@ -4,7 +4,7 @@ "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": "53383765106ab1ba9cdfba5be3aecd2c", + "content-hash": "146e545ed52a26233e2be70eddd6be2a", "packages": [ { "name": "psr/log", @@ -55,25 +55,30 @@ }, { "name": "symfony/console", - "version": "v3.2.3", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936" + "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7a8405a9fc175f87fed8a3c40856b0d866d61936", - "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936", + "url": "https://api.github.com/repos/symfony/console/zipball/63cd7960a0a522c3537f6326706d7f3b8de65805", + "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/debug": "~2.8|~3.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, "require-dev": { "psr/log": "~1.0", + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", "symfony/event-dispatcher": "~2.8|~3.0", "symfony/filesystem": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" @@ -87,7 +92,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -114,37 +119,36 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-02-06T12:04:21+00:00" + "time": "2017-11-16T15:24:32+00:00" }, { "name": "symfony/debug", - "version": "v3.2.3", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477" + "reference": "74557880e2846b5c84029faa96b834da37e29810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/b4d9818f127c60ce21ed62c395da7df868dc8477", - "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477", + "url": "https://api.github.com/repos/symfony/debug/zipball/74557880e2846b5c84029faa96b834da37e29810", + "reference": "74557880e2846b5c84029faa96b834da37e29810", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -171,29 +175,29 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-01-28T02:37:08+00:00" + "time": "2017-11-10T16:38:39+00:00" }, { "name": "symfony/finder", - "version": "v3.2.3", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8c71141cae8e2957946b403cc71a67213c0380d6" + "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8c71141cae8e2957946b403cc71a67213c0380d6", - "reference": "8c71141cae8e2957946b403cc71a67213c0380d6", + "url": "https://api.github.com/repos/symfony/finder/zipball/138af5ec075d4b1d1bd19de08c38a34bb2d7d880", + "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -220,20 +224,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-01-02T20:32:22+00:00" + "time": "2017-11-05T15:47:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -245,7 +249,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -279,7 +283,7 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2017-10-11T12:05:26+00:00" } ], "packages-dev": [ @@ -338,70 +342,44 @@ "time": "2015-06-14T21:17:01+00:00" }, { - "name": "guzzle/guzzle", - "version": "v3.9.3", + "name": "guzzlehttp/guzzle", + "version": "6.3.0", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", "shasum": "" }, "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" }, "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" }, "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.9-dev" + "dev-master": "6.2-dev" } }, "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -413,38 +391,149 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-06-22T18:50:49+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" }, { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "client", - "curl", - "framework", "http", - "http client", - "rest", - "web service" + "message", + "request", + "response", + "stream", + "uri", + "url" ], - "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18T18:23:50+00:00" + "time": "2017-03-20T17:10:46+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -485,26 +574,26 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -530,24 +619,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2017-11-10T14:09:06+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -577,37 +666,37 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0|^2.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpspec/phpspec": "^2.0", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -640,7 +729,7 @@ "spy", "stub" ], - "time": "2016-11-21T14:58:47+00:00" + "time": "2017-11-24T13:59:53+00:00" }, { "name": "phpunit/php-code-coverage", @@ -706,16 +795,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -749,7 +838,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -794,25 +883,30 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -834,20 +928,20 @@ "keywords": [ "timer" ], - "time": "2016-05-12T18:03:57+00:00" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.9", + "version": "1.4.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", "shasum": "" }, "require": { @@ -883,20 +977,20 @@ "keywords": [ "tokenizer" ], - "time": "2016-11-15T14:06:22+00:00" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.35", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -955,7 +1049,7 @@ "testing", "xunit" ], - "time": "2017-02-06T05:18:07+00:00" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -1014,29 +1108,82 @@ "time": "2015-10-02T06:51:40+00:00" }, { - "name": "satooshi/php-coveralls", - "version": "v1.0.1", + "name": "psr/http-message", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c" + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/da51d304fe8622bf9a6da39a8446e7afd432115c", - "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "satooshi/php-coveralls", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "c9d3fe2327c8539f1105dc19954673ba993e4ad9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/c9d3fe2327c8539f1105dc19954673ba993e4ad9", + "reference": "c9d3fe2327c8539f1105dc19954673ba993e4ad9", "shasum": "" }, "require": { "ext-json": "*", "ext-simplexml": "*", - "guzzle/guzzle": "^2.8|^3.0", - "php": ">=5.3.3", + "guzzlehttp/guzzle": "^6.0", + "php": "^5.5 || ^7.0", "psr/log": "^1.0", - "symfony/config": "^2.1|^3.0", - "symfony/console": "^2.1|^3.0", - "symfony/stopwatch": "^2.0|^3.0", - "symfony/yaml": "^2.0|^3.0" + "symfony/config": "^2.1 || ^3.0 || ^4.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0", + "symfony/yaml": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0" }, "suggest": { "symfony/http-kernel": "Allows Symfony integration" @@ -1045,9 +1192,14 @@ "bin/coveralls" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "psr-4": { - "Satooshi\\": "src/Satooshi/" + "PhpCoveralls\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1058,18 +1210,35 @@ { "name": "Kitamura Satoshi", "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" + "homepage": "https://www.facebook.com/satooshi.jp", + "role": "Original creator" + }, + { + "name": "Takashi Matsuo", + "email": "tmatsuo@google.com" + }, + { + "name": "Google Inc" + }, + { + "name": "Dariusz Ruminski", + "email": "dariusz.ruminski@gmail.com", + "homepage": "https://github.com/keradus" + }, + { + "name": "Contributors", + "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" } ], "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", + "homepage": "https://github.com/php-coveralls/php-coveralls", "keywords": [ "ci", "coverage", "github", "test" ], - "time": "2016-01-20T17:35:46+00:00" + "time": "2017-10-14T23:16:28+00:00" }, { "name": "sebastian/comparator", @@ -1137,23 +1306,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "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" }, "type": "library", "extra": { @@ -1185,7 +1354,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -1357,16 +1526,16 @@ }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "shasum": "" }, "require": { @@ -1406,7 +1575,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11T19:50:13+00:00" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/version", @@ -1445,16 +1614,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.8.0", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "86dd55a522238211f9f3631e3361703578941d9a" + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/86dd55a522238211f9f3631e3361703578941d9a", - "reference": "86dd55a522238211f9f3631e3361703578941d9a", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", "shasum": "" }, "require": { @@ -1519,27 +1688,33 @@ "phpcs", "standards" ], - "time": "2017-02-02T03:30:00+00:00" + "time": "2017-05-22T02:43:20+00:00" }, { "name": "symfony/config", - "version": "v3.2.3", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "2ffa7b84d647b8be1788d46b44e438cb3d62056c" + "reference": "8d2649077dc54dfbaf521d31f217383d82303c5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/2ffa7b84d647b8be1788d46b44e438cb3d62056c", - "reference": "2ffa7b84d647b8be1788d46b44e438cb3d62056c", + "url": "https://api.github.com/repos/symfony/config/zipball/8d2649077dc54dfbaf521d31f217383d82303c5f", + "reference": "8d2649077dc54dfbaf521d31f217383d82303c5f", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/filesystem": "~2.8|~3.0" }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, "require-dev": { + "symfony/dependency-injection": "~3.3", + "symfony/finder": "~3.3", "symfony/yaml": "~3.0" }, "suggest": { @@ -1548,7 +1723,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1575,89 +1750,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-02-06T12:04:21+00:00" + "time": "2017-11-07T14:16:22+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v2.8.17", + "name": "symfony/filesystem", + "version": "v3.3.13", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "74877977f90fb9c3e46378d5764217c55f32df34" + "url": "https://github.com/symfony/filesystem.git", + "reference": "77db266766b54db3ee982fe51868328b887ce15c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74877977f90fb9c3e46378d5764217c55f32df34", - "reference": "74877977f90fb9c3e46378d5764217c55f32df34", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/77db266766b54db3ee982fe51868328b887ce15c", + "reference": "77db266766b54db3ee982fe51868328b887ce15c", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2017-01-02T20:30:24+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v3.2.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", - "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1684,29 +1799,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-01-08T20:47:33+00:00" + "time": "2017-11-07T14:12:55+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.2.3", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "9aa0b51889c01bca474853ef76e9394b02264464" + "reference": "1e93c3139ef6c799831fe03efd0fb1c7aecb3365" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/9aa0b51889c01bca474853ef76e9394b02264464", - "reference": "9aa0b51889c01bca474853ef76e9394b02264464", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1e93c3139ef6c799831fe03efd0fb1c7aecb3365", + "reference": "1e93c3139ef6c799831fe03efd0fb1c7aecb3365", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1733,24 +1848,24 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-01-02T20:32:22+00:00" + "time": "2017-11-10T19:02:53+00:00" }, { "name": "symfony/yaml", - "version": "v3.2.3", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e1718c6bf57e1efbb8793ada951584b2ab27775b" + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e1718c6bf57e1efbb8793ada951584b2ab27775b", - "reference": "e1718c6bf57e1efbb8793ada951584b2ab27775b", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0938408c4faa518d95230deabb5f595bf0de31b9", + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "require-dev": { "symfony/console": "~2.8|~3.0" @@ -1761,7 +1876,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1788,20 +1903,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-01-21T17:06:35+00:00" + "time": "2017-11-10T18:26:04+00:00" }, { "name": "victorjonsson/markdowndocs", - "version": "1.3.7", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator.git", - "reference": "a8244617cdce4804cd94ea508c82e8d7e29a273a" + "reference": "c5eb16ff5bd15ee60223883ddacba0ab8797268d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/victorjonsson/PHP-Markdown-Documentation-Generator/zipball/a8244617cdce4804cd94ea508c82e8d7e29a273a", - "reference": "a8244617cdce4804cd94ea508c82e8d7e29a273a", + "url": "https://api.github.com/repos/victorjonsson/PHP-Markdown-Documentation-Generator/zipball/c5eb16ff5bd15ee60223883ddacba0ab8797268d", + "reference": "c5eb16ff5bd15ee60223883ddacba0ab8797268d", "shasum": "" }, "require": { @@ -1832,7 +1947,7 @@ ], "description": "Command line tool for generating markdown-formatted class documentation", "homepage": "https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator", - "time": "2016-10-11T21:10:19+00:00" + "time": "2017-04-20T09:52:47+00:00" }, { "name": "webmozart/assert", @@ -1887,11 +2002,16 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "satooshi/php-coveralls": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=5.4.0" }, - "platform-dev": [] + "platform-dev": [], + "platform-overrides": { + "php": "5.6" + } } diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/output-formatters/composer.windows.lock --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/consolidation/output-formatters/composer.windows.lock Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,1897 @@ +{ + "_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": "53383765106ab1ba9cdfba5be3aecd2c", + "packages": [ + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "symfony/console", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/7a8405a9fc175f87fed8a3c40856b0d866d61936", + "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/filesystem": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-02-06T12:04:21+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/b4d9818f127c60ce21ed62c395da7df868dc8477", + "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-01-28T02:37:08+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "8c71141cae8e2957946b403cc71a67213c0380d6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/8c71141cae8e2957946b403cc71a67213c0380d6", + "reference": "8c71141cae8e2957946b403cc71a67213c0380d6", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "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 Finder Component", + "homepage": "https://symfony.com", + "time": "2017-01-02T20:32:22+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14T01:06:16+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.9.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" + }, + "suggest": { + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.9-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27T11:43:31+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-09-30T07:12:33+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-11-25T06:54:22+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.6.2", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0|^2.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.0", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2016-11-21T14:58:47+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "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.3.2", + "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.2.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-10-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03T07:40:28+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, + "type": "library", + "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": "2016-05-12T18:03:57+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", + "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": "2016-11-15T14:06:22+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.35", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", + "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.2.2", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-02-06T05:18:07+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-10-02T06:51:40+00:00" + }, + { + "name": "satooshi/php-coveralls", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/satooshi/php-coveralls.git", + "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/da51d304fe8622bf9a6da39a8446e7afd432115c", + "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8|^3.0", + "php": ">=5.3.3", + "psr/log": "^1.0", + "symfony/config": "^2.1|^3.0", + "symfony/console": "^2.1|^3.0", + "symfony/stopwatch": "^2.0|^3.0", + "symfony/yaml": "^2.0|^3.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/satooshi/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2016-01-20T17:35:46+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "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": "2015-12-08T07:14:41+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.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "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": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-06-17T09:04:28+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-11-11T19:50:13+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": "squizlabs/php_codesniffer", + "version": "2.8.0", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "86dd55a522238211f9f3631e3361703578941d9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/86dd55a522238211f9f3631e3361703578941d9a", + "reference": "86dd55a522238211f9f3631e3361703578941d9a", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-02-02T03:30:00+00:00" + }, + { + "name": "symfony/config", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "2ffa7b84d647b8be1788d46b44e438cb3d62056c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/2ffa7b84d647b8be1788d46b44e438cb3d62056c", + "reference": "2ffa7b84d647b8be1788d46b44e438cb3d62056c", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/filesystem": "~2.8|~3.0" + }, + "require-dev": { + "symfony/yaml": "~3.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-02-06T12:04:21+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.17", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "74877977f90fb9c3e46378d5764217c55f32df34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74877977f90fb9c3e46378d5764217c55f32df34", + "reference": "74877977f90fb9c3e46378d5764217c55f32df34", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-01-02T20:30:24+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", + "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-01-08T20:47:33+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "9aa0b51889c01bca474853ef76e9394b02264464" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/9aa0b51889c01bca474853ef76e9394b02264464", + "reference": "9aa0b51889c01bca474853ef76e9394b02264464", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2017-01-02T20:32:22+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "e1718c6bf57e1efbb8793ada951584b2ab27775b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e1718c6bf57e1efbb8793ada951584b2ab27775b", + "reference": "e1718c6bf57e1efbb8793ada951584b2ab27775b", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-01-21T17:06:35+00:00" + }, + { + "name": "victorjonsson/markdowndocs", + "version": "1.3.7", + "source": { + "type": "git", + "url": "https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator.git", + "reference": "a8244617cdce4804cd94ea508c82e8d7e29a273a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/victorjonsson/PHP-Markdown-Documentation-Generator/zipball/a8244617cdce4804cd94ea508c82e8d7e29a273a", + "reference": "a8244617cdce4804cd94ea508c82e8d7e29a273a", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": ">=2.6" + }, + "require-dev": { + "phpunit/phpunit": "3.7.23" + }, + "bin": [ + "bin/phpdoc-md" + ], + "type": "library", + "autoload": { + "psr-0": { + "PHPDocsMD": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Victor Jonsson", + "email": "kontakt@victorjonsson.se" + } + ], + "description": "Command line tool for generating markdown-formatted class documentation", + "homepage": "https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator", + "time": "2016-10-11T21:10:19+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23T20:04:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [] +} diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/output-formatters/docs/api.md --- a/vendor/consolidation/output-formatters/docs/api.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/output-formatters/docs/api.md Fri Feb 23 15:52:07 2018 +0000 @@ -51,7 +51,8 @@ - [\Consolidation\OutputFormatters\Validate\ValidationInterface (interface)](#interface-consolidationoutputformattersvalidatevalidationinterface) - [\Consolidation\OutputFormatters\Validate\ValidDataTypesInterface (interface)](#interface-consolidationoutputformattersvalidatevaliddatatypesinterface) -
    +
    + ### Class: \Consolidation\OutputFormatters\FormatterManager > Manage a collection of formatters; return one on request. @@ -80,7 +81,8 @@ | protected | simplifyToArray(mixed $structuredOutput, [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options)
    : void | | protected | validateAndRestructure([\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface) $formatter, mixed $structuredOutput, [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options) : void | -
    +
    + ### Class: \Consolidation\OutputFormatters\Exception\UnknownFormatException > Indicates that the requested format does not exist. @@ -93,7 +95,8 @@ *This class implements \Throwable* -
    +
    + ### Class: \Consolidation\OutputFormatters\Exception\AbstractDataFormatException (abstract) > Contains some helper functions used by exceptions in this project. @@ -108,7 +111,8 @@ *This class implements \Throwable* -
    +
    + ### Class: \Consolidation\OutputFormatters\Exception\IncompatibleDataException > Represents an incompatibility between the output data and selected formatter. @@ -121,7 +125,8 @@ *This class implements \Throwable* -
    +
    + ### Class: \Consolidation\OutputFormatters\Exception\InvalidFormatException > Represents an incompatibility between the output data and selected formatter. @@ -134,7 +139,8 @@ *This class implements \Throwable* -
    +
    + ### Class: \Consolidation\OutputFormatters\Exception\UnknownFieldException > Indicates that the requested format does not exist. @@ -147,7 +153,8 @@ *This class implements \Throwable* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\ListFormatter > Display the data in a simple list. This formatter prints a plain, unadorned list of data, with each data item appearing on a separate line. If you wish your list to contain headers, then use the table formatter, and wrap your data in an PropertyList. @@ -161,7 +168,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface), [\Consolidation\OutputFormatters\Transformations\OverrideRestructureInterface](#interface-consolidationoutputformatterstransformationsoverriderestructureinterface), [\Consolidation\OutputFormatters\Formatters\RenderDataInterface](#interface-consolidationoutputformattersformattersrenderdatainterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\SectionsFormatter > Display sections of data. This formatter takes data in the RowsOfFields data type. Each row represents one section; the data in each section is rendered in two columns, with the key in the first column and the value in the second column. @@ -177,7 +185,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface), [\Consolidation\OutputFormatters\Validate\ValidDataTypesInterface](#interface-consolidationoutputformattersvalidatevaliddatatypesinterface), [\Consolidation\OutputFormatters\Validate\ValidationInterface](#interface-consolidationoutputformattersvalidatevalidationinterface), [\Consolidation\OutputFormatters\Formatters\RenderDataInterface](#interface-consolidationoutputformattersformattersrenderdatainterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\JsonFormatter > Json formatter Convert an array or ArrayObject into Json. @@ -188,14 +197,16 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface)* -
    +
    + ### Interface: \Consolidation\OutputFormatters\Formatters\FormatterInterface | Visibility | Function | |:-----------|:---------| | public | write(\Symfony\Component\Console\Output\OutputInterface $output, mixed $data, [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options)
    : string
    Given structured data, apply appropriate formatting, and return a printable string. | -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\CsvFormatter > Comma-separated value formatters Display the provided structured data in a comma-separated list. If there are multiple records provided, then they will be printed one per line. The primary data types accepted are RowsOfFields and PropertyList. The later behaves exactly like the former, save for the fact that it contains but a single row. This formmatter can also accept a PHP array; this is also interpreted as a single-row of data with no header. @@ -214,7 +225,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface), [\Consolidation\OutputFormatters\Validate\ValidDataTypesInterface](#interface-consolidationoutputformattersvalidatevaliddatatypesinterface), [\Consolidation\OutputFormatters\Validate\ValidationInterface](#interface-consolidationoutputformattersvalidatevalidationinterface), [\Consolidation\OutputFormatters\Formatters\RenderDataInterface](#interface-consolidationoutputformattersformattersrenderdatainterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\SerializeFormatter > Serialize formatter Run provided date thruogh serialize. @@ -225,7 +237,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\StringFormatter > String formatter This formatter is used as the default action when no particular formatter is requested. It will print the provided data only if it is a string; if any other type is given, then nothing is printed. @@ -240,7 +253,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface), [\Consolidation\OutputFormatters\Validate\ValidationInterface](#interface-consolidationoutputformattersvalidatevalidationinterface), [\Consolidation\OutputFormatters\Options\OverrideOptionsInterface](#interface-consolidationoutputformattersoptionsoverrideoptionsinterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\VarExportFormatter > Var_export formatter Run provided date thruogh var_export. @@ -251,7 +265,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\YamlFormatter > Yaml formatter Convert an array or ArrayObject into Yaml. @@ -262,7 +277,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\TableFormatter > Display a table of data with the Symfony Table class. This formatter takes data of either the RowsOfFields or PropertyList data type. Tables can be rendered with the rows running either vertically (the normal orientation) or horizontally. By default, associative lists will be displayed as two columns, with the key in the first column and the value in the second column. @@ -281,7 +297,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface), [\Consolidation\OutputFormatters\Validate\ValidDataTypesInterface](#interface-consolidationoutputformattersvalidatevaliddatatypesinterface), [\Consolidation\OutputFormatters\Validate\ValidationInterface](#interface-consolidationoutputformattersvalidatevalidationinterface), [\Consolidation\OutputFormatters\Formatters\RenderDataInterface](#interface-consolidationoutputformattersformattersrenderdatainterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\XmlFormatter > Display a table of data with the Symfony Table class. This formatter takes data of either the RowsOfFields or PropertyList data type. Tables can be rendered with the rows running either vertically (the normal orientation) or horizontally. By default, associative lists will be displayed as two columns, with the key in the first column and the value in the second column. @@ -296,7 +313,8 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface), [\Consolidation\OutputFormatters\Validate\ValidDataTypesInterface](#interface-consolidationoutputformattersvalidatevaliddatatypesinterface), [\Consolidation\OutputFormatters\Validate\ValidationInterface](#interface-consolidationoutputformattersvalidatevalidationinterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\PrintRFormatter > Print_r formatter Run provided date thruogh print_r. @@ -307,14 +325,16 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface)* -
    +
    + ### Interface: \Consolidation\OutputFormatters\Formatters\RenderDataInterface | Visibility | Function | |:-----------|:---------| | public | renderData(mixed $originalData, mixed $restructuredData, [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options) : mixed
    Convert the contents of the output data just before it is to be printed, prior to output but after restructuring and validation. | -
    +
    + ### Class: \Consolidation\OutputFormatters\Formatters\TsvFormatter > Tab-separated value formatters Display the provided structured data in a tab-separated list. Output escaping is much lighter, since there is no allowance for altering the delimiter. @@ -331,14 +351,16 @@ *This class implements [\Consolidation\OutputFormatters\Formatters\RenderDataInterface](#interface-consolidationoutputformattersformattersrenderdatainterface), [\Consolidation\OutputFormatters\Validate\ValidationInterface](#interface-consolidationoutputformattersvalidatevalidationinterface), [\Consolidation\OutputFormatters\Validate\ValidDataTypesInterface](#interface-consolidationoutputformattersvalidatevaliddatatypesinterface), [\Consolidation\OutputFormatters\Formatters\FormatterInterface](#interface-consolidationoutputformattersformattersformatterinterface)* -
    +
    + ### Interface: \Consolidation\OutputFormatters\Options\OverrideOptionsInterface | Visibility | Function | |:-----------|:---------| | public | overrideOptions(mixed $structuredOutput, [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options) : [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions)
    Allow the formatter to mess with the configuration options before any transformations et. al. get underway. | -
    +
    + ### Class: \Consolidation\OutputFormatters\Options\FormatterOptions > FormetterOptions holds information that affects the way a formatter renders its output. There are three places where a formatter might get options from: 1. Configuration associated with the command that produced the output. This is passed in to FormatterManager::write() along with the data to format. It might originally come from annotations on the command, or it might come from another source. Examples include the field labels for a table, or the default list of fields to display. 2. Options specified by the user, e.g. by commandline options. 3. Default values associated with the formatter itself. This class caches configuration from sources (1) and (2), and expects to be provided the defaults, (3), whenever a value is requested. @@ -376,14 +398,16 @@ | protected | parse(string $key, mixed $value) : mixed
    Given the raw value for a specific key, do any type conversion (e.g. from a textual list to an array) needed for the data. | | protected | setConfigurationValue(string $key, mixed $value) : \Consolidation\OutputFormatters\Options\FormetterOptions
    Change one configuration value for this formatter option. | -
    +
    + ### Interface: \Consolidation\OutputFormatters\StructuredData\ListDataInterface | Visibility | Function | |:-----------|:---------| | public | getListData([\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options) : array
    Convert data to a format suitable for use in a list. By default, the array values will be used. Implement ListDataInterface to use some other criteria (e.g. array keys). | -
    +
    + ### Interface: \Consolidation\OutputFormatters\StructuredData\TableDataInterface | Visibility | Function | @@ -391,7 +415,8 @@ | public | getOriginalData() : mixed
    Return the original data for this table. Used by any formatter that is -not- a table. | | public | getTableData(bool/boolean $includeRowKey=false) : array
    Convert structured data into a form suitable for use by the table formatter. key from each row. | -
    +
    + ### Class: \Consolidation\OutputFormatters\StructuredData\HelpDocument | Visibility | Function | @@ -400,14 +425,16 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\Xml\DomDataInterface](#interface-consolidationoutputformattersstructureddataxmldomdatainterface)* -
    +
    + ### Interface: \Consolidation\OutputFormatters\StructuredData\OriginalDataInterface | Visibility | Function | |:-----------|:---------| | public | getOriginalData() : mixed
    Return the original data for this table. Used by any formatter that expects an array. | -
    +
    + ### Class: \Consolidation\OutputFormatters\StructuredData\RowsOfFields > Holds an array where each element of the array is one row, and each row contains an associative array where the keys are the field names, and the values are the field data. It is presumed that every row contains the same keys. @@ -422,14 +449,16 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\RenderCellInterface](#interface-consolidationoutputformattersstructureddatarendercellinterface), [\Consolidation\OutputFormatters\StructuredData\RenderCellCollectionInterface](#interface-consolidationoutputformattersstructureddatarendercellcollectioninterface), [\Consolidation\OutputFormatters\StructuredData\RestructureInterface](#interface-consolidationoutputformattersstructureddatarestructureinterface), \Countable, \Serializable, \ArrayAccess, \Traversable, \IteratorAggregate, [\Consolidation\OutputFormatters\StructuredData\ListDataInterface](#interface-consolidationoutputformattersstructureddatalistdatainterface)* -
    +
    + ### Interface: \Consolidation\OutputFormatters\StructuredData\RestructureInterface | Visibility | Function | |:-----------|:---------| | public | restructure([\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options) : void
    Allow structured data to be restructured -- i.e. to select fields to show, reorder fields, etc. | -
    +
    + ### Class: \Consolidation\OutputFormatters\StructuredData\AbstractStructuredList (abstract) > Holds an array where each element of the array is one row, and each row contains an associative array where the keys are the field names, and the values are the field data. It is presumed that every row contains the same keys. @@ -451,7 +480,8 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\ListDataInterface](#interface-consolidationoutputformattersstructureddatalistdatainterface), \IteratorAggregate, \Traversable, \ArrayAccess, \Serializable, \Countable, [\Consolidation\OutputFormatters\StructuredData\RestructureInterface](#interface-consolidationoutputformattersstructureddatarestructureinterface), [\Consolidation\OutputFormatters\StructuredData\RenderCellCollectionInterface](#interface-consolidationoutputformattersstructureddatarendercellcollectioninterface), [\Consolidation\OutputFormatters\StructuredData\RenderCellInterface](#interface-consolidationoutputformattersstructureddatarendercellinterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\StructuredData\ListDataFromKeys > Represents aribtrary array data (structured or unstructured) where the data to display in --list format comes from the array keys. @@ -465,7 +495,8 @@ *This class implements \Countable, \Serializable, \ArrayAccess, \Traversable, \IteratorAggregate, [\Consolidation\OutputFormatters\StructuredData\ListDataInterface](#interface-consolidationoutputformattersstructureddatalistdatainterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\StructuredData\PropertyList > Holds an array where each element of the array is one key : value pair. The keys must be unique, as is typically the case for associative arrays. @@ -481,14 +512,16 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\RenderCellInterface](#interface-consolidationoutputformattersstructureddatarendercellinterface), [\Consolidation\OutputFormatters\StructuredData\RenderCellCollectionInterface](#interface-consolidationoutputformattersstructureddatarendercellcollectioninterface), [\Consolidation\OutputFormatters\StructuredData\RestructureInterface](#interface-consolidationoutputformattersstructureddatarestructureinterface), \Countable, \Serializable, \ArrayAccess, \Traversable, \IteratorAggregate, [\Consolidation\OutputFormatters\StructuredData\ListDataInterface](#interface-consolidationoutputformattersstructureddatalistdatainterface)* -
    +
    + ### Interface: \Consolidation\OutputFormatters\StructuredData\RenderCellInterface | Visibility | Function | |:-----------|:---------| | public | renderCell(string $key, mixed $cellData, [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options, array $rowData) : mixed
    Convert the contents of one table cell into a string, so that it may be placed in the table. Renderer should return the $cellData passed to it if it does not wish to process it. | -
    +
    + ### Class: \Consolidation\OutputFormatters\StructuredData\CallableRenderer | Visibility | Function | @@ -498,7 +531,8 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\RenderCellInterface](#interface-consolidationoutputformattersstructureddatarendercellinterface)* -
    +
    + ### Interface: \Consolidation\OutputFormatters\StructuredData\RenderCellCollectionInterface | Visibility | Function | @@ -507,7 +541,8 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\RenderCellInterface](#interface-consolidationoutputformattersstructureddatarendercellinterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\StructuredData\AssociativeList > Old name for PropertyList class. @@ -519,7 +554,8 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\ListDataInterface](#interface-consolidationoutputformattersstructureddatalistdatainterface), \IteratorAggregate, \Traversable, \ArrayAccess, \Serializable, \Countable, [\Consolidation\OutputFormatters\StructuredData\RestructureInterface](#interface-consolidationoutputformattersstructureddatarestructureinterface), [\Consolidation\OutputFormatters\StructuredData\RenderCellCollectionInterface](#interface-consolidationoutputformattersstructureddatarendercellcollectioninterface), [\Consolidation\OutputFormatters\StructuredData\RenderCellInterface](#interface-consolidationoutputformattersstructureddatarendercellinterface)* -
    +
    + ### Interface: \Consolidation\OutputFormatters\StructuredData\Xml\XmlSchemaInterface > When using arrays, we could represent XML data in a number of different ways. For example, given the following XML data strucutre: blah a b c This could be: [ 'id' => 1, 'name' => 'doc', 'foobars' => [ [ 'id' => '123', 'name' => 'blah', 'widgets' => [ [ 'foo' => 'a', 'bar' => 'b', 'baz' => 'c', ] ], ], ] ] The challenge is more in going from an array back to the more structured xml format. Note that any given key => string mapping could represent either an attribute, or a simple XML element containing only a string value. In general, we do *not* want to add extra layers of nesting in the data structure to disambiguate between these kinds of data, as we want the source data to render cleanly into other formats, e.g. yaml, json, et. al., and we do not want to force every data provider to have to consider the optimal xml schema for their data. Our strategy, therefore, is to expect clients that wish to provide a very specific xml representation to return a DOMDocument, and, for other data structures where xml is a secondary concern, then we will use some default heuristics to convert from arrays to xml. @@ -528,14 +564,16 @@ |:-----------|:---------| | public | arrayToXml(mixed $structuredData) : [\DOMDocument](http://php.net/manual/en/class.domdocument.php)
    Convert data to a format suitable for use in a list. By default, the array values will be used. Implement ListDataInterface to use some other criteria (e.g. array keys). | -
    +
    + ### Interface: \Consolidation\OutputFormatters\StructuredData\Xml\DomDataInterface | Visibility | Function | |:-----------|:---------| | public | getDomData() : [\DomDocument](http://php.net/manual/en/class.domdocument.php)
    Convert data into a \DomDocument. | -
    +
    + ### Class: \Consolidation\OutputFormatters\StructuredData\Xml\XmlSchema | Visibility | Function | @@ -555,7 +593,8 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\Xml\XmlSchemaInterface](#interface-consolidationoutputformattersstructureddataxmlxmlschemainterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Transformations\PropertyParser > Transform a string of properties into a PHP associative array. Input: one: red two: white three: blue Output: [ 'one' => 'red', 'two' => 'white', 'three' => 'blue', ] @@ -564,7 +603,8 @@ |:-----------|:---------| | public static | parse(mixed $data) : void | -
    +
    + ### Class: \Consolidation\OutputFormatters\Transformations\PropertyListTableTransformation | Visibility | Function | @@ -575,7 +615,8 @@ *This class implements [\Consolidation\OutputFormatters\StructuredData\OriginalDataInterface](#interface-consolidationoutputformattersstructureddataoriginaldatainterface), [\Consolidation\OutputFormatters\StructuredData\TableDataInterface](#interface-consolidationoutputformattersstructureddatatabledatainterface), \IteratorAggregate, \Traversable, \ArrayAccess, \Serializable, \Countable* -
    +
    + ### Class: \Consolidation\OutputFormatters\Transformations\TableTransformation | Visibility | Function | @@ -599,7 +640,8 @@ *This class implements \Countable, \Serializable, \ArrayAccess, \Traversable, \IteratorAggregate, [\Consolidation\OutputFormatters\StructuredData\TableDataInterface](#interface-consolidationoutputformattersstructureddatatabledatainterface), [\Consolidation\OutputFormatters\StructuredData\OriginalDataInterface](#interface-consolidationoutputformattersstructureddataoriginaldatainterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Transformations\ReorderFields > Reorder the field labels based on the user-selected fields to display. @@ -613,7 +655,8 @@ | protected | matchFieldInLabelMap(mixed $field, mixed $fieldLabels) : void | | protected | reorderFieldLabels(mixed $fields, mixed $fieldLabels, mixed $data) : void | -
    +
    + ### Class: \Consolidation\OutputFormatters\Transformations\DomToArraySimplifier > Simplify a DOMDocument to an array. @@ -635,7 +678,8 @@ *This class implements [\Consolidation\OutputFormatters\Transformations\SimplifyToArrayInterface](#interface-consolidationoutputformatterstransformationssimplifytoarrayinterface)* -
    +
    + ### Class: \Consolidation\OutputFormatters\Transformations\WordWrapper | Visibility | Function | @@ -648,14 +692,16 @@ | protected | calculateWidths(mixed $rows, array $widths=array()) : void
    Determine what widths we'll use for wrapping. | | protected | wrapCell(mixed $cell, string $cellWidth) : mixed
    Wrap one cell. Guard against modifying non-strings and then call through to wordwrap(). | -
    +
    + ### Interface: \Consolidation\OutputFormatters\Transformations\OverrideRestructureInterface | Visibility | Function | |:-----------|:---------| | public | overrideRestructure(mixed $structuredOutput, [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options) : mixed
    Select data to use directly from the structured output, before the restructure operation has been executed. | -
    +
    + ### Interface: \Consolidation\OutputFormatters\Transformations\SimplifyToArrayInterface | Visibility | Function | @@ -663,7 +709,8 @@ | public | canSimplify([\ReflectionClass](http://php.net/manual/en/class.reflectionclass.php) $structuredOutput) : bool
    Indicate whether or not the given data type can be simplified to an array | | public | simplifyToArray(mixed $structuredOutput, [\Consolidation\OutputFormatters\Options\FormatterOptions](#class-consolidationoutputformattersoptionsformatteroptions) $options) : array
    Convert structured data into a generic array, usable by generic array-based formatters. Objects that implement this interface may be attached to the FormatterManager, and will be used on any data structure that needs to be simplified into an array. An array simplifier should take no action other than to return its input data if it cannot simplify the provided data into an array. | -
    +
    + ### Class: \Consolidation\OutputFormatters\Transformations\Wrap\CalculateWidths > Calculate column widths for table cells. Influenced by Drush and webmozart/console. @@ -679,7 +726,8 @@ | protected | calculateColumnWidths(mixed $rows, \callable $fn) : void | | protected static | longestWordLength(string $str) : int
    Return the length of the longest word in the string. | -
    +
    + ### Class: \Consolidation\OutputFormatters\Transformations\Wrap\ColumnWidths > Calculate the width of data in table cells in preparation for word wrapping. @@ -708,7 +756,8 @@ | public | widths() : void
    Return all of the lengths | | protected | findColumnsUnderThreshold(array $thresholdWidths) : mixed | -
    +
    + ### Interface: \Consolidation\OutputFormatters\Validate\ValidationInterface > Formatters may implement ValidationInterface in order to indicate whether a particular data structure is supported. Any formatter that does not implement ValidationInterface is assumed to only operate on arrays, or data types that implement SimplifyToArrayInterface. @@ -718,7 +767,8 @@ | public | isValidDataType([\ReflectionClass](http://php.net/manual/en/class.reflectionclass.php) $dataType) : bool
    Return true if the specified format is valid for use with this formatter. | | public | validate(mixed $structuredData) : mixed
    Throw an IncompatibleDataException if the provided data cannot be processed by this formatter. Return the source data if it is valid. The data may be encapsulated or converted if necessary. | -
    +
    + ### Interface: \Consolidation\OutputFormatters\Validate\ValidDataTypesInterface > Formatters may implement ValidDataTypesInterface in order to indicate exactly which formats they support. The validDataTypes method can be called to retrieve a list of data types useful in providing hints in exception messages about which data types can be used with the formatter. Note that it is OPTIONAL for formatters to implement this interface. If a formatter implements only ValidationInterface, then clients that request the formatter via FormatterManager::write() will still get a list (via an InvalidFormatException) of all of the formats that are usable with the provided data type. Implementing ValidDataTypesInterface is benefitial to clients who instantiate a formatter directly (via `new`). Formatters that implement ValidDataTypesInterface may wish to use ValidDataTypesTrait. diff -r bfffd8d7479a -r 7a779792577d vendor/consolidation/output-formatters/src/Formatters/XmlFormatter.php --- a/vendor/consolidation/output-formatters/src/Formatters/XmlFormatter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/consolidation/output-formatters/src/Formatters/XmlFormatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,6 +51,9 @@ if ($structuredData instanceof DomDataInterface) { return $structuredData->getDomData(); } + if ($structuredData instanceof \ArrayObject) { + return $structuredData->getArrayCopy(); + } if (!is_array($structuredData)) { throw new IncompatibleDataException( $this, diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/CHANGELOG.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/doctrine/annotations/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,115 @@ +## Changelog + + +### 1.4.0 + +This release fix an issue were some annotations could be not loaded if the namespace in the use statement started with a backslash. +It also update the tests and drop the support for php 5.X + +- [115: Missing annotations with the latest composer version](https://github.com/doctrine/annotations/issues/115) thanks to @pascalporedda +- [120: Missing annotations with the latest composer version](https://github.com/doctrine/annotations/pull/120) thanks to @gnat42 +- [121: Adding a more detailed explanation of the test](https://github.com/doctrine/annotations/pull/121) thanks to @mikeSimonson +- [101: Test annotation parameters containing space](https://github.com/doctrine/annotations/pull/101) thanks to @mikeSimonson +- [111: Cleanup: move to correct phpunit assertions](https://github.com/doctrine/annotations/pull/111) thanks to @Ocramius +- [112: Removes support for PHP 5.x](https://github.com/doctrine/annotations/pull/112) thanks to @railto +- [113: bumped phpunit version to 5.7](https://github.com/doctrine/annotations/pull/113) thanks to @gabbydgab +- [114: Enhancement: Use SVG Travis build badge](https://github.com/doctrine/annotations/pull/114) thanks to @localheinz +- [118: Integrating PHPStan](https://github.com/doctrine/annotations/pull/118) thanks to @ondrejmirtes + +### 1.3.1 - 2016-12-30 + +This release fixes an issue with ignored annotations that were already +autoloaded, causing the `SimpleAnnotationReader` to pick them up +anyway. [#110](https://github.com/doctrine/annotations/pull/110) + +Additionally, an issue was fixed in the `CachedReader`, which was +not correctly checking the freshness of cached annotations when +traits were defined on a class. [#105](https://github.com/doctrine/annotations/pull/105) + +Total issues resolved: **2** + +- [105: Return single max timestamp](https://github.com/doctrine/annotations/pull/105) +- [110: setIgnoreNotImportedAnnotations(true) didn’t work for existing classes](https://github.com/doctrine/annotations/pull/110) + +### 1.3.0 + +This release introduces a PHP version bump. `doctrine/annotations` now requires PHP +5.6 or later to be installed. + +A series of additional improvements have been introduced: + + * support for PHP 7 "grouped use statements" + * support for ignoring entire namespace names + via `Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredNamespace()` and + `Doctrine\Common\Annotations\DocParser::setIgnoredAnnotationNamespaces()`. This will + allow you to ignore annotations from namespaces that you cannot autoload + * testing all parent classes and interfaces when checking if the annotation cache + in the `CachedReader` is fresh + * simplifying the cache keys used by the `CachedReader`: keys are no longer artificially + namespaced, since `Doctrine\Common\Cache` already supports that + * corrected parsing of multibyte strings when `mbstring.func_overload` is enabled + * corrected parsing of annotations when `"\t"` is put before the first annotation + in a docblock + * allow skipping non-imported annotations when a custom `DocParser` is passed to + the `AnnotationReader` constructor + +Total issues resolved: **15** + +- [45: DocParser can now ignore whole namespaces](https://github.com/doctrine/annotations/pull/45) +- [57: Switch to the docker-based infrastructure on Travis](https://github.com/doctrine/annotations/pull/57) +- [59: opcache.load_comments has been removed from PHP 7](https://github.com/doctrine/annotations/pull/59) +- [62: [CachedReader\ Test traits and parent class to see if cache is fresh](https://github.com/doctrine/annotations/pull/62) +- [65: Remove cache salt making key unnecessarily long](https://github.com/doctrine/annotations/pull/65) +- [66: Fix of incorrect parsing multibyte strings](https://github.com/doctrine/annotations/pull/66) +- [68: Annotations that are indented by tab are not processed.](https://github.com/doctrine/annotations/issues/68) +- [69: Support for Group Use Statements](https://github.com/doctrine/annotations/pull/69) +- [70: Allow tab character before first annotation in DocBlock](https://github.com/doctrine/annotations/pull/70) +- [74: Ignore not registered annotations fix](https://github.com/doctrine/annotations/pull/74) +- [92: Added tests for AnnotationRegistry class.](https://github.com/doctrine/annotations/pull/92) +- [96: Fix/#62 check trait and parent class ttl in annotations](https://github.com/doctrine/annotations/pull/96) +- [97: Feature - #45 - allow ignoring entire namespaces](https://github.com/doctrine/annotations/pull/97) +- [98: Enhancement/#65 remove cache salt from cached reader](https://github.com/doctrine/annotations/pull/98) +- [99: Fix - #70 - allow tab character before first annotation in docblock](https://github.com/doctrine/annotations/pull/99) + +### 1.2.4 + +Total issues resolved: **1** + +- [51: FileCacheReader::saveCacheFile::unlink fix](https://github.com/doctrine/annotations/pull/51) + +### 1.2.3 + +Total issues resolved: [**2**](https://github.com/doctrine/annotations/milestones/v1.2.3) + +- [49: #46 - applying correct `chmod()` to generated cache file](https://github.com/doctrine/annotations/pull/49) +- [50: Hotfix: match escaped quotes (revert #44)](https://github.com/doctrine/annotations/pull/50) + +### 1.2.2 + +Total issues resolved: **4** + +- [43: Exclude files from distribution with .gitattributes](https://github.com/doctrine/annotations/pull/43) +- [44: Update DocLexer.php](https://github.com/doctrine/annotations/pull/44) +- [46: A plain "file_put_contents" can cause havoc](https://github.com/doctrine/annotations/pull/46) +- [48: Deprecating the `FileCacheReader` in 1.2.2: will be removed in 2.0.0](https://github.com/doctrine/annotations/pull/48) + +### 1.2.1 + +Total issues resolved: **4** + +- [38: fixes doctrine/common#326](https://github.com/doctrine/annotations/pull/38) +- [39: Remove superfluous NS](https://github.com/doctrine/annotations/pull/39) +- [41: Warn if load_comments is not enabled.](https://github.com/doctrine/annotations/pull/41) +- [42: Clean up unused uses](https://github.com/doctrine/annotations/pull/42) + +### 1.2.0 + + * HHVM support + * Allowing dangling comma in annotations + * Excluded annotations are no longer autoloaded + * Importing namespaces also in traits + * Added support for `::class` 5.5-style constant, works also in 5.3 and 5.4 + +### 1.1.0 + + * Add Exception when ZendOptimizer+ or Opcache is configured to drop comments diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/README.md --- a/vendor/doctrine/annotations/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/annotations/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,19 +1,17 @@ # Doctrine Annotations -[![Build Status](https://travis-ci.org/doctrine/annotations.png?branch=master)](https://travis-ci.org/doctrine/annotations) +[![Build Status](https://travis-ci.org/doctrine/annotations.svg?branch=master)](https://travis-ci.org/doctrine/annotations) +[![Dependency Status](https://www.versioneye.com/package/php--doctrine--annotations/badge.png)](https://www.versioneye.com/package/php--doctrine--annotations) +[![Reference Status](https://www.versioneye.com/php/doctrine:annotations/reference_badge.svg)](https://www.versioneye.com/php/doctrine:annotations/references) +[![Total Downloads](https://poser.pugx.org/doctrine/annotations/downloads.png)](https://packagist.org/packages/doctrine/annotations) +[![Latest Stable Version](https://poser.pugx.org/doctrine/annotations/v/stable.png)](https://packagist.org/packages/doctrine/annotations) Docblock Annotations Parser library (extracted from [Doctrine Common](https://github.com/doctrine/common)). +## Documentation + +See the [doctrine-project website](http://docs.doctrine-project.org/projects/doctrine-common/en/latest/reference/annotations.html). + ## Changelog -### v1.2.0 - - * HHVM support - * Allowing dangling comma in annotations - * Excluded annotations are no longer autoloaded - * Importing namespaces also in traits - * Added support for `::class` 5.5-style constant, works also in 5.3 and 5.4 - -### v1.1 - - * Add Exception when ZendOptimizer+ or Opcache is configured to drop comments +See [CHANGELOG.md](CHANGELOG.md). diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/composer.json --- a/vendor/doctrine/annotations/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/annotations/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -13,19 +13,22 @@ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} ], "require": { - "php": ">=5.3.2", + "php": "^5.6 || ^7.0", "doctrine/lexer": "1.*" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^5.7" }, "autoload": { - "psr-0": { "Doctrine\\Common\\Annotations\\": "lib/" } + "psr-4": { "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } + }, + "autoload-dev": { + "psr-4": { "Doctrine\\Tests\\Common\\Annotations\\": "tests/Doctrine/Tests/Common/Annotations" } }, "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php Fri Feb 23 15:52:07 2018 +0000 @@ -103,6 +103,15 @@ ); /** + * A list with annotations that are not causing exceptions when not resolved to an annotation class. + * + * The names are case sensitive. + * + * @var array + */ + private static $globalIgnoredNamespaces = array(); + + /** * Add a new annotation to the globally ignored annotation names with regard to exception handling. * * @param string $name @@ -113,6 +122,16 @@ } /** + * Add a new annotation to the globally ignored annotation namespaces with regard to exception handling. + * + * @param string $namespace + */ + static public function addGlobalIgnoredNamespace($namespace) + { + self::$globalIgnoredNamespaces[$namespace] = true; + } + + /** * Annotations parser. * * @var \Doctrine\Common\Annotations\DocParser @@ -151,8 +170,10 @@ * Constructor. * * Initializes a new AnnotationReader. + * + * @param DocParser $parser */ - public function __construct() + public function __construct(DocParser $parser = null) { if (extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.save_comments') === "0" || ini_get('opcache.save_comments') === "0")) { throw AnnotationException::optimizerPlusSaveComments(); @@ -174,7 +195,8 @@ AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php'); - $this->parser = new DocParser; + $this->parser = $parser ?: new DocParser(); + $this->preParser = new DocParser; $this->preParser->setImports(self::$globalImports); @@ -191,6 +213,7 @@ $this->parser->setTarget(Target::TARGET_CLASS); $this->parser->setImports($this->getClassImports($class)); $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); + $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); } @@ -222,6 +245,7 @@ $this->parser->setTarget(Target::TARGET_PROPERTY); $this->parser->setImports($this->getPropertyImports($property)); $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); + $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); return $this->parser->parse($property->getDocComment(), $context); } @@ -253,6 +277,7 @@ $this->parser->setTarget(Target::TARGET_METHOD); $this->parser->setImports($this->getMethodImports($method)); $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); + $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); return $this->parser->parse($method->getDocComment(), $context); } @@ -282,7 +307,8 @@ */ private function getIgnoredAnnotationNames(ReflectionClass $class) { - if (isset($this->ignoredAnnotationNames[$name = $class->getName()])) { + $name = $class->getName(); + if (isset($this->ignoredAnnotationNames[$name])) { return $this->ignoredAnnotationNames[$name]; } @@ -300,7 +326,8 @@ */ private function getClassImports(ReflectionClass $class) { - if (isset($this->imports[$name = $class->getName()])) { + $name = $class->getName(); + if (isset($this->imports[$name])) { return $this->imports[$name]; } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,6 +20,7 @@ namespace Doctrine\Common\Annotations; use Doctrine\Common\Cache\Cache; +use ReflectionClass; /** * A cache aware annotation reader. @@ -30,11 +31,6 @@ final class CachedReader implements Reader { /** - * @var string - */ - private static $CACHE_SALT = '@[Annot]'; - - /** * @var Reader */ private $delegate; @@ -71,7 +67,7 @@ /** * {@inheritDoc} */ - public function getClassAnnotations(\ReflectionClass $class) + public function getClassAnnotations(ReflectionClass $class) { $cacheKey = $class->getName(); @@ -90,7 +86,7 @@ /** * {@inheritDoc} */ - public function getClassAnnotation(\ReflectionClass $class, $annotationName) + public function getClassAnnotation(ReflectionClass $class, $annotationName) { foreach ($this->getClassAnnotations($class) as $annot) { if ($annot instanceof $annotationName) { @@ -182,14 +178,13 @@ /** * Fetches a value from the cache. * - * @param string $rawCacheKey The cache key. - * @param \ReflectionClass $class The related class. + * @param string $cacheKey The cache key. + * @param ReflectionClass $class The related class. * * @return mixed The cached value or false when the value is not in cache. */ - private function fetchFromCache($rawCacheKey, \ReflectionClass $class) + private function fetchFromCache($cacheKey, ReflectionClass $class) { - $cacheKey = $rawCacheKey . self::$CACHE_SALT; if (($data = $this->cache->fetch($cacheKey)) !== false) { if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) { return $data; @@ -202,14 +197,13 @@ /** * Saves a value to the cache. * - * @param string $rawCacheKey The cache key. - * @param mixed $value The value. + * @param string $cacheKey The cache key. + * @param mixed $value The value. * * @return void */ - private function saveToCache($rawCacheKey, $value) + private function saveToCache($cacheKey, $value) { - $cacheKey = $rawCacheKey . self::$CACHE_SALT; $this->cache->save($cacheKey, $value); if ($this->debug) { $this->cache->save('[C]'.$cacheKey, time()); @@ -220,16 +214,49 @@ * Checks if the cache is fresh. * * @param string $cacheKey - * @param \ReflectionClass $class + * @param ReflectionClass $class * * @return boolean */ - private function isCacheFresh($cacheKey, \ReflectionClass $class) + private function isCacheFresh($cacheKey, ReflectionClass $class) { - if (false === $filename = $class->getFilename()) { + if (null === $lastModification = $this->getLastModification($class)) { return true; } - return $this->cache->fetch('[C]'.$cacheKey) >= filemtime($filename); + return $this->cache->fetch('[C]'.$cacheKey) >= $lastModification; + } + + /** + * Returns the time the class was last modified, testing traits and parents + * + * @param ReflectionClass $class + * @return int + */ + private function getLastModification(ReflectionClass $class) + { + $filename = $class->getFileName(); + $parent = $class->getParentClass(); + + return max(array_merge( + [$filename ? filemtime($filename) : 0], + array_map([$this, 'getTraitLastModificationTime'], $class->getTraits()), + array_map([$this, 'getLastModification'], $class->getInterfaces()), + $parent ? [$this->getLastModification($parent)] : [] + )); + } + + /** + * @param ReflectionClass $reflectionTrait + * @return int + */ + private function getTraitLastModificationTime(ReflectionClass $reflectionTrait) + { + $fileName = $reflectionTrait->getFileName(); + + return max(array_merge( + [$fileName ? filemtime($fileName) : 0], + array_map([$this, 'getTraitLastModificationTime'], $reflectionTrait->getTraits()) + )); } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php Fri Feb 23 15:52:07 2018 +0000 @@ -61,7 +61,7 @@ /** * Current target context. * - * @var string + * @var integer */ private $target; @@ -105,7 +105,7 @@ /** * An array of default namespaces if operating in simple mode. * - * @var array + * @var string[] */ private $namespaces = array(); @@ -115,11 +115,19 @@ * The names must be the raw names as used in the class, not the fully qualified * class names. * - * @var array + * @var bool[] indexed by annotation name */ private $ignoredAnnotationNames = array(); /** + * A list with annotations in namespaced format + * that are not causing exceptions when not resolved to an annotation class. + * + * @var bool[] indexed by namespace name + */ + private $ignoredAnnotationNamespaces = array(); + + /** * @var string */ private $context = ''; @@ -242,7 +250,7 @@ * The names are supposed to be the raw names as used in the class, not the * fully qualified class names. * - * @param array $names + * @param bool[] $names indexed by annotation name * * @return void */ @@ -252,6 +260,18 @@ } /** + * Sets the annotation namespaces that are ignored during the parsing process. + * + * @param bool[] $ignoredAnnotationNamespaces indexed by annotation namespace name + * + * @return void + */ + public function setIgnoredAnnotationNamespaces($ignoredAnnotationNamespaces) + { + $this->ignoredAnnotationNamespaces = $ignoredAnnotationNamespaces; + } + + /** * Sets ignore on not-imported annotations. * * @param boolean $bool @@ -266,7 +286,7 @@ /** * Sets the default namespaces. * - * @param array $namespace + * @param string $namespace * * @return void * @@ -347,8 +367,10 @@ // search for first valid annotation while (($pos = strpos($input, '@', $pos)) !== false) { - // if the @ is preceded by a space or * it is valid - if ($pos === 0 || $input[$pos - 1] === ' ' || $input[$pos - 1] === '*') { + $preceding = substr($input, $pos - 1, 1); + + // if the @ is preceded by a space, a tab or * it is valid + if ($pos === 0 || $preceding === ' ' || $preceding === '*' || $preceding === "\t") { return $pos; } @@ -669,8 +691,10 @@ $originalName = $name; if ('\\' !== $name[0]) { - $alias = (false === $pos = strpos($name, '\\'))? $name : substr($name, 0, $pos); + $pos = strpos($name, '\\'); + $alias = (false === $pos)? $name : substr($name, 0, $pos); $found = false; + $loweredAlias = strtolower($alias); if ($this->namespaces) { foreach ($this->namespaces as $namespace) { @@ -680,7 +704,7 @@ break; } } - } elseif (isset($this->imports[$loweredAlias = strtolower($alias)])) { + } elseif (isset($this->imports[$loweredAlias])) { $found = true; $name = (false !== $pos) ? $this->imports[$loweredAlias] . substr($name, $pos) @@ -696,7 +720,7 @@ } if ( ! $found) { - if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) { + if ($this->isIgnoredAnnotation($name)) { return false; } @@ -704,6 +728,8 @@ } } + $name = ltrim($name,'\\'); + if ( ! $this->classExists($name)) { throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context)); } @@ -720,7 +746,7 @@ // verify that the class is really meant to be an annotation and not just any ordinary class if (self::$annotationMetadata[$name]['is_annotation'] === false) { - if (isset($this->ignoredAnnotationNames[$originalName])) { + if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$originalName])) { return false; } @@ -897,8 +923,10 @@ if ( ! defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { list($className, $const) = explode('::', $identifier); - $alias = (false === $pos = strpos($className, '\\')) ? $className : substr($className, 0, $pos); + $pos = strpos($className, '\\'); + $alias = (false === $pos) ? $className : substr($className, 0, $pos); $found = false; + $loweredAlias = strtolower($alias); switch (true) { case !empty ($this->namespaces): @@ -911,7 +939,7 @@ } break; - case isset($this->imports[$loweredAlias = strtolower($alias)]): + case isset($this->imports[$loweredAlias]): $found = true; $className = (false !== $pos) ? $this->imports[$loweredAlias] . substr($className, $pos) @@ -1045,7 +1073,7 @@ * FieldAssignment ::= FieldName "=" PlainValue * FieldName ::= identifier * - * @return array + * @return \stdClass */ private function FieldAssignment() { @@ -1135,4 +1163,28 @@ return array(null, $this->Value()); } + + /** + * Checks whether the given $name matches any ignored annotation name or namespace + * + * @param string $name + * + * @return bool + */ + private function isIgnoredAnnotation($name) + { + if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) { + return true; + } + + foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) { + $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\'; + + if (0 === stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace)) { + return true; + } + } + + return false; + } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php Fri Feb 23 15:52:07 2018 +0000 @@ -112,7 +112,7 @@ } if ($this->debug - && (false !== $filename = $class->getFilename()) + && (false !== $filename = $class->getFileName()) && filemtime($path) < filemtime($filename)) { @unlink($path); @@ -214,6 +214,8 @@ throw new \RuntimeException(sprintf('Unable to create tempfile in directory: %s', $this->dir)); } + @chmod($tempfile, 0666 & (~$this->umask)); + $written = file_put_contents($tempfile, 'getUseStatements(); } - if (false === $filename = $class->getFilename()) { + if (false === $filename = $class->getFileName()) { return array(); } @@ -67,7 +67,7 @@ * @param string $filename The name of the file to load. * @param integer $lineNumber The number of lines to read from file. * - * @return string The content of the file. + * @return string|null The content of the file or null if the file does not exist. */ private function getFileContent($filename, $lineNumber) { diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php Fri Feb 23 15:52:07 2018 +0000 @@ -99,6 +99,8 @@ */ public function parseUseStatement() { + + $groupRoot = ''; $class = ''; $alias = ''; $statements = array(); @@ -114,13 +116,18 @@ $explicitAlias = true; $alias = ''; } else if ($token === ',') { - $statements[strtolower($alias)] = $class; + $statements[strtolower($alias)] = $groupRoot . $class; $class = ''; $alias = ''; $explicitAlias = false; } else if ($token === ';') { - $statements[strtolower($alias)] = $class; + $statements[strtolower($alias)] = $groupRoot . $class; break; + } else if ($token === '{' ) { + $groupRoot = $class; + $class = ''; + } else if ($token === '}' ) { + continue; } else { break; } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/annotations/phpstan.neon --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/doctrine/annotations/phpstan.neon Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,14 @@ +parameters: + autoload_files: + - %currentWorkingDirectory%/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php + excludes_analyse: + - %currentWorkingDirectory%/tests/*/Fixtures/* + polluteScopeWithLoopInitialAssignments: true + ignoreErrors: + - '#Class Doctrine_Tests_Common_Annotations_Fixtures_ClassNoNamespaceNoComment not found#' + - '#Instantiated class Doctrine_Tests_Common_Annotations_Fixtures_ClassNoNamespaceNoComment not found#' + - '#Property Doctrine\\Tests\\Common\\Annotations\\DummyClassNonAnnotationProblem::\$foo has unknown class#' + - '#Class Doctrine\\Tests\\Common\\Annotations\\True not found#' + - '#Class Doctrine\\Tests\\Common\\Annotations\\False not found#' + - '#Class Doctrine\\Tests\\Common\\Annotations\\Null not found#' + - '#Call to an undefined method ReflectionClass::getUseStatements\(\)#' diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php Fri Feb 23 15:52:07 2018 +0000 @@ -94,8 +94,9 @@ */ protected function doContains($id) { - return false !== $this->memcached->get($id) - || $this->memcached->getResultCode() !== Memcached::RES_NOTFOUND; + $this->memcached->get($id); + + return $this->memcached->getResultCode() === Memcached::RES_SUCCESS; } /** diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/.gitignore --- a/vendor/doctrine/collections/.gitignore Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -vendor/ diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/.travis.yml --- a/vendor/doctrine/collections/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm - - hhvm-nightly - -matrix: - fast_finish: true - allow_failures: - - php: 7.0 - -before_script: - - composer --prefer-source install - -script: - - phpunit diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/CONTRIBUTING.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/doctrine/collections/CONTRIBUTING.md Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,67 @@ +# Contribute to Doctrine + +Thank you for contributing to Doctrine! + +Before we can merge your Pull-Request here are some guidelines that you need to follow. +These guidelines exist not to annoy you, but to keep the code base clean, +unified and future proof. + +## We only accept PRs to "master" + +Our branching strategy is "everything to master first", even +bugfixes and we then merge them into the stable branches. You should only +open pull requests against the master branch. Otherwise we cannot accept the PR. + +There is one exception to the rule, when we merged a bug into some stable branches +we do occasionally accept pull requests that merge the same bug fix into earlier +branches. + +## Coding Standard + +We use [doctrine coding standard](https://github.com/doctrine/coding-standard) which is PSR-1 and PSR-2: + +* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md +* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md + +with some exceptions/differences: + +* Keep the nesting of control structures per method as small as possible +* Align equals (=) signs +* Add spaces between assignment, control and return statements +* Prefer early exit over nesting conditions +* Add spaces around a negation if condition ``if ( ! $cond)`` +* Add legal information at the beginning of each source file +* Add ``@author`` [phpDoc](https://www.phpdoc.org/docs/latest/references/phpdoc/tags/author.html) comment at DockBlock of class/interface/trait that you create. + +## Unit-Tests + +Please try to add a test for your pull-request. + +* If you want to contribute new functionality add unit- or functional tests + depending on the scope of the feature. + +You can run the unit-tests by calling ``vendor/bin/phpunit`` from the root of the project. +It will run all the project tests. + +In order to do that, you will need a fresh copy of doctrine/collections, and you +will have to run a composer installation in the project: + +```sh +git clone git@github.com:doctrine/collections.git +cd collections +curl -sS https://getcomposer.org/installer | php -- +./composer.phar install +``` + +## Travis + +We automatically run your pull request through [Travis CI](https://www.travis-ci.org) +against supported PHP versions. If you break the tests, we cannot merge your code, +so please make sure that your code is working before opening up a Pull-Request. + +## Getting merged + +Please allow us time to review your pull requests. We will give our best to review +everything as fast as possible, but cannot always live up to our own expectations. + +Thank you very much again for your contribution! diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/README.md --- a/vendor/doctrine/collections/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/collections/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,8 @@ # Doctrine Collections [![Build Status](https://travis-ci.org/doctrine/collections.svg?branch=master)](https://travis-ci.org/doctrine/collections) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/collections/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/collections/?branch=master) +[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/collections/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/collections/?branch=master) Collections Abstraction library diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/composer.json --- a/vendor/doctrine/collections/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/collections/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -13,17 +13,23 @@ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} ], "require": { - "php": ">=5.3.2" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^5.7", + "doctrine/coding-standard": "~0.1@dev" }, "autoload": { "psr-0": { "Doctrine\\Common\\Collections\\": "lib/" } }, + "autoload-dev": { + "psr-4": { + "Doctrine\\Tests\\": "tests/Doctrine/Tests" + } + }, "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php --- a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,6 +26,11 @@ /** * An ArrayCollection is a Collection implementation that wraps a regular PHP array. * + * Warning: Using (un-)serialize() on a collection is not a supported use-case + * and may break when we change the internals in the future. If you need to + * serialize a collection use {@link toArray()} and reconstruct the collection + * manually. + * * @since 2.0 * @author Guilherme Blanco * @author Jonathan Wage @@ -51,6 +56,21 @@ } /** + * Creates a new instance from the specified elements. + * + * This method is provided for derived classes to specify how a new + * instance should be created when constructor semantics have changed. + * + * @param array $elements Elements. + * + * @return static + */ + protected function createFrom(array $elements) + { + return new static($elements); + } + + /** * {@inheritDoc} */ public function toArray() @@ -254,9 +274,9 @@ /** * {@inheritDoc} */ - public function add($value) + public function add($element) { - $this->elements[] = $value; + $this->elements[] = $element; return true; } @@ -284,7 +304,7 @@ */ public function map(Closure $func) { - return new static(array_map($func, $this->elements)); + return $this->createFrom(array_map($func, $this->elements)); } /** @@ -292,7 +312,7 @@ */ public function filter(Closure $p) { - return new static(array_filter($this->elements, $p)); + return $this->createFrom(array_filter($this->elements, $p)); } /** @@ -324,7 +344,7 @@ } } - return array(new static($matches), new static($noMatches)); + return array($this->createFrom($matches), $this->createFrom($noMatches)); } /** @@ -368,8 +388,9 @@ } if ($orderings = $criteria->getOrderings()) { + $next = null; foreach (array_reverse($orderings) as $field => $ordering) { - $next = ClosureExpressionVisitor::sortByField($field, $ordering == Criteria::DESC ? -1 : 1); + $next = ClosureExpressionVisitor::sortByField($field, $ordering == Criteria::DESC ? -1 : 1, $next); } uasort($filtered, $next); @@ -382,6 +403,6 @@ $filtered = array_slice($filtered, (int)$offset, $length); } - return new static($filtered); + return $this->createFrom($filtered); } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php --- a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php Fri Feb 23 15:52:07 2018 +0000 @@ -69,6 +69,24 @@ return $object[$field]; } + if (isset($object->$field)) { + return $object->$field; + } + + // camelcase field name to support different variable naming conventions + $ccField = preg_replace_callback('/_(.?)/', function($matches) { return strtoupper($matches[1]); }, $field); + + foreach ($accessors as $accessor) { + $accessor .= $ccField; + + + if ( ! method_exists($object, $accessor)) { + continue; + } + + return $object->$accessor(); + } + return $object->$field; } @@ -155,6 +173,26 @@ return false !== strpos(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value); }; + case Comparison::MEMBER_OF: + return function ($object) use ($field, $value) { + $fieldValues = ClosureExpressionVisitor::getObjectFieldValue($object, $field); + if (!is_array($fieldValues)) { + $fieldValues = iterator_to_array($fieldValues); + } + return in_array($value, $fieldValues); + }; + + case Comparison::STARTS_WITH: + return function ($object) use ($field, $value) { + return 0 === strpos(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value); + }; + + case Comparison::ENDS_WITH: + return function ($object) use ($field, $value) { + return $value === substr(ClosureExpressionVisitor::getObjectFieldValue($object, $field), -strlen($value)); + }; + + default: throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php --- a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php Fri Feb 23 15:52:07 2018 +0000 @@ -27,17 +27,19 @@ */ class Comparison implements Expression { - const EQ = '='; - const NEQ = '<>'; - const LT = '<'; - const LTE = '<='; - const GT = '>'; - const GTE = '>='; - const IS = '='; // no difference with EQ - const IN = 'IN'; - const NIN = 'NIN'; - const CONTAINS = 'CONTAINS'; - + const EQ = '='; + const NEQ = '<>'; + const LT = '<'; + const LTE = '<='; + const GT = '>'; + const GTE = '>='; + const IS = '='; // no difference with EQ + const IN = 'IN'; + const NIN = 'NIN'; + const CONTAINS = 'CONTAINS'; + const MEMBER_OF = 'MEMBER_OF'; + const STARTS_WITH = 'STARTS_WITH'; + const ENDS_WITH = 'ENDS_WITH'; /** * @var string */ diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php --- a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php Fri Feb 23 15:52:07 2018 +0000 @@ -27,7 +27,7 @@ * Builder for Expressions in the {@link Selectable} interface. * * Important Notice for interoperable code: You have to use scalar - * values only for comparisons, otherwise the behavior of the comparision + * values only for comparisons, otherwise the behavior of the comparison * may be different between implementations (Array vs ORM vs ODM). * * @author Benjamin Eberlei @@ -163,4 +163,38 @@ { return new Comparison($field, Comparison::CONTAINS, new Value($value)); } + + /** + * @param string $field + * @param mixed $value + * + * @return Comparison + */ + public function memberOf ($field, $value) + { + return new Comparison($field, Comparison::MEMBER_OF, new Value($value)); + } + + /** + * @param string $field + * @param mixed $value + * + * @return Comparison + */ + public function startsWith($field, $value) + { + return new Comparison($field, Comparison::STARTS_WITH, new Value($value)); + } + + /** + * @param string $field + * @param mixed $value + * + * @return Comparison + */ + public function endsWith($field, $value) + { + return new Comparison($field, Comparison::ENDS_WITH, new Value($value)); + } + } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/collections/phpunit.xml.dist --- a/vendor/doctrine/collections/phpunit.xml.dist Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - - - - performance - - - diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/composer.json --- a/vendor/doctrine/common/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -13,7 +13,7 @@ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} ], "require": { - "php": "~5.5|~7.0", + "php": "~5.6|~7.0", "doctrine/inflector": "1.*", "doctrine/cache": "1.*", "doctrine/collections": "1.*", @@ -21,7 +21,7 @@ "doctrine/annotations": "1.*" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0" + "phpunit/phpunit": "^5.4.6" }, "autoload": { "psr-4": { diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/humbug.json.dist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/doctrine/common/humbug.json.dist Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,11 @@ +{ + "source": { + "directories": [ + "lib\/Doctrine" + ] + }, + "timeout": 10, + "logs": { + "text": "reports/humbuglog.txt" + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php Fri Feb 23 15:52:07 2018 +0000 @@ -130,7 +130,7 @@ throw new \InvalidArgumentException(sprintf( 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', $field, - get_class($this->getEntity()) + get_class($this->getObject()) )); } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,7 +33,7 @@ * Forces the factory to load the metadata of all classes known to the underlying * mapping driver. * - * @return array The ClassMetadata instances of all mapped classes. + * @return ClassMetadata[] The ClassMetadata instances of all mapped classes. */ public function getAllMetadata(); diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php Fri Feb 23 15:52:07 2018 +0000 @@ -117,6 +117,8 @@ throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension()); } + $this->classCache[$className] = $result[$className]; + return $result[$className]; } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,7 +34,7 @@ * * @param mixed $id The identifier. * - * @return object The object. + * @return object|null The object. */ public function find($id); @@ -68,7 +68,7 @@ * * @param array $criteria The criteria. * - * @return object The object. + * @return object|null The object. */ public function findOneBy(array $criteria); diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php Fri Feb 23 15:52:07 2018 +0000 @@ -119,8 +119,6 @@ */ private function set($field, $args) { - $this->initializeDoctrine(); - if ($this->cm->hasField($field) && !$this->cm->isIdentifier($field)) { $this->$field = $args[0]; } else if ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) { @@ -146,13 +144,11 @@ */ private function get($field) { - $this->initializeDoctrine(); - if ( $this->cm->hasField($field) || $this->cm->hasAssociation($field) ) { return $this->$field; - } else { - throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); } + + throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); } /** @@ -190,8 +186,6 @@ */ private function add($field, $args) { - $this->initializeDoctrine(); - if ($this->cm->hasAssociation($field) && $this->cm->isCollectionValuedAssociation($field)) { $targetClass = $this->cm->getAssociationTargetClass($field); if (!($args[0] instanceof $targetClass)) { @@ -239,6 +233,8 @@ */ public function __call($method, $args) { + $this->initializeDoctrine(); + $command = substr($method, 0, 3); $field = lcfirst(substr($method, 3)); if ($command == "set") { diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,9 +49,13 @@ throw InvalidArgumentException::notProxyClass($className, $proxyNamespace); } - $className = str_replace('\\', '', substr($className, strlen($proxyNamespace) + 1)); + // remove proxy namespace from class name + $classNameRelativeToProxyNamespace = substr($className, strlen($proxyNamespace)); - return $proxyDir . DIRECTORY_SEPARATOR . $className . '.php'; + // remove namespace separators from remaining class name + $fileName = str_replace('\\', '', $classNameRelativeToProxyNamespace); + + return $proxyDir . DIRECTORY_SEPARATOR . $fileName . '.php'; } /** diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,15 +41,19 @@ } /** - * @param string $className - * @param string $methodName - * @param string $parameterName - * @param \Exception $previous + * @param string $className + * @param string $methodName + * @param string $parameterName + * @param \Exception|null $previous * * @return self */ - public static function invalidParameterTypeHint($className, $methodName, $parameterName, \Exception $previous) - { + public static function invalidParameterTypeHint( + $className, + $methodName, + $parameterName, + \Exception $previous = null + ) { return new self( sprintf( 'The type hint of parameter "%s" in method "%s" in class "%s" is invalid.', @@ -61,4 +65,24 @@ $previous ); } + + /** + * @param $className + * @param $methodName + * @param \Exception|null $previous + * + * @return self + */ + public static function invalidReturnTypeHint($className, $methodName, \Exception $previous = null) + { + return new self( + sprintf( + 'The return type of method "%s" in class "%s" is invalid.', + $methodName, + $className + ), + 0, + $previous + ); + } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,7 +37,7 @@ * Used to match very simple id methods that don't need * to be decorated since the identifier is known. */ - const PATTERN_MATCH_ID_METHOD = '((public\s+)?(function\s+%s\s*\(\)\s*)\s*{\s*return\s*\$this->%s;\s*})i'; + const PATTERN_MATCH_ID_METHOD = '((public\s+)?(function\s+%s\s*\(\)\s*)\s*(?::\s*\??\s*\\\\?[a-z_\x7f-\xff][\w\x7f-\xff]*(?:\\\\[a-z_\x7f-\xff][\w\x7f-\xff]*)*\s*)?{\s*return\s*\$this->%s;\s*})i'; /** * The namespace that contains all proxy classes. @@ -787,7 +787,9 @@ $cast = in_array($fieldType, ['integer', 'smallint']) ? '(int) ' : ''; $methods .= ' if ($this->__isInitialized__ === false) {' . "\n"; - $methods .= ' return ' . $cast . ' parent::' . $method->getName() . "();\n"; + $methods .= ' '; + $methods .= $this->shouldProxiedMethodReturn($method) ? 'return ' : ''; + $methods .= $cast . ' parent::' . $method->getName() . "();\n"; $methods .= ' }' . "\n\n"; } @@ -797,7 +799,9 @@ $methods .= "\n \$this->__initializer__ " . "&& \$this->__initializer__->__invoke(\$this, " . var_export($name, true) . ", [" . $invokeParamsString . "]);" - . "\n\n return parent::" . $name . '(' . $callParamsString . ');' + . "\n\n " + . ($this->shouldProxiedMethodReturn($method) ? 'return ' : '') + . "parent::" . $name . '(' . $callParamsString . ');' . "\n" . ' }' . "\n"; } @@ -935,8 +939,15 @@ */ private function getParameterType(ClassMetadata $class, \ReflectionMethod $method, \ReflectionParameter $parameter) { + if (method_exists($parameter, 'hasType')) { + if ( ! $parameter->hasType()) { + return ''; + } - // We need to pick the type hint class too + return $this->formatType($parameter->getType(), $parameter->getDeclaringFunction(), $parameter); + } + + // For PHP 5.x, we need to pick the type hint in the old way (to be removed for PHP 7.0+) if ($parameter->isArray()) { return 'array'; } @@ -945,10 +956,6 @@ return 'callable'; } - if (method_exists($parameter, 'hasType') && $parameter->hasType() && $parameter->getType()->isBuiltin()) { - return (string) $parameter->getType(); - } - try { $parameterClass = $parameter->getClass(); @@ -1012,26 +1019,75 @@ */ private function getMethodReturnType(\ReflectionMethod $method) { - if (! (method_exists($method, 'hasReturnType') && $method->hasReturnType())) { + if ( ! method_exists($method, 'hasReturnType') || ! $method->hasReturnType()) { return ''; } - $returnType = $method->getReturnType(); + return ': ' . $this->formatType($method->getReturnType(), $method); + } - if ($returnType->isBuiltin()) { - return ': ' . $returnType; + /** + * @param \ReflectionMethod $method + * + * @return bool + */ + private function shouldProxiedMethodReturn(\ReflectionMethod $method) + { + if ( ! method_exists($method, 'hasReturnType') || ! $method->hasReturnType()) { + return true; } - $nameLower = strtolower((string) $returnType); + return 'void' !== strtolower($this->formatType($method->getReturnType(), $method)); + } + + /** + * @param \ReflectionType $type + * @param \ReflectionMethod $method + * @param \ReflectionParameter|null $parameter + * + * @return string + */ + private function formatType( + \ReflectionType $type, + \ReflectionMethod $method, + \ReflectionParameter $parameter = null + ) { + $name = method_exists($type, 'getName') ? $type->getName() : (string) $type; + $nameLower = strtolower($name); if ('self' === $nameLower) { - return ': \\' . $method->getDeclaringClass()->getName(); + $name = $method->getDeclaringClass()->getName(); } if ('parent' === $nameLower) { - return ': \\' . $method->getDeclaringClass()->getParentClass()->getName(); + $name = $method->getDeclaringClass()->getParentClass()->getName(); } - return ': \\' . (string) $returnType; + if ( ! $type->isBuiltin() && ! class_exists($name) && ! interface_exists($name)) { + if (null !== $parameter) { + throw UnexpectedValueException::invalidParameterTypeHint( + $method->getDeclaringClass()->getName(), + $method->getName(), + $parameter->getName() + ); + } + + throw UnexpectedValueException::invalidReturnTypeHint( + $method->getDeclaringClass()->getName(), + $method->getName() + ); + } + + if ( ! $type->isBuiltin()) { + $name = '\\' . $name; + } + + if ($type->allowsNull() + && (null === $parameter || ! $parameter->isDefaultValueAvailable() || null !== $parameter->getDefaultValue()) + ) { + $name = '?' . $name; + } + + return $name; } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php Fri Feb 23 15:52:07 2018 +0000 @@ -137,70 +137,72 @@ } $tokenParser = new TokenParser($contents); $docComment = ''; + $last_token = false; + while ($token = $tokenParser->next(false)) { - if (is_array($token)) { - switch ($token[0]) { - case T_USE: - $this->useStatements = array_merge($this->useStatements, $tokenParser->parseUseStatement()); - break; - case T_DOC_COMMENT: - $docComment = $token[1]; - break; - case T_CLASS: - $this->docComment['class'] = $docComment; - $docComment = ''; - break; - case T_VAR: - case T_PRIVATE: - case T_PROTECTED: - case T_PUBLIC: - $token = $tokenParser->next(); - if ($token[0] === T_VARIABLE) { - $propertyName = substr($token[1], 1); - $this->docComment['property'][$propertyName] = $docComment; - continue 2; + if (is_array($token)) {switch ($token[0]) { + case T_USE: + $this->useStatements = array_merge($this->useStatements, $tokenParser->parseUseStatement()); + break; + case T_DOC_COMMENT: + $docComment = $token[1]; + break; + case T_CLASS: + if ($last_token !== T_PAAMAYIM_NEKUDOTAYIM) {$this->docComment['class'] = $docComment; + $docComment = '';} + break; + case T_VAR: + case T_PRIVATE: + case T_PROTECTED: + case T_PUBLIC: + $token = $tokenParser->next(); + if ($token[0] === T_VARIABLE) { + $propertyName = substr($token[1], 1); + $this->docComment['property'][$propertyName] = $docComment; + continue 2; + } + if ($token[0] !== T_FUNCTION) { + // For example, it can be T_FINAL. + continue 2; + } + // No break. + case T_FUNCTION: + // The next string after function is the name, but + // there can be & before the function name so find the + // string. + while (($token = $tokenParser->next()) && $token[0] !== T_STRING); + $methodName = $token[1]; + $this->docComment['method'][$methodName] = $docComment; + $docComment = ''; + break; + case T_EXTENDS: + $this->parentClassName = $tokenParser->parseClass(); + $nsPos = strpos($this->parentClassName, '\\'); + $fullySpecified = false; + if ($nsPos === 0) { + $fullySpecified = true; + } else { + if ($nsPos) { + $prefix = strtolower(substr($this->parentClassName, 0, $nsPos)); + $postfix = substr($this->parentClassName, $nsPos); + } else { + $prefix = strtolower($this->parentClassName); + $postfix = ''; } - if ($token[0] !== T_FUNCTION) { - // For example, it can be T_FINAL. - continue 2; + foreach ($this->useStatements as $alias => $use) { + if ($alias == $prefix) { + $this->parentClassName = '\\' . $use . $postfix; + $fullySpecified = true; + } } - // No break. - case T_FUNCTION: - // The next string after function is the name, but - // there can be & before the function name so find the - // string. - while (($token = $tokenParser->next()) && $token[0] !== T_STRING); - $methodName = $token[1]; - $this->docComment['method'][$methodName] = $docComment; - $docComment = ''; - break; - case T_EXTENDS: - $this->parentClassName = $tokenParser->parseClass(); - $nsPos = strpos($this->parentClassName, '\\'); - $fullySpecified = false; - if ($nsPos === 0) { - $fullySpecified = true; - } else { - if ($nsPos) { - $prefix = strtolower(substr($this->parentClassName, 0, $nsPos)); - $postfix = substr($this->parentClassName, $nsPos); - } else { - $prefix = strtolower($this->parentClassName); - $postfix = ''; - } - foreach ($this->useStatements as $alias => $use) { - if ($alias == $prefix) { - $this->parentClassName = '\\' . $use . $postfix; - $fullySpecified = true; - } - } - } - if (!$fullySpecified) { - $this->parentClassName = '\\' . $this->namespace . '\\' . $this->parentClassName; - } - break; - } + } + if (!$fullySpecified) { + $this->parentClassName = '\\' . $this->namespace . '\\' . $this->parentClassName; + } + break;} } + + $last_token = $token[0]; } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php Fri Feb 23 15:52:07 2018 +0000 @@ -65,7 +65,7 @@ ini_set('xdebug.var_display_max_depth', $maxDepth); } - $var = self::export($var, $maxDepth++); + $var = self::export($var, $maxDepth); ob_start(); var_dump($var); @@ -77,11 +77,11 @@ $dumpText = ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump); ini_set('html_errors', $html); - + if ($echo) { echo $dumpText; } - + return $dumpText; } @@ -100,47 +100,86 @@ $var = $var->toArray(); } - if ($maxDepth) { - if (is_array($var)) { - $return = []; - - foreach ($var as $k => $v) { - $return[$k] = self::export($v, $maxDepth - 1); - } - } else if ($isObj) { - $return = new \stdclass(); - if ($var instanceof \DateTime) { - $return->__CLASS__ = "DateTime"; - $return->date = $var->format('c'); - $return->timezone = $var->getTimeZone()->getName(); - } else { - $reflClass = ClassUtils::newReflectionObject($var); - $return->__CLASS__ = ClassUtils::getClass($var); - - if ($var instanceof Proxy) { - $return->__IS_PROXY__ = true; - $return->__PROXY_INITIALIZED__ = $var->__isInitialized(); - } - - if ($var instanceof \ArrayObject || $var instanceof \ArrayIterator) { - $return->__STORAGE__ = self::export($var->getArrayCopy(), $maxDepth - 1); - } - - foreach ($reflClass->getProperties() as $reflProperty) { - $name = $reflProperty->getName(); - - $reflProperty->setAccessible(true); - $return->$name = self::export($reflProperty->getValue($var), $maxDepth - 1); - } - } - } else { - $return = $var; - } - } else { - $return = is_object($var) ? get_class($var) + if (! $maxDepth) { + return is_object($var) ? get_class($var) : (is_array($var) ? 'Array(' . count($var) . ')' : $var); } + if (is_array($var)) { + $return = []; + + foreach ($var as $k => $v) { + $return[$k] = self::export($v, $maxDepth - 1); + } + + return $return; + } + + if (! $isObj) { + return $var; + } + + $return = new \stdclass(); + if ($var instanceof \DateTimeInterface) { + $return->__CLASS__ = get_class($var); + $return->date = $var->format('c'); + $return->timezone = $var->getTimezone()->getName(); + + return $return; + } + + $return->__CLASS__ = ClassUtils::getClass($var); + + if ($var instanceof Proxy) { + $return->__IS_PROXY__ = true; + $return->__PROXY_INITIALIZED__ = $var->__isInitialized(); + } + + if ($var instanceof \ArrayObject || $var instanceof \ArrayIterator) { + $return->__STORAGE__ = self::export($var->getArrayCopy(), $maxDepth - 1); + } + + return self::fillReturnWithClassAttributes($var, $return, $maxDepth); + } + + /** + * Fill the $return variable with class attributes + * + * @param object $var + * @param stdClass $return + * @param int $maxDepth + * + * @return mixed + */ + private static function fillReturnWithClassAttributes($var, \stdClass $return, $maxDepth) + { + $reflClass = ClassUtils::newReflectionObject($var); + $parsedAttributes = array(); + do { + $currentClassName = $reflClass->getName(); + + foreach ($reflClass->getProperties() as $reflProperty) { + $attributeKey = $reflProperty->isPrivate() ? $currentClassName . '#' : ''; + $attributeKey .= $reflProperty->getName(); + + if (isset($parsedAttributes[$attributeKey])) { + continue; + } + + $parsedAttributes[$attributeKey] = true; + + $name = + $reflProperty->getName() + . ($return->__CLASS__ !== $currentClassName || $reflProperty->isPrivate() ? ':' . $currentClassName : '') + . ($reflProperty->isPrivate() ? ':private' : '') + . ($reflProperty->isProtected() ? ':protected' : '') + ; + + $reflProperty->setAccessible(true); + $return->$name = self::export($reflProperty->getValue($var), $maxDepth - 1); + } + } while ($reflClass = $reflClass->getParentClass()); + return $return; } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/common/lib/Doctrine/Common/Version.php --- a/vendor/doctrine/common/lib/Doctrine/Common/Version.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/common/lib/Doctrine/Common/Version.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,7 +34,7 @@ /** * Current Doctrine Version. */ - const VERSION = '2.6.2-DEV'; + const VERSION = '2.7.3'; /** * Compares a Doctrine version with the current one. diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/inflector/.gitignore --- a/vendor/doctrine/inflector/.gitignore Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -vendor/ -composer.lock -composer.phar -phpunit.xml diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/inflector/.travis.yml --- a/vendor/doctrine/inflector/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -language: php - -sudo: false - -cache: - directory: - - $HOME/.composer/cache - -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm - -install: - - composer install -n - -script: - - phpunit diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/inflector/composer.json --- a/vendor/doctrine/inflector/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/inflector/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -13,17 +13,20 @@ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} ], "require": { - "php": ">=5.3.2" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^6.2" }, "autoload": { - "psr-0": { "Doctrine\\Common\\Inflector\\": "lib/" } + "psr-4": { "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } + }, + "autoload-dev": { + "psr-4": { "Doctrine\\Tests\\Common\\Inflector\\": "tests/Doctrine/Common/Inflector" } }, "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php --- a/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,7 +49,7 @@ '/(matr|vert|ind)(ix|ex)$/i' => '\1ices', '/(x|ch|ss|sh)$/i' => '\1es', '/([^aeiouy]|qu)y$/i' => '\1ies', - '/(hive)$/i' => '\1s', + '/(hive|gulf)$/i' => '\1s', '/(?:([^f])fe|([lr])f)$/i' => '\1\2ves', '/sis$/i' => 'ses', '/([ti])um$/i' => '\1a', @@ -67,7 +67,16 @@ '/$/' => 's', ), 'uninflected' => array( - '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people', 'cookie' + '.*[nrlm]ese', + '.*deer', + '.*fish', + '.*measles', + '.*ois', + '.*pox', + '.*sheep', + 'people', + 'cookie', + 'police', ), 'irregular' => array( 'atlas' => 'atlases', @@ -76,6 +85,7 @@ 'brother' => 'brothers', 'cafe' => 'cafes', 'chateau' => 'chateaux', + 'niveau' => 'niveaux', 'child' => 'children', 'cookie' => 'cookies', 'corpus' => 'corpuses', @@ -95,6 +105,7 @@ 'hoof' => 'hoofs', 'human' => 'humans', 'iris' => 'irises', + 'larva' => 'larvae', 'leaf' => 'leaves', 'loaf' => 'loaves', 'man' => 'men', @@ -112,6 +123,7 @@ 'octopus' => 'octopuses', 'opus' => 'opuses', 'ox' => 'oxen', + 'passerby' => 'passersby', 'penis' => 'penises', 'person' => 'people', 'plateau' => 'plateaux', @@ -161,6 +173,7 @@ '/(tive)s$/i' => '\1', '/(hive)s$/i' => '\1', '/(drive)s$/i' => '\1', + '/(dive)s$/i' => '\1', '/([^fo])ves$/i' => '\1fe', '/(^analy)ses$/i' => '\1sis', '/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', @@ -183,8 +196,12 @@ '.*pox', '.*sheep', '.*ss', + 'police', + 'pants', + 'clothes', ), 'irregular' => array( + 'caches' => 'cache', 'criteria' => 'criterion', 'curves' => 'curve', 'emphases' => 'emphasis', @@ -206,9 +223,9 @@ 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', - 'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti', + 'Foochowese', 'Furniture', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti', 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', - 'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', '.*?media', + 'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'Luggage', 'mackerel', 'Maltese', '.*?media', 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', 'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', @@ -252,7 +269,7 @@ */ public static function classify($word) { - return str_replace(" ", "", ucwords(strtr($word, "_-", " "))); + return str_replace(' ', '', ucwords(strtr($word, '_-', ' '))); } /** @@ -404,7 +421,7 @@ if (preg_match('/(.*)\\b(' . self::$plural['cacheIrregular'] . ')$/i', $word, $regs)) { self::$cache['pluralize'][$word] = $regs[1] . substr($word, 0, 1) . substr(self::$plural['merged']['irregular'][strtolower($regs[2])], 1); - + return self::$cache['pluralize'][$word]; } @@ -457,7 +474,7 @@ if (preg_match('/(.*)\\b(' . self::$singular['cacheIrregular'] . ')$/i', $word, $regs)) { self::$cache['singularize'][$word] = $regs[1] . substr($word, 0, 1) . substr(self::$singular['merged']['irregular'][strtolower($regs[2])], 1); - + return self::$cache['singularize'][$word]; } diff -r bfffd8d7479a -r 7a779792577d vendor/doctrine/inflector/phpunit.xml.dist --- a/vendor/doctrine/inflector/phpunit.xml.dist Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - - - - performance - - - diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/.travis.yml --- a/vendor/drush/drush/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -127,6 +127,7 @@ before_deploy: - gem install mime-types -v 2.6.2 # https://github.com/travis-ci/travis-ci/issues/5145 - curl -LSs https://box-project.github.io/box2/installer.php | php + - composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction - php box.phar build - test $TRAVIS_TAG=true && mkdir s3-stable && cp drush.phar s3-stable/drush.phar - test $TRAVIS_BRANCH=master && mkdir s3-unstable && cp drush.phar s3-unstable/drush-unstable.phar diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/commands/core/drupal/update.inc --- a/vendor/drush/drush/commands/core/drupal/update.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/commands/core/drupal/update.inc Fri Feb 23 15:52:07 2018 +0000 @@ -130,6 +130,13 @@ drupal_load_updates(); update_fix_compatibility(); + // Check requirements before updating. + if (!drush_update_check_requirements()) { + if (!drush_confirm(dt('Requirements check reports errors. Do you wish to continue?'))) { + return drush_user_abort(); + } + } + // Pending hook_update_N() implementations. $pending = update_get_update_list(); @@ -186,6 +193,36 @@ return count($pending) + count($change_summary) + count($post_updates); } +/** + * Check update requirements and report any errors. + */ +function drush_update_check_requirements() { + $continue = TRUE; + + \Drupal::moduleHandler()->resetImplementations(); + $requirements = update_check_requirements(); + $severity = drupal_requirements_severity($requirements); + + // If there are issues, report them. + if ($severity != REQUIREMENT_OK) { + if ($severity === REQUIREMENT_ERROR) { + $continue = FALSE; + } + foreach ($requirements as $requirement) { + if (isset($requirement['severity']) && $requirement['severity'] != REQUIREMENT_OK) { + $message = isset($requirement['description']) ? $requirement['description'] : ''; + if (isset($requirement['value']) && $requirement['value']) { + $message .= ' (Currently using '. $requirement['title'] .' '. $requirement['value'] .')'; + } + $log_level = $requirement['severity'] === REQUIREMENT_ERROR ? LogLevel::ERROR : LogLevel::WARNING; + drush_log($message, $log_level); + } + } + } + + return $continue; +} + function _update_batch_command($id) { // In D8, we expect to be in full bootstrap. drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_FULL); diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/commands/runserver/d8-rs-router.php --- a/vendor/drush/drush/commands/runserver/d8-rs-router.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/commands/runserver/d8-rs-router.php Fri Feb 23 15:52:07 2018 +0000 @@ -60,8 +60,37 @@ // contain multiple dots (such as config entity IDs) in the path. Since this is // a virtual resource, served by index.php set the script name explicitly. // See https://github.com/drush-ops/drush/issues/2033 for more information. -$_SERVER['SCRIPT_NAME'] = '/index.php'; +// Work around the PHP bug. Update $_SERVER variables to point to the correct +// index-file. +$path = $url['path']; +$script = 'index.php'; +if (strpos($path, '.php') !== FALSE) { + // Work backwards through the path to check if a script exists. Otherwise + // fallback to index.php. + do { + $path = dirname($path); + if (preg_match('/\.php$/', $path) && is_file('.' . $path)) { + // Discovered that the path contains an existing PHP file. Use that as the + // script to include. + $script = ltrim($path, '/'); + break; + } + } while ($path !== '/' && $path !== '.'); +} -// Include the main index.php and let Drupal take over. -// n.b. Drush sets the cwd to the Drupal root during bootstrap. -include 'index.php'; +// Update $_SERVER variables to point to the correct index-file. +$index_file_absolute = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $script; +$index_file_relative = DIRECTORY_SEPARATOR . $script; + +// SCRIPT_FILENAME will point to the router script itself, it should point to +// the full path of index.php. +$_SERVER['SCRIPT_FILENAME'] = $index_file_absolute; + +// SCRIPT_NAME and PHP_SELF will either point to index.php or contain the full +// virtual path being requested depending on the URL being requested. They +// should always point to index.php relative to document root. +$_SERVER['SCRIPT_NAME'] = $index_file_relative; +$_SERVER['PHP_SELF'] = $index_file_relative; + +// Require the script and let core take over. +require $_SERVER['SCRIPT_FILENAME']; \ No newline at end of file diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/commands/sql/sql.drush.inc --- a/vendor/drush/drush/commands/sql/sql.drush.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/commands/sql/sql.drush.inc Fri Feb 23 15:52:07 2018 +0000 @@ -582,7 +582,7 @@ $message_list = array(); // Sanitize passwords. - $newpassword = drush_get_option(array('sanitize-password', 'destination-sanitize-password'), 'password'); + $newpassword = drush_get_option(array('sanitize-password', 'destination-sanitize-password'), drush_generate_password()); if ($newpassword != 'no' && $newpassword !== 0) { $pw_op = ""; diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/composer.json --- a/vendor/drush/drush/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -2,7 +2,7 @@ "name": "drush/drush", "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", "homepage": "http://www.drush.org", - "license": "GPL-2.0+", + "license": "GPL-2.0-or-later", "minimum-stability": "stable", "prefer-stable": true, "authors": [ @@ -36,15 +36,14 @@ "php": ">=5.4.5", "psr/log": "~1.0", "psy/psysh": "~0.6", - "consolidation/annotated-command": "~2", + "consolidation/annotated-command": "^2.8.1", "consolidation/output-formatters": "~3", "symfony/yaml": "~2.3|^3", "symfony/var-dumper": "~2.7|^3", "symfony/console": "~2.7|^3", "symfony/event-dispatcher": "~2.7|^3", "symfony/finder": "~2.7|^3", - "pear/console_table": "~1.3.0", - "phpdocumentor/reflection-docblock": "^2.0", + "pear/console_table": "~1.3.1", "webmozart/path-util": "~2" }, "require-dev": { diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/composer.lock --- a/vendor/drush/drush/composer.lock Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/composer.lock Fri Feb 23 15:52:07 2018 +0000 @@ -4,26 +4,25 @@ "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": "0277f7c52539e2dc1388c6f2ce7730db", + "content-hash": "f964f597be5b57a32e5078444ed7d0f4", "packages": [ { "name": "consolidation/annotated-command", - "version": "2.7.2", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "07d3c88a5de4bdd2f4aba7193387b75389dea642" + "reference": "7f94009d732922d61408536f9228aca8f22e9135" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/07d3c88a5de4bdd2f4aba7193387b75389dea642", - "reference": "07d3c88a5de4bdd2f4aba7193387b75389dea642", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7f94009d732922d61408536f9228aca8f22e9135", + "reference": "7f94009d732922d61408536f9228aca8f22e9135", "shasum": "" }, "require": { - "consolidation/output-formatters": "^3.1.10", + "consolidation/output-formatters": "^3.1.12", "php": ">=5.4.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "psr/log": "^1", "symfony/console": "^2.8|~3", "symfony/event-dispatcher": "^2.5|^3", @@ -56,20 +55,20 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-10-05T20:48:16+00:00" + "time": "2017-10-17T01:48:51+00:00" }, { "name": "consolidation/output-formatters", - "version": "3.1.11", + "version": "3.1.12", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "3a1160440819269e6d8d9c11db67129384b8fb35" + "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/3a1160440819269e6d8d9c11db67129384b8fb35", - "reference": "3a1160440819269e6d8d9c11db67129384b8fb35", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", + "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", "shasum": "" }, "require": { @@ -105,7 +104,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-08-17T22:11:07+00:00" + "time": "2017-10-12T19:38:03+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -280,16 +279,16 @@ }, { "name": "pear/console_table", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/pear/Console_Table.git", - "reference": "64100b9ee81852f4fa17823e55d0b385a544f976" + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Console_Table/zipball/64100b9ee81852f4fa17823e55d0b385a544f976", - "reference": "64100b9ee81852f4fa17823e55d0b385a544f976", + "url": "https://api.github.com/repos/pear/Console_Table/zipball/1930c11897ca61fd24b95f2f785e99e0f36dcdea", + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea", "shasum": "" }, "require": { @@ -331,56 +330,7 @@ "keywords": [ "console" ], - "time": "2016-01-21T16:14:31+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2016-01-25T08:17:30+00:00" + "time": "2018-01-25T20:47:17+00:00" }, { "name": "psr/log", @@ -431,16 +381,16 @@ }, { "name": "psy/psysh", - "version": "v0.8.11", + "version": "v0.8.14", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "b193cd020e8c6b66cea6457826ae005e94e6d2c0" + "reference": "91e53c16560bdb8b9592544bb38429ae00d6baee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/b193cd020e8c6b66cea6457826ae005e94e6d2c0", - "reference": "b193cd020e8c6b66cea6457826ae005e94e6d2c0", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/91e53c16560bdb8b9592544bb38429ae00d6baee", + "reference": "91e53c16560bdb8b9592544bb38429ae00d6baee", "shasum": "" }, "require": { @@ -500,7 +450,7 @@ "interactive", "shell" ], - "time": "2017-07-29T19:30:02+00:00" + "time": "2017-11-04T16:06:49+00:00" }, { "name": "symfony/console", @@ -731,16 +681,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -752,7 +702,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -786,7 +736,7 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-10-11T12:05:26+00:00" }, { "name": "symfony/var-dumper", @@ -1058,6 +1008,55 @@ "time": "2015-06-14T21:17:01+00:00" }, { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-01-25T08:17:30+00:00" + }, + { "name": "phpspec/prophecy", "version": "v1.7.2", "source": { diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/docs/install.md --- a/vendor/drush/drush/docs/install.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/docs/install.md Fri Feb 23 15:52:07 2018 +0000 @@ -31,11 +31,85 @@ Drupal Compatibility ----------------- -Drush Version | Drush Branch | PHP | Compatible Drupal versions | Code Status -------------- | --------- | --- | -------------------------- | ----------- -Drush 9 | [master](https://travis-ci.org/drush-ops/drush) | 5.5+ | D7, D8 | -Drush 8 | [8.x](https://travis-ci.org/drush-ops/drush) | 5.4.5+ | D6, D7, D8 | -Drush 7 | [7.x](https://travis-ci.org/drush-ops/drush) | 5.3.0+ | D6, D7 | -Drush 6 | [6.x](https://travis-ci.org/drush-ops/drush) | 5.3.0+ | D6, D7 | Unsupported -Drush 5 | [5.x](https://travis-ci.org/drush-ops/drush) | 5.2.0+ | D6, D7 | Unsupported +!!! note + Drush 9 only supports one install method. It requires that your Drupal 8 site be built with Composer and Drush be listed as a dependency. + + See the [Drush 8 docs](http://docs.drush.org/en/8.x) for installing prior versions of Drush. + +Install a site-local Drush and Drush Launcher. +----------------- +1. It is recommended that Drupal 8 sites be [built using Composer, with Drush listed as a dependency](https://github.com/drupal-composer/drupal-project). That project already includes Drush in its composer.json. If your Composer project doesn't yet depend on Drush, run `composer require drush/drush` to add it. +1. To be able to call `drush` from anywhere, install the [Drush Launcher](https://github.com/drush-ops/drush-launcher). That is a small program which listens on your $PATH and hands control to a site-local Drush that is in the /vendor directory of your Composer project. If you skip this step, run Drush from Drupal root via `../vendor/bin/drush`. In that case Drush's bash integration and custom prompt won't work. +1. Run `drush init`. This edits ~/.bashrc so that Drush's custom prompt and bash integration are active. +1. See [Usage](http://docs.drush.org/en/master/usage/) for details on using Drush. +1. To use a non-default PHP, [edit ~/.bashrc so that the desired PHP is in front of your $PATH](http://stackoverflow.com/questions/4145667/how-to-override-the-path-of-php-to-use-the-mamp-path/10653443#10653443). If that is not desirable, you can change your PATH for just one request: `PATH=/path/to/php:$PATH` drush status ...` + +!!! note + + Drush 9 cannot run commandfiles from Drush 8 and below (e.g. example.drush.inc). See our [guide on porting commandfiles](https://weitzman.github.io/blog/port-to-drush9). Also note that alias and config files use a new .yml format in Drush 9. + +Drupal Compatibility +----------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Drush Version Drush Branch PHP Compatible Drupal versions Code Style Isolation Tests Functional Tests
    Drush 9 master 5.6+ D8.4+ + + + + + +
    Drush 8 8.x 5.4.5+ D6, D7, D8.3- + + + - + + +
    Drush 7 7.x 5.3.0+ D6, D7 Unsupported
    Drush 6 6.x 5.3.0+ D6, D7 Unsupported
    Drush 5 5.x 5.2.0+ D6, D7 Unsupported
    diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/drush.info --- a/vendor/drush/drush/drush.info Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/drush.info Fri Feb 23 15:52:07 2018 +0000 @@ -1,1 +1,1 @@ -drush_version=8.1.15 +drush_version=8.1.16 diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/examples/sync_enable.drush.inc --- a/vendor/drush/drush/examples/sync_enable.drush.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/examples/sync_enable.drush.inc Fri Feb 23 15:52:07 2018 +0000 @@ -4,6 +4,9 @@ * @file * Example "Sync enable" sql-sync command alter. * + * For Drupal 8, please use the config_split module instead of this code. Drupal + * 6 and 7 sites may use this example. + * * Sync_enable adds options to sql-sync to enable and disable * modules after an sql-sync operation. One use case for this * is to use Drush site aliases to automatically enable your diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/includes/drush.inc --- a/vendor/drush/drush/includes/drush.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/includes/drush.inc Fri Feb 23 15:52:07 2018 +0000 @@ -328,6 +328,7 @@ $options['redirect-port'] = array('hidden' => TRUE, 'never-propagate' => TRUE, 'description' => 'Used by the user-login command to specify the redirect port on the local machine; it therefore would not do to pass this to the remote machines.'); $options['cache-clear'] = array('propagate' => TRUE, 'description' => 'If 0, Drush skips normal cache clearing; the caller should then clear if needed.', 'example-value' => '0', ); $options['local'] = array('propagate' => TRUE, 'description' => 'Don\'t look in global locations for commandfiles, config, and site aliases'); + $options['ignored-directories'] = array('propagate' => TRUE, 'description' => "Exclude directories when searching for files in drush_scan_directory().", 'example-value' => 'node_modules,bower_components'); $command = array( 'options' => $options, diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/includes/environment.inc --- a/vendor/drush/drush/includes/environment.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/includes/environment.inc Fri Feb 23 15:52:07 2018 +0000 @@ -498,10 +498,11 @@ // Add environmental variables, if present if (!empty($environment_variables)) { - $prefix .= ' env'; + $env = 'env'; foreach ($environment_variables as $key=>$value) { - $prefix .= ' ' . drush_escapeshellarg($key, $os) . '=' . drush_escapeshellarg($value, $os); + $env .= ' ' . drush_escapeshellarg($key, $os) . '=' . drush_escapeshellarg($value, $os); } + $prefix = $env . ' ' . $prefix; } return trim($prefix . ' ' . drush_escapeshellarg($drush_path, $os) . $additional_options); diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/includes/filesystem.inc --- a/vendor/drush/drush/includes/filesystem.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/includes/filesystem.inc Fri Feb 23 15:52:07 2018 +0000 @@ -680,7 +680,7 @@ $files = array(); // Exclude Bower and Node directories. - $nomask = array_merge($nomask, array('node_modules', 'bower_components')); + $nomask = array_merge($nomask, drush_get_option_list('ignored-directories', array('node_modules', 'bower_components'))); if (is_string($dir) && is_dir($dir) && $handle = opendir($dir)) { while (FALSE !== ($file = readdir($handle))) { diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/includes/output.inc --- a/vendor/drush/drush/includes/output.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/includes/output.inc Fri Feb 23 15:52:07 2018 +0000 @@ -34,12 +34,15 @@ if (($charset = drush_get_option('output_charset')) && function_exists('iconv')) { $msg = iconv('UTF-8', $charset, $msg); } - if (isset($handle)) { - fwrite($handle, $msg); + if (!isset($handle)) { + $handle = STDOUT; + // In the past, Drush would use `print` here; now that we are using + // fwrite (to avoid problems with php sending the http headers), we + // must explicitly capture the output, because ob_start() / ob_end() + // does not capture output written via fwrite to STDOUT. + drush_backend_output_collect($msg); } - else { - print $msg; - } + fwrite($handle, $msg); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/includes/startup.inc --- a/vendor/drush/drush/includes/startup.inc Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/includes/startup.inc Fri Feb 23 15:52:07 2018 +0000 @@ -129,7 +129,11 @@ * Determine whether current OS is a Windows variant. */ function drush_is_windows($os = NULL) { - return strtoupper(substr($os ?: PHP_OS, 0, 3)) === 'WIN'; + // The _drush_get_os() function may not be available, so resolve "LOCAL" + if (!$os || $os == "LOCAL") { + $os = PHP_OS; + } + return strtoupper(substr($os, 0, 3)) === 'WIN'; } function drush_escapeshellarg($arg, $os = NULL, $raw = FALSE) { diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/shippable.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/drush/drush/shippable.yml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,22 @@ +language: php + +php: + - "7.1" + +build: + ci: + # Set up php configuration + - echo 'mbstring.http_input = pass' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - echo 'mbstring.http_output = pass' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - echo 'memory_limit = -1' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - echo 'sendmail_path = /bin/true' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini + # Disable xdebug for faster Composer operations + # - rm $HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini + # Install / update our tools + # - composer self-update + # - composer install --prefer-dist --no-interaction + # Run lint check + # - composer lint + # No tests here + - echo 'No shippable tests on this branch' + diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/tests/archiveDumpTest.php --- a/vendor/drush/drush/tests/archiveDumpTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/tests/archiveDumpTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,7 @@ namespace Unish; +require_once dirname(__FILE__) . '/../includes/context.inc'; require_once dirname(__FILE__) . '/../includes/filesystem.inc'; /** diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/tests/generateMakeTest.php --- a/vendor/drush/drush/tests/generateMakeTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/tests/generateMakeTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,7 @@ assertEquals($expected, $actual); // Download a module to a 'contrib' directory to test the subdir feature - mkdir($this->webroot() + '/sites/all/modules/contrib'); + $this->mkdir(Path::join($this->webroot(). '/sites/all/modules/contrib')); $this->drush('pm-download', array('libraries'), array('destination' => 'sites/all/modules/contrib') + $options); $this->drush('pm-enable', array('libraries'), $options); $makefile = UNISH_SANDBOX . '/dev.make.yml'; diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/tests/makefiles/file.make --- a/vendor/drush/drush/tests/makefiles/file.make Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/tests/makefiles/file.make Fri Feb 23 15:52:07 2018 +0000 @@ -2,7 +2,7 @@ api = 2 libraries[drush_make][download][type] = "file" -libraries[drush_make][download][url] = "http://drupalcode.org/project/drush_make.git/blob_plain/8d4e770:/README.txt" +libraries[drush_make][download][url] = "https://cgit.drupalcode.org/drush_make/plain/README.txt?h=6.x-3.x&id=8d4e770aeb1cfc180d48b76b70f9bf5ee250eade" libraries[drush_make][download][filename] = "README.txt" ; Single file download diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/tests/makefiles/md5-fail.make --- a/vendor/drush/drush/tests/makefiles/md5-fail.make Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/tests/makefiles/md5-fail.make Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,6 @@ api = 2 libraries[drush_make][download][type] = "file" -libraries[drush_make][download][url] = "http://drupalcode.org/project/drush_make.git/blob_plain/8d4e770:/README.txt" +libraries[drush_make][download][url] = "https://cgit.drupalcode.org/drush_make/plain/README.txt?h=6.x-3.x&id=8d4e770aeb1cfc180d48b76b70f9bf5ee250eade" libraries[drush_make][download][filename] = "README.txt" libraries[drush_make][download][md5] = "- fail -" diff -r bfffd8d7479a -r 7a779792577d vendor/drush/drush/tests/makefiles/md5-succeed.make --- a/vendor/drush/drush/tests/makefiles/md5-succeed.make Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/drush/drush/tests/makefiles/md5-succeed.make Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,6 @@ api = 2 libraries[drush_make][download][type] = "file" -libraries[drush_make][download][url] = "http://drupalcode.org/project/drush_make.git/blob_plain/8d4e770:/README.txt" +libraries[drush_make][download][url] = "https://cgit.drupalcode.org/drush_make/plain/README.txt?h=6.x-3.x&id=8d4e770aeb1cfc180d48b76b70f9bf5ee250eade" libraries[drush_make][download][filename] = "README.txt" libraries[drush_make][download][md5] = "c8968d801a953b9ea735364d6f3dfabc" diff -r bfffd8d7479a -r 7a779792577d vendor/fabpot/goutte/.travis.yml --- a/vendor/fabpot/goutte/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/fabpot/goutte/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -1,18 +1,26 @@ language: php +sudo: false + +cache: + - $HOME/composer/cache/files + - $HOME/.phpunit_bridge + +env: + global: + - SYMFONY_PHPUNIT_DIR=$HOME/.phpunit_bridge + php: + - 7.2 + - 7.1 - 7.0 - 5.6 - 5.5 - - hhvm + - nightly install: - - travis_retry composer install --no-interaction --prefer-source + - composer update + - vendor/bin/simple-phpunit install script: - - phpunit - -matrix: - allow_failures: - - php: hhvm - - php: 7.0 + - vendor/bin/simple-phpunit diff -r bfffd8d7479a -r 7a779792577d vendor/fabpot/goutte/composer.json --- a/vendor/fabpot/goutte/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/fabpot/goutte/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -13,13 +13,17 @@ ], "require": { "php": ">=5.5.0", - "symfony/browser-kit": "~2.1|~3.0", - "symfony/css-selector": "~2.1|~3.0", - "symfony/dom-crawler": "~2.1|~3.0", + "symfony/browser-kit": "~2.1|~3.0|~4.0", + "symfony/css-selector": "~2.1|~3.0|~4.0", + "symfony/dom-crawler": "~2.1|~3.0|~4.0", "guzzlehttp/guzzle": "^6.0" }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3 || ^4" + }, "autoload": { - "psr-4": { "Goutte\\": "Goutte" } + "psr-4": { "Goutte\\": "Goutte" }, + "exclude-from-classmap": ["Goutte/Tests"] }, "extra": { "branch-alias": { diff -r bfffd8d7479a -r 7a779792577d vendor/ircmaxell/password-compat/LICENSE.md --- a/vendor/ircmaxell/password-compat/LICENSE.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -Copyright (c) 2012 Anthony Ferrara - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff -r bfffd8d7479a -r 7a779792577d vendor/ircmaxell/password-compat/composer.json --- a/vendor/ircmaxell/password-compat/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -{ - "name": "ircmaxell/password-compat", - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "keywords": ["password", "hashing"], - "homepage": "https://github.com/ircmaxell/password_compat", - "license": "MIT", - "authors": [ - { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" - } - ], - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "autoload": { - "files": ["lib/password.php"] - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/ircmaxell/password-compat/lib/password.php --- a/vendor/ircmaxell/password-compat/lib/password.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,314 +0,0 @@ - - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @copyright 2012 The Authors - */ - -namespace { - - if (!defined('PASSWORD_BCRYPT')) { - /** - * PHPUnit Process isolation caches constants, but not function declarations. - * So we need to check if the constants are defined separately from - * the functions to enable supporting process isolation in userland - * code. - */ - define('PASSWORD_BCRYPT', 1); - define('PASSWORD_DEFAULT', PASSWORD_BCRYPT); - define('PASSWORD_BCRYPT_DEFAULT_COST', 10); - } - - if (!function_exists('password_hash')) { - - /** - * Hash the password using the specified algorithm - * - * @param string $password The password to hash - * @param int $algo The algorithm to use (Defined by PASSWORD_* constants) - * @param array $options The options for the algorithm to use - * - * @return string|false The hashed password, or false on error. - */ - function password_hash($password, $algo, array $options = array()) { - if (!function_exists('crypt')) { - trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING); - return null; - } - if (is_null($password) || is_int($password)) { - $password = (string) $password; - } - if (!is_string($password)) { - trigger_error("password_hash(): Password must be a string", E_USER_WARNING); - return null; - } - if (!is_int($algo)) { - trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING); - return null; - } - $resultLength = 0; - switch ($algo) { - case PASSWORD_BCRYPT: - $cost = PASSWORD_BCRYPT_DEFAULT_COST; - if (isset($options['cost'])) { - $cost = $options['cost']; - if ($cost < 4 || $cost > 31) { - trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING); - return null; - } - } - // The length of salt to generate - $raw_salt_len = 16; - // The length required in the final serialization - $required_salt_len = 22; - $hash_format = sprintf("$2y$%02d$", $cost); - // The expected length of the final crypt() output - $resultLength = 60; - break; - default: - trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING); - return null; - } - $salt_requires_encoding = false; - if (isset($options['salt'])) { - switch (gettype($options['salt'])) { - case 'NULL': - case 'boolean': - case 'integer': - case 'double': - case 'string': - $salt = (string) $options['salt']; - break; - case 'object': - if (method_exists($options['salt'], '__tostring')) { - $salt = (string) $options['salt']; - break; - } - case 'array': - case 'resource': - default: - trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING); - return null; - } - if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) { - trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING); - return null; - } elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) { - $salt_requires_encoding = true; - } - } else { - $buffer = ''; - $buffer_valid = false; - if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) { - $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM); - if ($buffer) { - $buffer_valid = true; - } - } - if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) { - $buffer = openssl_random_pseudo_bytes($raw_salt_len); - if ($buffer) { - $buffer_valid = true; - } - } - if (!$buffer_valid && @is_readable('/dev/urandom')) { - $f = fopen('/dev/urandom', 'r'); - $read = PasswordCompat\binary\_strlen($buffer); - while ($read < $raw_salt_len) { - $buffer .= fread($f, $raw_salt_len - $read); - $read = PasswordCompat\binary\_strlen($buffer); - } - fclose($f); - if ($read >= $raw_salt_len) { - $buffer_valid = true; - } - } - if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) { - $bl = PasswordCompat\binary\_strlen($buffer); - for ($i = 0; $i < $raw_salt_len; $i++) { - if ($i < $bl) { - $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255)); - } else { - $buffer .= chr(mt_rand(0, 255)); - } - } - } - $salt = $buffer; - $salt_requires_encoding = true; - } - if ($salt_requires_encoding) { - // encode string with the Base64 variant used by crypt - $base64_digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - $bcrypt64_digits = - './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - - $base64_string = base64_encode($salt); - $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits); - } - $salt = PasswordCompat\binary\_substr($salt, 0, $required_salt_len); - - $hash = $hash_format . $salt; - - $ret = crypt($password, $hash); - - if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength) { - return false; - } - - return $ret; - } - - /** - * Get information about the password hash. Returns an array of the information - * that was used to generate the password hash. - * - * array( - * 'algo' => 1, - * 'algoName' => 'bcrypt', - * 'options' => array( - * 'cost' => PASSWORD_BCRYPT_DEFAULT_COST, - * ), - * ) - * - * @param string $hash The password hash to extract info from - * - * @return array The array of information about the hash. - */ - function password_get_info($hash) { - $return = array( - 'algo' => 0, - 'algoName' => 'unknown', - 'options' => array(), - ); - if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60) { - $return['algo'] = PASSWORD_BCRYPT; - $return['algoName'] = 'bcrypt'; - list($cost) = sscanf($hash, "$2y$%d$"); - $return['options']['cost'] = $cost; - } - return $return; - } - - /** - * Determine if the password hash needs to be rehashed according to the options provided - * - * If the answer is true, after validating the password using password_verify, rehash it. - * - * @param string $hash The hash to test - * @param int $algo The algorithm used for new password hashes - * @param array $options The options array passed to password_hash - * - * @return boolean True if the password needs to be rehashed. - */ - function password_needs_rehash($hash, $algo, array $options = array()) { - $info = password_get_info($hash); - if ($info['algo'] != $algo) { - return true; - } - switch ($algo) { - case PASSWORD_BCRYPT: - $cost = isset($options['cost']) ? $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST; - if ($cost != $info['options']['cost']) { - return true; - } - break; - } - return false; - } - - /** - * Verify a password against a hash using a timing attack resistant approach - * - * @param string $password The password to verify - * @param string $hash The hash to verify against - * - * @return boolean If the password matches the hash - */ - function password_verify($password, $hash) { - if (!function_exists('crypt')) { - trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING); - return false; - } - $ret = crypt($password, $hash); - if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13) { - return false; - } - - $status = 0; - for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++) { - $status |= (ord($ret[$i]) ^ ord($hash[$i])); - } - - return $status === 0; - } - } - -} - -namespace PasswordCompat\binary { - - if (!function_exists('PasswordCompat\\binary\\_strlen')) { - - /** - * Count the number of bytes in a string - * - * We cannot simply use strlen() for this, because it might be overwritten by the mbstring extension. - * In this case, strlen() will count the number of *characters* based on the internal encoding. A - * sequence of bytes might be regarded as a single multibyte character. - * - * @param string $binary_string The input string - * - * @internal - * @return int The number of bytes - */ - function _strlen($binary_string) { - if (function_exists('mb_strlen')) { - return mb_strlen($binary_string, '8bit'); - } - return strlen($binary_string); - } - - /** - * Get a substring based on byte limits - * - * @see _strlen() - * - * @param string $binary_string The input string - * @param int $start - * @param int $length - * - * @internal - * @return string The substring - */ - function _substr($binary_string, $start, $length) { - if (function_exists('mb_substr')) { - return mb_substr($binary_string, $start, $length, '8bit'); - } - return substr($binary_string, $start, $length); - } - - /** - * Check if current PHP version is compatible with the library - * - * @return boolean the check result - */ - function check() { - static $pass = NULL; - - if (is_null($pass)) { - if (function_exists('crypt')) { - $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG'; - $test = crypt("password", $hash); - $pass = $test == $hash; - } else { - $pass = false; - } - } - return $pass; - } - - } -} \ No newline at end of file diff -r bfffd8d7479a -r 7a779792577d vendor/ircmaxell/password-compat/version-test.php --- a/vendor/ircmaxell/password-compat/version-test.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -command('set_debug', $this->debug); } + /** + * Set the timeout after which any resource requested will stop + * trying and proceed with other parts of the page + * @param int $resourceTimeout + * @return bool + */ + public function resourceTimeout($resourceTimeout) { + return $this->command('set_resource_timeout', $resourceTimeout); + } + + /** + * Sets or unsets web proxy. + * + * @param string|false $proxy proxy url formatted as '(http|socks5)://[username:password@]host:port', or false to unset + * @return bool + * @throws \UnexpectedValueException when the proxy url is invalid + */ + public function setProxy($proxy) + { + $args = array('set_proxy'); + if ($proxy !== false) + { + if (preg_match('~^(http|socks5)://(?:([^:@/]*?):([^:@/]*?)@)?([^:@/]+):(\d+)$~', $proxy, $components)) + { + array_push($args, $components[4], intval($components[5], 10), $components[1]); + if (strlen($components[2]) || strlen($components[3])) + { + array_push($args, urldecode($components[2]), urldecode($components[3])); + } + } + else + { + throw new \UnexpectedValueException('Invalid proxy url ' . $proxy); + } + } + return call_user_func_array(array($this, 'command'), $args); + } } diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/gastonjs/src/Client/browser.js --- a/vendor/jcalderonzumba/gastonjs/src/Client/browser.js Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/gastonjs/src/Client/browser.js Fri Feb 23 15:52:07 2018 +0000 @@ -28,6 +28,7 @@ this.height = height || 768; this.pages = []; this.js_errors = (typeof jsErrors === 'boolean') ? jsErrors : true; + this._resourceTimeout = false; this._debug = false; this._counter = 0; this.resetPage(); @@ -35,7 +36,6 @@ /** * Resets the browser to a clean slate - * @return {Function} */ Browser.prototype.resetPage = function () { var _ref; @@ -55,20 +55,44 @@ phantom.clearCookies(); } - this.page = this.currentPage = new Poltergeist.WebPage; + this.page = this.currentPage = new Poltergeist.WebPage(null, this); this.page.setViewportSize({ width: this.width, height: this.height }); - this.page.handle = "" + (this._counter++); - this.pages.push(this.page); + }; - return this.page.onPageCreated = function (newPage) { - var page; - page = new Poltergeist.WebPage(newPage); - page.handle = "" + (self._counter++); - return self.pages.push(page); - }; + /** + * Adds given newly opened Poltergeist.WebPage to the list of available windows/frames + * consulted by methods getPageByHandle, window_handle, window_handles, switch_to_window and close_window. + * + * @param {WebPage} page + */ + Browser.prototype.registerPage = function (page) { + if (!('handle' in page)) + { + page.handle = "" + (this._counter++); + this.pages.push(page); + } + }; + + /** + * Removes given closed Poltergeist.WebPage from the list of available windows/frames + * consulted by methods getPageByHandle, window_handle, window_handles, switch_to_window and close_window. + * + * @param {Poltergeist.WebPage} page + */ + Browser.prototype.unregisterPage = function (page) { + if (('handle' in page) && (page.handle !== null)) + { + for (var i = this.pages.length; i--;) { + if (page === this.pages[i]) { + this.pages.splice(i,1); + break; + } + } + page.handle = null; + } }; /** @@ -198,6 +222,14 @@ var prevUrl; var self = this; this.currentPage.state = 'loading'; + + if (this._resourceTimeout) { + this.currentPage._native.settings.resourceTimeout = this._resourceTimeout; + this.currentPage._native.onResourceTimeout = function (request) { + console.log('Response (#' + request.id + '): ' + JSON.stringify(request)); + }; + } + prevUrl = this.currentPage.source === null ? 'about:blank' : this.currentPage.currentUrl(); this.currentPage.open(url); if (/#/.test(url) && prevUrl.split('#')[0] === url.split('#')[0]) { @@ -687,6 +719,7 @@ /** * Closes the window given by handle name if possible + * NOTE: Closing a page in PhantomJS also closes new windows/frames opened from that page (QWebPage behaviour) * @param serverResponse * @param handle * @return {*} @@ -1154,6 +1187,22 @@ }; /** + * Sets proxy or unsets web proxy + * @param {Object} serverResponse Phantomjs response object associated to the client request + * @param {String} ip IP or host name, or null/'' to unset + * @param {Number} port port number + * @param {String} proxyType socks5 or anything else for http(s) + * @param {String} user optional username for proxy authentication + * @param {String} password optional password for proxy authentication + * @return {*} + * @see {@link https://github.com/ariya/phantomjs/pull/11829/commits/84c31822a2e5eba21fe42298ec27ec4ccab95667} + */ + Browser.prototype.set_proxy = function (serverResponse, ip, port, proxyType, user, password) { + phantom.setProxy(ip, port, proxyType, user, password); + return this.serverSendResponse(true, serverResponse); + }; + + /** * US19: DONE * Sets a basic authentication credential to access a page * THIS SHOULD BE USED BEFORE accessing a page @@ -1239,6 +1288,18 @@ }; /** + * Sets the timeout in milliseconds, after which any resource requested will stop + * trying and proceed with other parts of the page + * @param serverResponse + * @param value + * @return {*} + */ + Browser.prototype.set_resource_timeout = function (serverResponse, value) { + this._resourceTimeout = value; + return this.serverSendResponse(true, serverResponse); + }; + + /** * Sets the urlBlacklist for the given urls as parameters * @return {boolean} */ diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/gastonjs/src/Client/main.js --- a/vendor/jcalderonzumba/gastonjs/src/Client/main.js Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/gastonjs/src/Client/main.js Fri Feb 23 15:52:07 2018 +0000 @@ -26,4 +26,4 @@ system = require('system'); -new Poltergeist(system.args[1], system.args[2], system.args[3], system.args[4] === 'false' ? false : true); +new window.Poltergeist(system.args[1], system.args[2], system.args[3], system.args[4] === 'false' ? false : true); diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/gastonjs/src/Client/web_page.js --- a/vendor/jcalderonzumba/gastonjs/src/Client/web_page.js Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/gastonjs/src/Client/web_page.js Fri Feb 23 15:52:07 2018 +0000 @@ -22,7 +22,7 @@ WebPage.EXTENSIONS = []; - function WebPage(nativeWebPage) { + function WebPage(nativeWebPage, browser) { var callback, i, callBacksLength, callBacksRef; //Lets create the native phantomjs webpage @@ -32,6 +32,11 @@ this._native = nativeWebPage; } + this.browser = browser; + if (this.browser) { + this.browser.registerPage(this); // Make the browser aware of opened windows/frames + } + this.id = 0; this.source = null; this.closed = false; @@ -98,8 +103,11 @@ * @return {boolean} */ WebPage.prototype.onClosingNative = function () { - this.handle = null; - return this.closed = true; + this.closed = true; + if (this.browser) { + this.browser.unregisterPage(this); // Make the browser aware of closed windows/frames + } + return true; }; /** @@ -148,6 +156,15 @@ }; /** + * Make the browser aware of new windows/frames + * + * @param {webPage} newPage + */ + WebPage.prototype.onPageCreatedNative = function (newPage) { + new WebPage(newPage, this.browser); + }; + + /** * This callback is invoked when there is a JavaScript execution error. * It is a good way to catch problems when evaluating a script in the web page context. * The arguments passed to the callback are the error message and the stack trace [as an Array]. diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/.gitignore --- a/vendor/jcalderonzumba/mink-phantomjs-driver/.gitignore Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/.gitignore Fri Feb 23 15:52:07 2018 +0000 @@ -3,6 +3,7 @@ bin/behat bin/phantomjs bin/phpunit +bin/mink-test-server composer.lock tmp/* tests/integration/ScreenShotContext.php diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/.travis.yml --- a/vendor/jcalderonzumba/mink-phantomjs-driver/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -18,6 +18,15 @@ - php: 7.0 - php: hhvm +env: + global: + # Force the mink test server to use PHP 5.6 as HHVM does not provide the builtin webserver + - MINK_PHP_BIN=~/.phpenv/versions/5.6/bin/php + # Force the mink test server to bin on IPv4, as PhantomJS resolves localhost as IPv4 while PHP seems to prefer resolving it as IPv6 on Travis + - MINK_HOST=127.0.0.1:8002 + # Avoid restarting the browser api at the end of tests (see bin/run_tests.sh) + - MINK_STOP_BROWSER=1 + cache: directories: - $HOME/.composer/cache/files @@ -34,7 +43,3 @@ script: - bin/run-tests.sh - -after_script: - - ps axo pid,command | grep phantomjs | grep -v grep | awk '{print $1}' | xargs -I {} kill {} - - ps axo pid,command | grep php | grep -v grep | awk '{print $1}' | xargs -I {} kill {} diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/CHANGELOG-0.2.md --- a/vendor/jcalderonzumba/mink-phantomjs-driver/CHANGELOG-0.2.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -CHANGELOG for 0.2.x -=================== -This changelog references the relevant changes (bug and security fixes) done in 0.2 minor versions. - -* 0.2.3 - - * bug #1 set_url_blacklist was not working properly (thanks to reporter) diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/CHANGELOG.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,11 @@ +# CHANGELOG + +This changelog references the relevant changes (bug and security fixes). + +## 0.2.3 + + * bug #1 set_url_blacklist was not working properly (thanks to reporter) + +## 0.3.3 + * Performance improvement fix when JS condition is met + * Using the new official mink/driver-test-suite repository diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/README.md --- a/vendor/jcalderonzumba/mink-phantomjs-driver/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -38,6 +38,10 @@ ```bash phantomjs --ssl-protocol=any --ignore-ssl-errors=true vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /tmp/gastonjs.log & ``` +Driver instantiation: +```php +$driver = new Zumba\Mink\Driver\PhantomJSDriver('http://localhost:8510'); +``` FAQ --------- diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/bin/run-tests.sh --- a/vendor/jcalderonzumba/mink-phantomjs-driver/bin/run-tests.sh Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/bin/run-tests.sh Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e start_browser_api(){ @@ -14,27 +14,28 @@ stop_services(){ ps axo pid,command | grep phantomjs | grep -v grep | awk '{print $1}' | xargs -I {} kill {} - ps axo pid,command | grep php | grep -v grep | grep -v phpstorm | awk '{print $1}' | xargs -I {} kill {} + ps axo pid,command | grep php | grep -v grep | grep -v phpstorm | grep -v php-fpm | awk '{print $1}' | xargs -I {} kill {} sleep 2 } -star_local_browser(){ +start_local_browser(){ CURRENT_DIR=$(pwd) - cd ${CURRENT_DIR}/vendor/behat/mink/driver-testsuite/web-fixtures - if [ "$TRAVIS" = true ]; then - echo "Starting webserver fox fixtures...." - ~/.phpenv/versions/5.6/bin/php -S 127.0.0.1:6789 > /dev/null 2>&1 & - else - php -S 127.0.0.1:6789 2>&1 >> /dev/null & - fi + ${CURRENT_DIR}/bin/mink-test-server > /dev/null 2>&1 & sleep 2 } +function finish() { + stop_services + if [ -z "$MINK_STOP_BROWSER" ]; then + start_browser_api + fi +} + +trap finish EXIT + mkdir -p /tmp/jcalderonzumba/phantomjs -stop_services +stop_services || true start_browser_api -star_local_browser +start_local_browser cd ${CURRENT_DIR} ${CURRENT_DIR}/bin/phpunit --configuration integration_tests.xml -stop_services -start_browser_api diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/composer.json --- a/vendor/jcalderonzumba/mink-phantomjs-driver/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -21,16 +21,13 @@ ], "require": { "php": ">=5.4", - "behat/mink": "~1.6", + "behat/mink": "~1.7", "twig/twig": "~1.20|~2.0", "jcalderonzumba/gastonjs": "~1.0" }, "require-dev": { - "symfony/process": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/css-selector": "~2.1", - "phpunit/phpunit": "~4.6", - "silex/silex": "~1.2" + "mink/driver-testsuite": "dev-master", + "phpunit/phpunit": "~4.6" }, "config": { "bin-dir": "bin" diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/integration_tests.xml --- a/vendor/jcalderonzumba/mink-phantomjs-driver/integration_tests.xml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/integration_tests.xml Fri Feb 23 15:52:07 2018 +0000 @@ -1,30 +1,15 @@ - + - tests/integration - vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php - vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php - vendor/behat/mink/driver-testsuite/tests/Basic/CookieTest.php - vendor/behat/mink/driver-testsuite/tests/Basic/ErrorHandlingTest.php - vendor/behat/mink/driver-testsuite/tests/Basic/IFrameTest.php - vendor/behat/mink/driver-testsuite/tests/Basic/ScreenshotTest.php - vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php - vendor/behat/mink/driver-testsuite/tests/Basic/VisibilityTest.php - vendor/behat/mink/driver-testsuite/tests/Form - vendor/behat/mink/driver-testsuite/tests/Js - - - - - + + vendor/mink/driver-testsuite/tests/ - @@ -32,7 +17,7 @@ - ./src/Behat/Mink/Driver + ./src/ diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/src/BasePhantomJSDriver.php --- a/vendor/jcalderonzumba/mink-phantomjs-driver/src/BasePhantomJSDriver.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/src/BasePhantomJSDriver.php Fri Feb 23 15:52:07 2018 +0000 @@ -4,7 +4,6 @@ use Behat\Mink\Driver\CoreDriver; use Behat\Mink\Exception\DriverException; -use Behat\Mink\Session; use Zumba\GastonJS\Browser\Browser; /** @@ -13,8 +12,6 @@ */ class BasePhantomJSDriver extends CoreDriver { - /** @var Session */ - protected $session; /** @var Browser */ protected $browser; /** @var string */ @@ -73,14 +70,6 @@ } /** - * {@inheritdoc} - * @param Session $session - */ - public function setSession(Session $session) { - $this->session = $session; - } - - /** * @return Browser */ public function getBrowser() { diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/src/JavascriptTrait.php --- a/vendor/jcalderonzumba/mink-phantomjs-driver/src/JavascriptTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/src/JavascriptTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,7 +15,7 @@ * @param string $script */ public function executeScript($script) { - $this->browser->execute($script); + $this->browser->execute($this->fixSelfExecutingFunction($script)); } /** @@ -24,7 +24,11 @@ * @return mixed */ public function evaluateScript($script) { - return $this->browser->evaluate($script); + $script = preg_replace('/^return\s+/', '', $script); + + $script = $this->fixSelfExecutingFunction($script); + + return $this->browser->evaluate($script); } /** @@ -40,10 +44,32 @@ $end = $start + $timeout / 1000.0; do { $result = $this->browser->evaluate($condition); + if ($result) { + // No need to wait any longer when the condition is met already. + return TRUE; + } usleep(100000); } while (microtime(true) < $end && !$result); return (bool)$result; } + /** + * Fixes self-executing functions to allow evaluating them. + * + * The self-executing function must be wrapped in braces to work. + * + * @param string $script + * + * @return string + */ + private function fixSelfExecutingFunction($script) + { + if (preg_match('/^function[\s\(]/', $script)) { + $script = preg_replace('/;$/', '', $script); + $script = '(' . $script . ')'; + } + + return $script; + } } diff -r bfffd8d7479a -r 7a779792577d vendor/jcalderonzumba/mink-phantomjs-driver/src/PhantomJSDriver.php --- a/vendor/jcalderonzumba/mink-phantomjs-driver/src/PhantomJSDriver.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/jcalderonzumba/mink-phantomjs-driver/src/PhantomJSDriver.php Fri Feb 23 15:52:07 2018 +0000 @@ -2,7 +2,6 @@ namespace Zumba\Mink\Driver; -use Behat\Mink\Element\NodeElement; use Behat\Mink\Exception\DriverException; /** @@ -144,21 +143,21 @@ /** * Finds elements with specified XPath query. * @param string $xpath - * @return NodeElement[] + * @return string[] * @throws DriverException When the operation cannot be done */ - public function find($xpath) { + protected function findElementXpaths($xpath) { $elements = $this->browser->find("xpath", $xpath); - $nodeElements = array(); + $nodeXPaths = array(); if (!isset($elements["ids"])) { - return null; + return array(); } foreach ($elements["ids"] as $i => $elementId) { - $nodeElements[] = new NodeElement(sprintf('(%s)[%d]', $xpath, $i + 1), $this->session); + $nodeXPaths[] = sprintf('(%s)[%d]', $xpath, $i + 1); } - return $nodeElements; + return $nodeXPaths; } } diff -r bfffd8d7479a -r 7a779792577d vendor/nikic/php-parser/CHANGELOG.md --- a/vendor/nikic/php-parser/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/nikic/php-parser/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,8 +1,23 @@ -Version 3.1.3-dev +Version 3.1.5-dev ----------------- Nothing yet. +Version 3.1.4 (2018-01-25) +-------------------------- + +### Fixed + +* Fixed pretty printing of `-(-$x)` and `+(+$x)`. (#459) + +Version 3.1.3 (2017-12-26) +-------------------------- + +### Fixed + +* Improve compatibility with php-scoper, by supporting prefixed namespaces in + `NodeAbstract::getType()`. + Version 3.1.2 (2017-11-04) -------------------------- diff -r bfffd8d7479a -r 7a779792577d vendor/nikic/php-parser/LICENSE --- a/vendor/nikic/php-parser/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/nikic/php-parser/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2011 by Nikita Popov. +Copyright (c) 2011-2018 by Nikita Popov. Some rights reserved. @@ -28,4 +28,4 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -r bfffd8d7479a -r 7a779792577d vendor/nikic/php-parser/lib/PhpParser/Lexer.php --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer.php Fri Feb 23 15:52:07 2018 +0000 @@ -360,7 +360,7 @@ if ('T_HASHBANG' === $name) { // HHVM uses a special token for #! hashbang lines $tokenMap[$i] = Tokens::T_INLINE_HTML; - } else if (defined($name = 'PhpParser\Parser\Tokens::' . $name)) { + } else if (defined($name = Tokens::class . '::' . $name)) { // Other tokens can be mapped directly $tokenMap[$i] = constant($name); } diff -r bfffd8d7479a -r 7a779792577d vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php --- a/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,7 +21,15 @@ * @return string Type of the node */ public function getType() { - return strtr(substr(rtrim(get_class($this), '_'), 15), '\\', '_'); + $className = rtrim(get_class($this), '_'); + return strtr( + substr( + $className, + strpos($className, 'PhpParser\Node') + 15 + ), + '\\', + '_' + ); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php --- a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php Fri Feb 23 15:52:07 2018 +0000 @@ -374,10 +374,18 @@ } protected function pExpr_UnaryMinus(Expr\UnaryMinus $node) { + if ($node->expr instanceof Expr\UnaryMinus || $node->expr instanceof Expr\PreDec) { + // Enforce -(-$expr) instead of --$expr + return '-(' . $this->p($node->expr) . ')'; + } return $this->pPrefixOp('Expr_UnaryMinus', '-', $node->expr); } protected function pExpr_UnaryPlus(Expr\UnaryPlus $node) { + if ($node->expr instanceof Expr\UnaryPlus || $node->expr instanceof Expr\PreInc) { + // Enforce +(+$expr) instead of ++$expr + return '+(' . $this->p($node->expr) . ')'; + } return $this->pPrefixOp('Expr_UnaryPlus', '+', $node->expr); } diff -r bfffd8d7479a -r 7a779792577d vendor/nikic/php-parser/test/code/prettyPrinter/expr/parentheses.test --- a/vendor/nikic/php-parser/test/code/prettyPrinter/expr/parentheses.test Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/nikic/php-parser/test/code/prettyPrinter/expr/parentheses.test Fri Feb 23 15:52:07 2018 +0000 @@ -38,6 +38,11 @@ print ($a and print $b); +-(-$a); ++(+$a); +-(--$a); ++(++$a); + // The following will currently add unnecessary parentheses, because the pretty printer is not aware that assignment // and incdec only work on variables. !$a = $b; @@ -70,6 +75,10 @@ yield from $a and yield from $b; yield from ($a and yield from $b); print ($a and print $b); +-(-$a); ++(+$a); +-(--$a); ++(++$a); // The following will currently add unnecessary parentheses, because the pretty printer is not aware that assignment // and incdec only work on variables. !($a = $b); diff -r bfffd8d7479a -r 7a779792577d vendor/paragonie/random_compat/lib/cast_to_int.php --- a/vendor/paragonie/random_compat/lib/cast_to_int.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/paragonie/random_compat/lib/cast_to_int.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,9 +38,10 @@ * through. * * @param int|float $number The number we want to convert to an int - * @param boolean $fail_open Set to true to not throw an exception + * @param bool $fail_open Set to true to not throw an exception * * @return float|int + * @psalm-suppress InvalidReturnType * * @throws TypeError */ diff -r bfffd8d7479a -r 7a779792577d vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php --- a/vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php Fri Feb 23 15:52:07 2018 +0000 @@ -70,10 +70,10 @@ $n = ($bytes - $i) > 1073741824 ? 1073741824 : $bytes - $i; - $buf .= Sodium::randombytes_buf($n); + $buf .= Sodium::randombytes_buf((int) $n); } } else { - $buf .= Sodium::randombytes_buf($bytes); + $buf .= Sodium::randombytes_buf((int) $bytes); } if (is_string($buf)) { diff -r bfffd8d7479a -r 7a779792577d vendor/paragonie/random_compat/lib/random_int.php --- a/vendor/paragonie/random_compat/lib/random_int.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/paragonie/random_compat/lib/random_int.php Fri Feb 23 15:52:07 2018 +0000 @@ -78,7 +78,7 @@ } if ($max === $min) { - return $min; + return (int) $min; } /** @@ -185,6 +185,6 @@ */ } while (!is_int($val) || $val > $max || $val < $min); - return (int)$val; + return (int) $val; } } diff -r bfffd8d7479a -r 7a779792577d vendor/paragonie/random_compat/psalm.xml --- a/vendor/paragonie/random_compat/psalm.xml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/paragonie/random_compat/psalm.xml Fri Feb 23 15:52:07 2018 +0000 @@ -8,6 +8,7 @@ + diff -r bfffd8d7479a -r 7a779792577d vendor/pear/console_table/.travis.yml --- a/vendor/pear/console_table/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/pear/console_table/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -2,8 +2,10 @@ install: - pear install Console_Color2-alpha php: - - 5.3 - 5.4 - 5.5 - 5.6 + - 7.0 + - 7.1 + - 7.2 script: cd tests && pear run-tests . diff -r bfffd8d7479a -r 7a779792577d vendor/pear/console_table/Table.php --- a/vendor/pear/console_table/Table.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/pear/console_table/Table.php Fri Feb 23 15:52:07 2018 +0000 @@ -647,14 +647,16 @@ $return = array(); for ($i = 0; $i < count($this->_data); $i++) { - for ($j = 0; $j < count($this->_data[$i]); $j++) { - if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE && - $this->_strlen($this->_data[$i][$j]) < - $this->_cell_lengths[$j]) { - $this->_data[$i][$j] = $this->_strpad($this->_data[$i][$j], - $this->_cell_lengths[$j], - ' ', - $this->_col_align[$j]); + if (is_array($this->_data[$i])) { + for ($j = 0; $j < count($this->_data[$i]); $j++) { + if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE && + $this->_strlen($this->_data[$i][$j]) < + $this->_cell_lengths[$j]) { + $this->_data[$i][$j] = $this->_strpad($this->_data[$i][$j], + $this->_cell_lengths[$j], + ' ', + $this->_col_align[$j]); + } } } @@ -786,7 +788,7 @@ function _updateRowsCols($rowdata = null) { // Update maximum columns. - $this->_max_cols = max($this->_max_cols, count($rowdata)); + $this->_max_cols = max($this->_max_cols, is_array($rowdata) ? count($rowdata) : 0); // Update maximum rows. ksort($this->_data); @@ -822,12 +824,14 @@ */ function _calculateCellLengths($row) { - for ($i = 0; $i < count($row); $i++) { - if (!isset($this->_cell_lengths[$i])) { - $this->_cell_lengths[$i] = 0; + if (is_array($row)) { + for ($i = 0; $i < count($row); $i++) { + if (!isset($this->_cell_lengths[$i])) { + $this->_cell_lengths[$i] = 0; + } + $this->_cell_lengths[$i] = max($this->_cell_lengths[$i], + $this->_strlen($row[$i])); } - $this->_cell_lengths[$i] = max($this->_cell_lengths[$i], - $this->_strlen($row[$i])); } } diff -r bfffd8d7479a -r 7a779792577d vendor/pear/console_table/package.xml --- a/vendor/pear/console_table/package.xml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/pear/console_table/package.xml Fri Feb 23 15:52:07 2018 +0000 @@ -28,9 +28,9 @@ xnoguer@php.net no - 2016-01-21 + 2018-01-25 - 1.3.0 + 1.3.1 1.3.0 @@ -39,7 +39,7 @@ BSD -* Fix warning with PHP 7 and bump required PHP version to 5.2.0 (Pieter Frenssen PR #13). +* Fix warning with PHP 7.2 when passing non-array data (Remi Collet <remi@remirepo.net>, PR #14). @@ -397,5 +397,20 @@ * Fix warning with PHP 7 and bump required PHP version to 5.2.0 (Pieter Frenssen PR #13). + + 2018-01-25 + + 1.3.1 + 1.3.0 + + + stable + stable + + BSD + +* Fix warning with PHP 7.2 when passing non-array data (Remi Collet <remi@remirepo.net>, PR #14). + + diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-common/.travis.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-common/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,35 @@ +language: php +php: + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - hhvm + - nightly + +matrix: + allow_failures: + - php: + - hhvm + - nightly + +cache: + directories: + - $HOME/.composer/cache + +script: + - vendor/bin/phpunit --coverage-clover=coverage.clover -v + - composer update --no-interaction --prefer-source + - vendor/bin/phpunit -v + +before_script: + - composer install --no-interaction + +after_script: + - if [ $TRAVIS_PHP_VERSION = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi + +notifications: + irc: "irc.freenode.org#phpdocumentor" + email: + - me@mikevanriel.com + - ashnazg@php.net diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-common/LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-common/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 phpDocumentor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-common/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-common/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,2 @@ +# ReflectionCommon +[![Build Status](https://travis-ci.org/phpDocumentor/ReflectionCommon.svg?branch=master)](https://travis-ci.org/phpDocumentor/ReflectionCommon) diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-common/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-common/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,29 @@ +{ + "name": "phpdocumentor/reflection-common", + "keywords": ["phpdoc", "phpDocumentor", "reflection", "static analysis", "FQSEN"], + "homepage": "http://www.phpdoc.org", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "license": "MIT", + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "require": { + "php": ">=5.5" + }, + "autoload" : { + "psr-4" : { + "phpDocumentor\\Reflection\\": ["src"] + } + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-common/src/Element.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-common/src/Element.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,32 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +/** + * Interface for files processed by the ProjectFactory + */ +interface File +{ + /** + * Returns the content of the file as a string. + * + * @return string + */ + public function getContents(); + + /** + * Returns md5 hash of the file. + * + * @return string + */ + public function md5(); + + /** + * Returns an relative path to the file. + * + * @return string + */ + public function path(); +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-common/src/Fqsen.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-common/src/Fqsen.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,82 @@ +fqsen = $fqsen; + + if (isset($matches[2])) { + $this->name = $matches[2]; + } else { + $matches = explode('\\', $fqsen); + $this->name = trim(end($matches), '()'); + } + } + + /** + * converts this class to string. + * + * @return string + */ + public function __toString() + { + return $this->fqsen; + } + + /** + * Returns the name of the element without path. + * + * @return string + */ + public function getName() + { + return $this->name; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-common/src/Location.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-common/src/Location.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,57 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +/** + * The location where an element occurs within a file. + */ +final class Location +{ + /** @var int */ + private $lineNumber = 0; + + /** @var int */ + private $columnNumber = 0; + + /** + * Initializes the location for an element using its line number in the file and optionally the column number. + * + * @param int $lineNumber + * @param int $columnNumber + */ + public function __construct($lineNumber, $columnNumber = 0) + { + $this->lineNumber = $lineNumber; + $this->columnNumber = $columnNumber; + } + + /** + * Returns the line number that is covered by this location. + * + * @return integer + */ + public function getLineNumber() + { + return $this->lineNumber; + } + + /** + * Returns the column number (character position on a line) for this location object. + * + * @return integer + */ + public function getColumnNumber() + { + return $this->columnNumber; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-common/src/Project.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-common/src/Project.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,25 @@ + /dev/null - - phpenv rehash > /dev/null - - composer selfupdate --quiet - - composer install --no-interaction --prefer-source --dev - - vendor/bin/phpunit - - composer update --no-interaction --prefer-source --dev - -notifications: - irc: "irc.freenode.org#phpdocumentor" - email: - - mike.vanriel@naenius.com - - ashnazg@php.net - - boen.robot@gmail.com diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/README.md --- a/vendor/phpdocumentor/reflection-docblock/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -10,48 +10,58 @@ With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock. -> **Note**: *this is a core component of phpDocumentor and is constantly being -> optimized for performance.* - Installation ------------ -You can install the component in the following ways: - -* Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock) -* Via Composer (http://packagist.org/packages/phpdocumentor/reflection-docblock) +```bash +composer require phpdocumentor/reflection-docblock +``` Usage ----- -The ReflectionDocBlock component is designed to work in an identical fashion to -PHP's own Reflection extension (http://php.net/manual/en/book.reflection.php). +In order to parse the DocBlock one needs a DocBlockFactory that can be +instantiated using its `createInstance` factory method like this: -Parsing can be initiated by instantiating the -`\phpDocumentor\Reflection\DocBlock()` class and passing it a string containing -a DocBlock (including asterisks) or by passing an object supporting the -`getDocComment()` method. +```php +$factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance(); +``` -> *Examples of objects having the `getDocComment()` method are the -> `ReflectionClass` and the `ReflectionMethod` classes of the PHP -> Reflection extension* +Then we can use the `create` method of the factory to interpret the DocBlock. +Please note that it is also possible to provide a class that has the +`getDocComment()` method, such as an object of type `ReflectionClass`, the +create method will read that if it exists. -Example: +```php +$docComment = <<create($docComment); +``` -or +The `create` method will yield an object of type `\phpDocumentor\Reflection\DocBlock` +whose methods can be queried: - $docblock = <<getSummary(); - $phpdoc = new \phpDocumentor\Reflection\DocBlock($docblock); +// Contains \phpDocumentor\Reflection\DocBlock\Description object +$description = $docblock->getDescription(); +// You can either cast it to string +$description = (string) $docblock->getDescription(); + +// Or use the render method to get a string representation of the Description. +$description = $docblock->getDescription()->render(); +``` + +> For more examples it would be best to review the scripts in the [`/examples` folder](/examples). diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/composer.json --- a/vendor/phpdocumentor/reflection-docblock/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -1,26 +1,34 @@ { "name": "phpdocumentor/reflection-docblock", + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "type": "library", "license": "MIT", "authors": [ - {"name": "Mike van Riel", "email": "mike.vanriel@naenius.com"} + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } ], "require": { - "php": ">=5.3.3" + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" }, "autoload": { - "psr-0": {"phpDocumentor": ["src/"]} + "psr-4": {"phpDocumentor\\Reflection\\": ["src/"]} + }, + "autoload-dev": { + "psr-4": {"phpDocumentor\\Reflection\\": ["tests/unit"]} }, "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4", + "doctrine/instantiator": "~1.0.5" }, "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "4.x-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/composer.lock --- a/vendor/phpdocumentor/reflection-docblock/composer.lock Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,827 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "ea1734d11b8c878445c2c6e58de8b85f", - "packages": [], - "packages-dev": [ - { - "name": "ocramius/instantiator", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/Instantiator.git", - "reference": "a7abbb5fc9df6e7126af741dd6c140d1a7369435" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/Instantiator/zipball/a7abbb5fc9df6e7126af741dd6c140d1a7369435", - "reference": "a7abbb5fc9df6e7126af741dd6c140d1a7369435", - "shasum": "" - }, - "require": { - "ocramius/lazy-map": "1.0.*", - "php": "~5.3" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Instantiator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/Ocramius/Instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2014-08-14 15:10:55" - }, - { - "name": "ocramius/lazy-map", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/LazyMap.git", - "reference": "7fe3d347f5e618bcea7d39345ff83f3651d8b752" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/LazyMap/zipball/7fe3d347f5e618bcea7d39345ff83f3651d8b752", - "reference": "7fe3d347f5e618bcea7d39345ff83f3651d8b752", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "athletic/athletic": "~0.1.6", - "phpmd/phpmd": "1.5.*", - "phpunit/phpunit": ">=3.7", - "satooshi/php-coveralls": "~0.6", - "squizlabs/php_codesniffer": "1.4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "LazyMap\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/", - "role": "Developer" - } - ], - "description": "A library that provides lazy instantiation logic for a map of objects", - "homepage": "https://github.com/Ocramius/LazyMap", - "keywords": [ - "lazy", - "lazy instantiation", - "lazy loading", - "map", - "service location" - ], - "time": "2013-11-09 22:30:54" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6d196af48e8c100a3ae881940123e693da5a9217" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6d196af48e8c100a3ae881940123e693da5a9217", - "reference": "6d196af48e8c100a3ae881940123e693da5a9217", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3.1", - "phpunit/php-text-template": "~1.2.0", - "phpunit/php-token-stream": "~1.2.2", - "sebastian/environment": "~1.0.0", - "sebastian/version": "~1.0.3" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4.0.14" - }, - "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/", - "include-path": [ - "" - ], - "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": "2014-08-06 06:39:42" - }, - { - "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-10 15:34:57" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "Text/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2014-01-30 17:20:04" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "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": "2013-08-02 07:42:54" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2014-03-03 05:10:30" - }, - { - "name": "phpunit/phpunit", - "version": "4.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a33fa68ece9f8c68589bfc2da8d2794e27b820bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a33fa68ece9f8c68589bfc2da8d2794e27b820bc", - "reference": "a33fa68ece9f8c68589bfc2da8d2794e27b820bc", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": "~2.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.2", - "sebastian/comparator": "~1.0", - "sebastian/diff": "~1.1", - "sebastian/environment": "~1.0", - "sebastian/exporter": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2.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-08-18 05:12:30" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "42e589e08bc86e3e9bdf20d385e948347788505b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/42e589e08bc86e3e9bdf20d385e948347788505b", - "reference": "42e589e08bc86e3e9bdf20d385e948347788505b", - "shasum": "" - }, - "require": { - "ocramius/instantiator": "~1.0", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "4.2.*@dev" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.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-08-02 13:50:58" - }, - { - "name": "sebastian/comparator", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", - "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.1", - "sebastian/exporter": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2014-05-02 07:05:58" - }, - { - "name": "sebastian/diff", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", - "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2013-08-03 16:46:33" - }, - { - "name": "sebastian/environment", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/79517609ec01139cd7e9fded0dd7ce08c952ef6a", - "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "4.0.*@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2014-02-18 16:17:19" - }, - { - "name": "sebastian/exporter", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", - "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "4.0.*@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net", - "role": "Lead" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2014-02-16 08:26:31" - }, - { - "name": "sebastian/version", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "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": "2014-03-07 15:35:33" - }, - { - "name": "symfony/yaml", - "version": "v2.5.3", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", - "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2014-08-05 09:00:40" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "platform": { - "php": ">=5.3.3" - }, - "platform-dev": [] -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/easy-coding-standard.neon --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/easy-coding-standard.neon Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ +includes: + - temp/ecs/config/clean-code.neon + - temp/ecs/config/psr2-checkers.neon + - temp/ecs/config/spaces.neon + - temp/ecs/config/common.neon + +checkers: + PhpCsFixer\Fixer\Operator\ConcatSpaceFixer: + spacing: one + +parameters: + exclude_checkers: + # from temp/ecs/config/common.neon + - PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer + - PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer + - PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer + # from temp/ecs/config/spaces.neon + - PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer + + skip: + SlevomatCodingStandard\Sniffs\Classes\UnusedPrivateElementsSniff: + # WIP code + - src/DocBlock/StandardTagFactory.php + PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff: + # WIP code + - src/DocBlock/StandardTagFactory.php + PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff: + - src/DocBlock/Tags/Return_.php + - src/DocBlock/Tags/Var_.php + PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff: + - */tests/** diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist --- a/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - ./tests/ - - - - - ./src/ - - - diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,236 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\DocBlock\Tag; +use Webmozart\Assert\Assert; + +final class DocBlock +{ + /** @var string The opening line for this docblock. */ + private $summary = ''; + + /** @var DocBlock\Description The actual description for this docblock. */ + private $description = null; + + /** @var Tag[] An array containing all the tags in this docblock; except inline. */ + private $tags = []; + + /** @var Types\Context Information about the context of this DocBlock. */ + private $context = null; + + /** @var Location Information about the location of this DocBlock. */ + private $location = null; + + /** @var bool Is this DocBlock (the start of) a template? */ + private $isTemplateStart = false; + + /** @var bool Does this DocBlock signify the end of a DocBlock template? */ + private $isTemplateEnd = false; + + /** + * @param string $summary + * @param DocBlock\Description $description + * @param DocBlock\Tag[] $tags + * @param Types\Context $context The context in which the DocBlock occurs. + * @param Location $location The location within the file that this DocBlock occurs in. + * @param bool $isTemplateStart + * @param bool $isTemplateEnd + */ + public function __construct( + $summary = '', + DocBlock\Description $description = null, + array $tags = [], + Types\Context $context = null, + Location $location = null, + $isTemplateStart = false, + $isTemplateEnd = false + ) { + Assert::string($summary); + Assert::boolean($isTemplateStart); + Assert::boolean($isTemplateEnd); + Assert::allIsInstanceOf($tags, Tag::class); + + $this->summary = $summary; + $this->description = $description ?: new DocBlock\Description(''); + foreach ($tags as $tag) { + $this->addTag($tag); + } + + $this->context = $context; + $this->location = $location; + + $this->isTemplateEnd = $isTemplateEnd; + $this->isTemplateStart = $isTemplateStart; + } + + /** + * @return string + */ + public function getSummary() + { + return $this->summary; + } + + /** + * @return DocBlock\Description + */ + public function getDescription() + { + return $this->description; + } + + /** + * Returns the current context. + * + * @return Types\Context + */ + public function getContext() + { + return $this->context; + } + + /** + * Returns the current location. + * + * @return Location + */ + public function getLocation() + { + return $this->location; + } + + /** + * Returns whether this DocBlock is the start of a Template section. + * + * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker + * (`#@+`) that is appended directly after the opening `/**` of a DocBlock. + * + * An example of such an opening is: + * + * ``` + * /**#@+ + * * My DocBlock + * * / + * ``` + * + * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all + * elements that follow until another DocBlock is found that contains the closing marker (`#@-`). + * + * @see self::isTemplateEnd() for the check whether a closing marker was provided. + * + * @return boolean + */ + public function isTemplateStart() + { + return $this->isTemplateStart; + } + + /** + * Returns whether this DocBlock is the end of a Template section. + * + * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. + * + * @return boolean + */ + public function isTemplateEnd() + { + return $this->isTemplateEnd; + } + + /** + * Returns the tags for this DocBlock. + * + * @return Tag[] + */ + public function getTags() + { + return $this->tags; + } + + /** + * Returns an array of tags matching the given name. If no tags are found + * an empty array is returned. + * + * @param string $name String to search by. + * + * @return Tag[] + */ + public function getTagsByName($name) + { + Assert::string($name); + + $result = []; + + /** @var Tag $tag */ + foreach ($this->getTags() as $tag) { + if ($tag->getName() !== $name) { + continue; + } + + $result[] = $tag; + } + + return $result; + } + + /** + * Checks if a tag of a certain type is present in this DocBlock. + * + * @param string $name Tag name to check for. + * + * @return bool + */ + public function hasTag($name) + { + Assert::string($name); + + /** @var Tag $tag */ + foreach ($this->getTags() as $tag) { + if ($tag->getName() === $name) { + return true; + } + } + + return false; + } + + /** + * Remove a tag from this DocBlock. + * + * @param Tag $tag The tag to remove. + * + * @return void + */ + public function removeTag(Tag $tagToRemove) + { + foreach ($this->tags as $key => $tag) { + if ($tag === $tagToRemove) { + unset($this->tags[$key]); + break; + } + } + } + + /** + * Adds a tag to this DocBlock. + * + * @param Tag $tag The tag to add. + * + * @return void + */ + private function addTag(Tag $tag) + { + $this->tags[] = $tag; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,114 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock\Tags\Formatter; +use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter; +use Webmozart\Assert\Assert; + +/** + * Object representing to description for a DocBlock. + * + * A Description object can consist of plain text but can also include tags. A Description Formatter can then combine + * a body template with sprintf-style placeholders together with formatted tags in order to reconstitute a complete + * description text using the format that you would prefer. + * + * Because parsing a Description text can be a verbose process this is handled by the {@see DescriptionFactory}. It is + * thus recommended to use that to create a Description object, like this: + * + * $description = $descriptionFactory->create('This is a {@see Description}', $context); + * + * The description factory will interpret the given body and create a body template and list of tags from them, and pass + * that onto the constructor if this class. + * + * > The $context variable is a class of type {@see \phpDocumentor\Reflection\Types\Context} and contains the namespace + * > and the namespace aliases that apply to this DocBlock. These are used by the Factory to resolve and expand partial + * > type names and FQSENs. + * + * If you do not want to use the DescriptionFactory you can pass a body template and tag listing like this: + * + * $description = new Description( + * 'This is a %1$s', + * [ new See(new Fqsen('\phpDocumentor\Reflection\DocBlock\Description')) ] + * ); + * + * It is generally recommended to use the Factory as that will also apply escaping rules, while the Description object + * is mainly responsible for rendering. + * + * @see DescriptionFactory to create a new Description. + * @see Description\Formatter for the formatting of the body and tags. + */ +class Description +{ + /** @var string */ + private $bodyTemplate; + + /** @var Tag[] */ + private $tags; + + /** + * Initializes a Description with its body (template) and a listing of the tags used in the body template. + * + * @param string $bodyTemplate + * @param Tag[] $tags + */ + public function __construct($bodyTemplate, array $tags = []) + { + Assert::string($bodyTemplate); + + $this->bodyTemplate = $bodyTemplate; + $this->tags = $tags; + } + + /** + * Returns the tags for this DocBlock. + * + * @return Tag[] + */ + public function getTags() + { + return $this->tags; + } + + /** + * Renders this description as a string where the provided formatter will format the tags in the expected string + * format. + * + * @param Formatter|null $formatter + * + * @return string + */ + public function render(Formatter $formatter = null) + { + if ($formatter === null) { + $formatter = new PassthroughFormatter(); + } + + $tags = []; + foreach ($this->tags as $tag) { + $tags[] = '{' . $formatter->format($tag) . '}'; + } + + return vsprintf($this->bodyTemplate, $tags); + } + + /** + * Returns a plain string representation of this description. + * + * @return string + */ + public function __toString() + { + return $this->render(); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,191 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\Types\Context as TypeContext; + +/** + * Creates a new Description object given a body of text. + * + * Descriptions in phpDocumentor are somewhat complex entities as they can contain one or more tags inside their + * body that can be replaced with a readable output. The replacing is done by passing a Formatter object to the + * Description object's `render` method. + * + * In addition to the above does a Description support two types of escape sequences: + * + * 1. `{@}` to escape the `@` character to prevent it from being interpreted as part of a tag, i.e. `{{@}link}` + * 2. `{}` to escape the `}` character, this can be used if you want to use the `}` character in the description + * of an inline tag. + * + * If a body consists of multiple lines then this factory will also remove any superfluous whitespace at the beginning + * of each line while maintaining any indentation that is used. This will prevent formatting parsers from tripping + * over unexpected spaces as can be observed with tag descriptions. + */ +class DescriptionFactory +{ + /** @var TagFactory */ + private $tagFactory; + + /** + * Initializes this factory with the means to construct (inline) tags. + * + * @param TagFactory $tagFactory + */ + public function __construct(TagFactory $tagFactory) + { + $this->tagFactory = $tagFactory; + } + + /** + * Returns the parsed text of this description. + * + * @param string $contents + * @param TypeContext $context + * + * @return Description + */ + public function create($contents, TypeContext $context = null) + { + list($text, $tags) = $this->parse($this->lex($contents), $context); + + return new Description($text, $tags); + } + + /** + * Strips the contents from superfluous whitespace and splits the description into a series of tokens. + * + * @param string $contents + * + * @return string[] A series of tokens of which the description text is composed. + */ + private function lex($contents) + { + $contents = $this->removeSuperfluousStartingWhitespace($contents); + + // performance optimalization; if there is no inline tag, don't bother splitting it up. + if (strpos($contents, '{@') === false) { + return [$contents]; + } + + return preg_split( + '/\{ + # "{@}" is not a valid inline tag. This ensures that we do not treat it as one, but treat it literally. + (?!@\}) + # We want to capture the whole tag line, but without the inline tag delimiters. + (\@ + # Match everything up to the next delimiter. + [^{}]* + # Nested inline tag content should not be captured, or it will appear in the result separately. + (?: + # Match nested inline tags. + (?: + # Because we did not catch the tag delimiters earlier, we must be explicit with them here. + # Notice that this also matches "{}", as a way to later introduce it as an escape sequence. + \{(?1)?\} + | + # Make sure we match hanging "{". + \{ + ) + # Match content after the nested inline tag. + [^{}]* + )* # If there are more inline tags, match them as well. We use "*" since there may not be any + # nested inline tags. + ) + \}/Sux', + $contents, + null, + PREG_SPLIT_DELIM_CAPTURE + ); + } + + /** + * Parses the stream of tokens in to a new set of tokens containing Tags. + * + * @param string[] $tokens + * @param TypeContext $context + * + * @return string[]|Tag[] + */ + private function parse($tokens, TypeContext $context) + { + $count = count($tokens); + $tagCount = 0; + $tags = []; + + for ($i = 1; $i < $count; $i += 2) { + $tags[] = $this->tagFactory->create($tokens[$i], $context); + $tokens[$i] = '%' . ++$tagCount . '$s'; + } + + //In order to allow "literal" inline tags, the otherwise invalid + //sequence "{@}" is changed to "@", and "{}" is changed to "}". + //"%" is escaped to "%%" because of vsprintf. + //See unit tests for examples. + for ($i = 0; $i < $count; $i += 2) { + $tokens[$i] = str_replace(['{@}', '{}', '%'], ['@', '}', '%%'], $tokens[$i]); + } + + return [implode('', $tokens), $tags]; + } + + /** + * Removes the superfluous from a multi-line description. + * + * When a description has more than one line then it can happen that the second and subsequent lines have an + * additional indentation. This is commonly in use with tags like this: + * + * {@}since 1.1.0 This is an example + * description where we have an + * indentation in the second and + * subsequent lines. + * + * If we do not normalize the indentation then we have superfluous whitespace on the second and subsequent + * lines and this may cause rendering issues when, for example, using a Markdown converter. + * + * @param string $contents + * + * @return string + */ + private function removeSuperfluousStartingWhitespace($contents) + { + $lines = explode("\n", $contents); + + // if there is only one line then we don't have lines with superfluous whitespace and + // can use the contents as-is + if (count($lines) <= 1) { + return $contents; + } + + // determine how many whitespace characters need to be stripped + $startingSpaceCount = 9999999; + for ($i = 1; $i < count($lines); $i++) { + // lines with a no length do not count as they are not indented at all + if (strlen(trim($lines[$i])) === 0) { + continue; + } + + // determine the number of prefixing spaces by checking the difference in line length before and after + // an ltrim + $startingSpaceCount = min($startingSpaceCount, strlen($lines[$i]) - strlen(ltrim($lines[$i]))); + } + + // strip the number of spaces from each line + if ($startingSpaceCount > 0) { + for ($i = 1; $i < count($lines); $i++) { + $lines[$i] = substr($lines[$i], $startingSpaceCount); + } + } + + return implode("\n", $lines); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,170 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock\Tags\Example; + +/** + * Class used to find an example file's location based on a given ExampleDescriptor. + */ +class ExampleFinder +{ + /** @var string */ + private $sourceDirectory = ''; + + /** @var string[] */ + private $exampleDirectories = []; + + /** + * Attempts to find the example contents for the given descriptor. + * + * @param Example $example + * + * @return string + */ + public function find(Example $example) + { + $filename = $example->getFilePath(); + + $file = $this->getExampleFileContents($filename); + if (!$file) { + return "** File not found : {$filename} **"; + } + + return implode('', array_slice($file, $example->getStartingLine() - 1, $example->getLineCount())); + } + + /** + * Registers the project's root directory where an 'examples' folder can be expected. + * + * @param string $directory + * + * @return void + */ + public function setSourceDirectory($directory = '') + { + $this->sourceDirectory = $directory; + } + + /** + * Returns the project's root directory where an 'examples' folder can be expected. + * + * @return string + */ + public function getSourceDirectory() + { + return $this->sourceDirectory; + } + + /** + * Registers a series of directories that may contain examples. + * + * @param string[] $directories + */ + public function setExampleDirectories(array $directories) + { + $this->exampleDirectories = $directories; + } + + /** + * Returns a series of directories that may contain examples. + * + * @return string[] + */ + public function getExampleDirectories() + { + return $this->exampleDirectories; + } + + /** + * Attempts to find the requested example file and returns its contents or null if no file was found. + * + * This method will try several methods in search of the given example file, the first one it encounters is + * returned: + * + * 1. Iterates through all examples folders for the given filename + * 2. Checks the source folder for the given filename + * 3. Checks the 'examples' folder in the current working directory for examples + * 4. Checks the path relative to the current working directory for the given filename + * + * @param string $filename + * + * @return string|null + */ + private function getExampleFileContents($filename) + { + $normalizedPath = null; + + foreach ($this->exampleDirectories as $directory) { + $exampleFileFromConfig = $this->constructExamplePath($directory, $filename); + if (is_readable($exampleFileFromConfig)) { + $normalizedPath = $exampleFileFromConfig; + break; + } + } + + if (!$normalizedPath) { + if (is_readable($this->getExamplePathFromSource($filename))) { + $normalizedPath = $this->getExamplePathFromSource($filename); + } elseif (is_readable($this->getExamplePathFromExampleDirectory($filename))) { + $normalizedPath = $this->getExamplePathFromExampleDirectory($filename); + } elseif (is_readable($filename)) { + $normalizedPath = $filename; + } + } + + return $normalizedPath && is_readable($normalizedPath) ? file($normalizedPath) : null; + } + + /** + * Get example filepath based on the example directory inside your project. + * + * @param string $file + * + * @return string + */ + private function getExamplePathFromExampleDirectory($file) + { + return getcwd() . DIRECTORY_SEPARATOR . 'examples' . DIRECTORY_SEPARATOR . $file; + } + + /** + * Returns a path to the example file in the given directory.. + * + * @param string $directory + * @param string $file + * + * @return string + */ + private function constructExamplePath($directory, $file) + { + return rtrim($directory, '\\/') . DIRECTORY_SEPARATOR . $file; + } + + /** + * Get example filepath based on sourcecode. + * + * @param string $file + * + * @return string + */ + private function getExamplePathFromSource($file) + { + return sprintf( + '%s%s%s', + trim($this->getSourceDirectory(), '\\/'), + DIRECTORY_SEPARATOR, + trim($file, '"') + ); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,155 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock; +use Webmozart\Assert\Assert; + +/** + * Converts a DocBlock back from an object to a complete DocComment including Asterisks. + */ +class Serializer +{ + /** @var string The string to indent the comment with. */ + protected $indentString = ' '; + + /** @var int The number of times the indent string is repeated. */ + protected $indent = 0; + + /** @var bool Whether to indent the first line with the given indent amount and string. */ + protected $isFirstLineIndented = true; + + /** @var int|null The max length of a line. */ + protected $lineLength = null; + + /** @var DocBlock\Tags\Formatter A custom tag formatter. */ + protected $tagFormatter = null; + + /** + * Create a Serializer instance. + * + * @param int $indent The number of times the indent string is repeated. + * @param string $indentString The string to indent the comment with. + * @param bool $indentFirstLine Whether to indent the first line. + * @param int|null $lineLength The max length of a line or NULL to disable line wrapping. + * @param DocBlock\Tags\Formatter $tagFormatter A custom tag formatter, defaults to PassthroughFormatter. + */ + public function __construct($indent = 0, $indentString = ' ', $indentFirstLine = true, $lineLength = null, $tagFormatter = null) + { + Assert::integer($indent); + Assert::string($indentString); + Assert::boolean($indentFirstLine); + Assert::nullOrInteger($lineLength); + Assert::nullOrIsInstanceOf($tagFormatter, 'phpDocumentor\Reflection\DocBlock\Tags\Formatter'); + + $this->indent = $indent; + $this->indentString = $indentString; + $this->isFirstLineIndented = $indentFirstLine; + $this->lineLength = $lineLength; + $this->tagFormatter = $tagFormatter ?: new DocBlock\Tags\Formatter\PassthroughFormatter(); + } + + /** + * Generate a DocBlock comment. + * + * @param DocBlock $docblock The DocBlock to serialize. + * + * @return string The serialized doc block. + */ + public function getDocComment(DocBlock $docblock) + { + $indent = str_repeat($this->indentString, $this->indent); + $firstIndent = $this->isFirstLineIndented ? $indent : ''; + // 3 === strlen(' * ') + $wrapLength = $this->lineLength ? $this->lineLength - strlen($indent) - 3 : null; + + $text = $this->removeTrailingSpaces( + $indent, + $this->addAsterisksForEachLine( + $indent, + $this->getSummaryAndDescriptionTextBlock($docblock, $wrapLength) + ) + ); + + $comment = "{$firstIndent}/**\n"; + if ($text) { + $comment .= "{$indent} * {$text}\n"; + $comment .= "{$indent} *\n"; + } + + $comment = $this->addTagBlock($docblock, $wrapLength, $indent, $comment); + $comment .= $indent . ' */'; + + return $comment; + } + + /** + * @param $indent + * @param $text + * @return mixed + */ + private function removeTrailingSpaces($indent, $text) + { + return str_replace("\n{$indent} * \n", "\n{$indent} *\n", $text); + } + + /** + * @param $indent + * @param $text + * @return mixed + */ + private function addAsterisksForEachLine($indent, $text) + { + return str_replace("\n", "\n{$indent} * ", $text); + } + + /** + * @param DocBlock $docblock + * @param $wrapLength + * @return string + */ + private function getSummaryAndDescriptionTextBlock(DocBlock $docblock, $wrapLength) + { + $text = $docblock->getSummary() . ((string)$docblock->getDescription() ? "\n\n" . $docblock->getDescription() + : ''); + if ($wrapLength !== null) { + $text = wordwrap($text, $wrapLength); + return $text; + } + + return $text; + } + + /** + * @param DocBlock $docblock + * @param $wrapLength + * @param $indent + * @param $comment + * @return string + */ + private function addTagBlock(DocBlock $docblock, $wrapLength, $indent, $comment) + { + foreach ($docblock->getTags() as $tag) { + $tagText = $this->tagFormatter->format($tag); + if ($wrapLength !== null) { + $tagText = wordwrap($tagText, $wrapLength); + } + + $tagText = str_replace("\n", "\n{$indent} * ", $tagText); + + $comment .= "{$indent} * {$tagText}\n"; + } + + return $comment; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,319 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod; +use phpDocumentor\Reflection\DocBlock\Tags\Generic; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Creates a Tag object given the contents of a tag. + * + * This Factory is capable of determining the appropriate class for a tag and instantiate it using its `create` + * factory method. The `create` factory method of a Tag can have a variable number of arguments; this way you can + * pass the dependencies that you need to construct a tag object. + * + * > Important: each parameter in addition to the body variable for the `create` method must default to null, otherwise + * > it violates the constraint with the interface; it is recommended to use the {@see Assert::notNull()} method to + * > verify that a dependency is actually passed. + * + * This Factory also features a Service Locator component that is used to pass the right dependencies to the + * `create` method of a tag; each dependency should be registered as a service or as a parameter. + * + * When you want to use a Tag of your own with custom handling you need to call the `registerTagHandler` method, pass + * the name of the tag and a Fully Qualified Class Name pointing to a class that implements the Tag interface. + */ +final class StandardTagFactory implements TagFactory +{ + /** PCRE regular expression matching a tag name. */ + const REGEX_TAGNAME = '[\w\-\_\\\\]+'; + + /** + * @var string[] An array with a tag as a key, and an FQCN to a class that handles it as an array value. + */ + private $tagHandlerMappings = [ + 'author' => '\phpDocumentor\Reflection\DocBlock\Tags\Author', + 'covers' => '\phpDocumentor\Reflection\DocBlock\Tags\Covers', + 'deprecated' => '\phpDocumentor\Reflection\DocBlock\Tags\Deprecated', + // 'example' => '\phpDocumentor\Reflection\DocBlock\Tags\Example', + 'link' => '\phpDocumentor\Reflection\DocBlock\Tags\Link', + 'method' => '\phpDocumentor\Reflection\DocBlock\Tags\Method', + 'param' => '\phpDocumentor\Reflection\DocBlock\Tags\Param', + 'property-read' => '\phpDocumentor\Reflection\DocBlock\Tags\PropertyRead', + 'property' => '\phpDocumentor\Reflection\DocBlock\Tags\Property', + 'property-write' => '\phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite', + 'return' => '\phpDocumentor\Reflection\DocBlock\Tags\Return_', + 'see' => '\phpDocumentor\Reflection\DocBlock\Tags\See', + 'since' => '\phpDocumentor\Reflection\DocBlock\Tags\Since', + 'source' => '\phpDocumentor\Reflection\DocBlock\Tags\Source', + 'throw' => '\phpDocumentor\Reflection\DocBlock\Tags\Throws', + 'throws' => '\phpDocumentor\Reflection\DocBlock\Tags\Throws', + 'uses' => '\phpDocumentor\Reflection\DocBlock\Tags\Uses', + 'var' => '\phpDocumentor\Reflection\DocBlock\Tags\Var_', + 'version' => '\phpDocumentor\Reflection\DocBlock\Tags\Version' + ]; + + /** + * @var \ReflectionParameter[][] a lazy-loading cache containing parameters for each tagHandler that has been used. + */ + private $tagHandlerParameterCache = []; + + /** + * @var FqsenResolver + */ + private $fqsenResolver; + + /** + * @var mixed[] an array representing a simple Service Locator where we can store parameters and + * services that can be inserted into the Factory Methods of Tag Handlers. + */ + private $serviceLocator = []; + + /** + * Initialize this tag factory with the means to resolve an FQSEN and optionally a list of tag handlers. + * + * If no tag handlers are provided than the default list in the {@see self::$tagHandlerMappings} property + * is used. + * + * @param FqsenResolver $fqsenResolver + * @param string[] $tagHandlers + * + * @see self::registerTagHandler() to add a new tag handler to the existing default list. + */ + public function __construct(FqsenResolver $fqsenResolver, array $tagHandlers = null) + { + $this->fqsenResolver = $fqsenResolver; + if ($tagHandlers !== null) { + $this->tagHandlerMappings = $tagHandlers; + } + + $this->addService($fqsenResolver, FqsenResolver::class); + } + + /** + * {@inheritDoc} + */ + public function create($tagLine, TypeContext $context = null) + { + if (! $context) { + $context = new TypeContext(''); + } + + list($tagName, $tagBody) = $this->extractTagParts($tagLine); + + if ($tagBody !== '' && $tagBody[0] === '[') { + throw new \InvalidArgumentException( + 'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors' + ); + } + + return $this->createTag($tagBody, $tagName, $context); + } + + /** + * {@inheritDoc} + */ + public function addParameter($name, $value) + { + $this->serviceLocator[$name] = $value; + } + + /** + * {@inheritDoc} + */ + public function addService($service, $alias = null) + { + $this->serviceLocator[$alias ?: get_class($service)] = $service; + } + + /** + * {@inheritDoc} + */ + public function registerTagHandler($tagName, $handler) + { + Assert::stringNotEmpty($tagName); + Assert::stringNotEmpty($handler); + Assert::classExists($handler); + Assert::implementsInterface($handler, StaticMethod::class); + + if (strpos($tagName, '\\') && $tagName[0] !== '\\') { + throw new \InvalidArgumentException( + 'A namespaced tag must have a leading backslash as it must be fully qualified' + ); + } + + $this->tagHandlerMappings[$tagName] = $handler; + } + + /** + * Extracts all components for a tag. + * + * @param string $tagLine + * + * @return string[] + */ + private function extractTagParts($tagLine) + { + $matches = []; + if (! preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)/us', $tagLine, $matches)) { + throw new \InvalidArgumentException( + 'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors' + ); + } + + if (count($matches) < 3) { + $matches[] = ''; + } + + return array_slice($matches, 1); + } + + /** + * Creates a new tag object with the given name and body or returns null if the tag name was recognized but the + * body was invalid. + * + * @param string $body + * @param string $name + * @param TypeContext $context + * + * @return Tag|null + */ + private function createTag($body, $name, TypeContext $context) + { + $handlerClassName = $this->findHandlerClassName($name, $context); + $arguments = $this->getArgumentsForParametersFromWiring( + $this->fetchParametersForHandlerFactoryMethod($handlerClassName), + $this->getServiceLocatorWithDynamicParameters($context, $name, $body) + ); + + return call_user_func_array([$handlerClassName, 'create'], $arguments); + } + + /** + * Determines the Fully Qualified Class Name of the Factory or Tag (containing a Factory Method `create`). + * + * @param string $tagName + * @param TypeContext $context + * + * @return string + */ + private function findHandlerClassName($tagName, TypeContext $context) + { + $handlerClassName = Generic::class; + if (isset($this->tagHandlerMappings[$tagName])) { + $handlerClassName = $this->tagHandlerMappings[$tagName]; + } elseif ($this->isAnnotation($tagName)) { + // TODO: Annotation support is planned for a later stage and as such is disabled for now + // $tagName = (string)$this->fqsenResolver->resolve($tagName, $context); + // if (isset($this->annotationMappings[$tagName])) { + // $handlerClassName = $this->annotationMappings[$tagName]; + // } + } + + return $handlerClassName; + } + + /** + * Retrieves the arguments that need to be passed to the Factory Method with the given Parameters. + * + * @param \ReflectionParameter[] $parameters + * @param mixed[] $locator + * + * @return mixed[] A series of values that can be passed to the Factory Method of the tag whose parameters + * is provided with this method. + */ + private function getArgumentsForParametersFromWiring($parameters, $locator) + { + $arguments = []; + foreach ($parameters as $index => $parameter) { + $typeHint = $parameter->getClass() ? $parameter->getClass()->getName() : null; + if (isset($locator[$typeHint])) { + $arguments[] = $locator[$typeHint]; + continue; + } + + $parameterName = $parameter->getName(); + if (isset($locator[$parameterName])) { + $arguments[] = $locator[$parameterName]; + continue; + } + + $arguments[] = null; + } + + return $arguments; + } + + /** + * Retrieves a series of ReflectionParameter objects for the static 'create' method of the given + * tag handler class name. + * + * @param string $handlerClassName + * + * @return \ReflectionParameter[] + */ + private function fetchParametersForHandlerFactoryMethod($handlerClassName) + { + if (! isset($this->tagHandlerParameterCache[$handlerClassName])) { + $methodReflection = new \ReflectionMethod($handlerClassName, 'create'); + $this->tagHandlerParameterCache[$handlerClassName] = $methodReflection->getParameters(); + } + + return $this->tagHandlerParameterCache[$handlerClassName]; + } + + /** + * Returns a copy of this class' Service Locator with added dynamic parameters, such as the tag's name, body and + * Context. + * + * @param TypeContext $context The Context (namespace and aliasses) that may be passed and is used to resolve FQSENs. + * @param string $tagName The name of the tag that may be passed onto the factory method of the Tag class. + * @param string $tagBody The body of the tag that may be passed onto the factory method of the Tag class. + * + * @return mixed[] + */ + private function getServiceLocatorWithDynamicParameters(TypeContext $context, $tagName, $tagBody) + { + $locator = array_merge( + $this->serviceLocator, + [ + 'name' => $tagName, + 'body' => $tagBody, + TypeContext::class => $context + ] + ); + + return $locator; + } + + /** + * Returns whether the given tag belongs to an annotation. + * + * @param string $tagContent + * + * @todo this method should be populated once we implement Annotation notation support. + * + * @return bool + */ + private function isAnnotation($tagContent) + { + // 1. Contains a namespace separator + // 2. Contains parenthesis + // 3. Is present in a list of known annotations (make the algorithm smart by first checking is the last part + // of the annotation class name matches the found tag name + + return false; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,26 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +interface Tag +{ + public function getName(); + + public static function create($body); + + public function render(Formatter $formatter = null); + + public function __toString(); +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,93 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\Types\Context as TypeContext; + +interface TagFactory +{ + /** + * Adds a parameter to the service locator that can be injected in a tag's factory method. + * + * When calling a tag's "create" method we always check the signature for dependencies to inject. One way is to + * typehint a parameter in the signature so that we can use that interface or class name to inject a dependency + * (see {@see addService()} for more information on that). + * + * Another way is to check the name of the argument against the names in the Service Locator. With this method + * you can add a variable that will be inserted when a tag's create method is not typehinted and has a matching + * name. + * + * Be aware that there are two reserved names: + * + * - name, representing the name of the tag. + * - body, representing the complete body of the tag. + * + * These parameters are injected at the last moment and will override any existing parameter with those names. + * + * @param string $name + * @param mixed $value + * + * @return void + */ + public function addParameter($name, $value); + + /** + * Registers a service with the Service Locator using the FQCN of the class or the alias, if provided. + * + * When calling a tag's "create" method we always check the signature for dependencies to inject. If a parameter + * has a typehint then the ServiceLocator is queried to see if a Service is registered for that typehint. + * + * Because interfaces are regularly used as type-hints this method provides an alias parameter; if the FQCN of the + * interface is passed as alias then every time that interface is requested the provided service will be returned. + * + * @param object $service + * @param string $alias + * + * @return void + */ + public function addService($service); + + /** + * Factory method responsible for instantiating the correct sub type. + * + * @param string $tagLine The text for this tag, including description. + * @param TypeContext $context + * + * @throws \InvalidArgumentException if an invalid tag line was presented. + * + * @return Tag A new tag object. + */ + public function create($tagLine, TypeContext $context = null); + + /** + * Registers a handler for tags. + * + * If you want to use your own tags then you can use this method to instruct the TagFactory to register the name + * of a tag with the FQCN of a 'Tag Handler'. The Tag handler should implement the {@see Tag} interface (and thus + * the create method). + * + * @param string $tagName Name of tag to register a handler for. When registering a namespaced tag, the full + * name, along with a prefixing slash MUST be provided. + * @param string $handler FQCN of handler. + * + * @throws \InvalidArgumentException if the tag name is not a string + * @throws \InvalidArgumentException if the tag name is namespaced (contains backslashes) but does not start with + * a backslash + * @throws \InvalidArgumentException if the handler is not a string + * @throws \InvalidArgumentException if the handler is not an existing class + * @throws \InvalidArgumentException if the handler does not implement the {@see Tag} interface + * + * @return void + */ + public function registerTagHandler($tagName, $handler); +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,100 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Webmozart\Assert\Assert; + +/** + * Reflection class for an {@}author tag in a Docblock. + */ +final class Author extends BaseTag implements Factory\StaticMethod +{ + /** @var string register that this is the author tag. */ + protected $name = 'author'; + + /** @var string The name of the author */ + private $authorName = ''; + + /** @var string The email of the author */ + private $authorEmail = ''; + + /** + * Initializes this tag with the author name and e-mail. + * + * @param string $authorName + * @param string $authorEmail + */ + public function __construct($authorName, $authorEmail) + { + Assert::string($authorName); + Assert::string($authorEmail); + if ($authorEmail && !filter_var($authorEmail, FILTER_VALIDATE_EMAIL)) { + throw new \InvalidArgumentException('The author tag does not have a valid e-mail address'); + } + + $this->authorName = $authorName; + $this->authorEmail = $authorEmail; + } + + /** + * Gets the author's name. + * + * @return string The author's name. + */ + public function getAuthorName() + { + return $this->authorName; + } + + /** + * Returns the author's email. + * + * @return string The author's email. + */ + public function getEmail() + { + return $this->authorEmail; + } + + /** + * Returns this tag in string form. + * + * @return string + */ + public function __toString() + { + return $this->authorName . (strlen($this->authorEmail) ? ' <' . $this->authorEmail . '>' : ''); + } + + /** + * Attempts to create a new Author object based on †he tag body. + * + * @param string $body + * + * @return static + */ + public static function create($body) + { + Assert::string($body); + + $splitTagContent = preg_match('/^([^\<]*)(?:\<([^\>]*)\>)?$/u', $body, $matches); + if (!$splitTagContent) { + return null; + } + + $authorName = trim($matches[1]); + $email = isset($matches[2]) ? trim($matches[2]) : ''; + + return new static($authorName, $email); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,52 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock; +use phpDocumentor\Reflection\DocBlock\Description; + +/** + * Parses a tag definition for a DocBlock. + */ +abstract class BaseTag implements DocBlock\Tag +{ + /** @var string Name of the tag */ + protected $name = ''; + + /** @var Description|null Description of the tag. */ + protected $description; + + /** + * Gets the name of this tag. + * + * @return string The name of this tag. + */ + public function getName() + { + return $this->name; + } + + public function getDescription() + { + return $this->description; + } + + public function render(Formatter $formatter = null) + { + if ($formatter === null) { + $formatter = new Formatter\PassthroughFormatter(); + } + + return $formatter->format($this); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,83 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a @covers tag in a Docblock. + */ +final class Covers extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'covers'; + + /** @var Fqsen */ + private $refers = null; + + /** + * Initializes this tag. + * + * @param Fqsen $refers + * @param Description $description + */ + public function __construct(Fqsen $refers, Description $description = null) + { + $this->refers = $refers; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + DescriptionFactory $descriptionFactory = null, + FqsenResolver $resolver = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::notEmpty($body); + + $parts = preg_split('/\s+/Su', $body, 2); + + return new static( + $resolver->resolve($parts[0], $context), + $descriptionFactory->create(isset($parts[1]) ? $parts[1] : '', $context) + ); + } + + /** + * Returns the structural element this tag refers to. + * + * @return Fqsen + */ + public function getReference() + { + return $this->refers; + } + + /** + * Returns a string representation of this tag. + * + * @return string + */ + public function __toString() + { + return $this->refers . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,97 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}deprecated tag in a Docblock. + */ +final class Deprecated extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'deprecated'; + + /** + * PCRE regular expression matching a version vector. + * Assumes the "x" modifier. + */ + const REGEX_VECTOR = '(?: + # Normal release vectors. + \d\S* + | + # VCS version vectors. Per PHPCS, they are expected to + # follow the form of the VCS name, followed by ":", followed + # by the version vector itself. + # By convention, popular VCSes like CVS, SVN and GIT use "$" + # around the actual version vector. + [^\s\:]+\:\s*\$[^\$]+\$ + )'; + + /** @var string The version vector. */ + private $version = ''; + + public function __construct($version = null, Description $description = null) + { + Assert::nullOrStringNotEmpty($version); + + $this->version = $version; + $this->description = $description; + } + + /** + * @return static + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::nullOrString($body); + if (empty($body)) { + return new static(); + } + + $matches = []; + if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { + return new static( + null, + null !== $descriptionFactory ? $descriptionFactory->create($body, $context) : null + ); + } + + return new static( + $matches[1], + $descriptionFactory->create(isset($matches[2]) ? $matches[2] : '', $context) + ); + } + + /** + * Gets the version section of the tag. + * + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->version . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,176 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\Tag; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}example tag in a Docblock. + */ +final class Example extends BaseTag +{ + /** + * @var string Path to a file to use as an example. May also be an absolute URI. + */ + private $filePath; + + /** + * @var bool Whether the file path component represents an URI. This determines how the file portion + * appears at {@link getContent()}. + */ + private $isURI = false; + + /** + * @var int + */ + private $startingLine; + + /** + * @var int + */ + private $lineCount; + + public function __construct($filePath, $isURI, $startingLine, $lineCount, $description) + { + Assert::notEmpty($filePath); + Assert::integer($startingLine); + Assert::greaterThanEq($startingLine, 0); + + $this->filePath = $filePath; + $this->startingLine = $startingLine; + $this->lineCount = $lineCount; + $this->name = 'example'; + if ($description !== null) { + $this->description = trim($description); + } + + $this->isURI = $isURI; + } + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->description) { + $filePath = '"' . $this->filePath . '"'; + if ($this->isURI) { + $filePath = $this->isUriRelative($this->filePath) + ? str_replace('%2F', '/', rawurlencode($this->filePath)) + :$this->filePath; + } + + return trim($filePath . ' ' . parent::getDescription()); + } + + return $this->description; + } + + /** + * {@inheritdoc} + */ + public static function create($body) + { + // File component: File path in quotes or File URI / Source information + if (! preg_match('/^(?:\"([^\"]+)\"|(\S+))(?:\s+(.*))?$/sux', $body, $matches)) { + return null; + } + + $filePath = null; + $fileUri = null; + if ('' !== $matches[1]) { + $filePath = $matches[1]; + } else { + $fileUri = $matches[2]; + } + + $startingLine = 1; + $lineCount = null; + $description = null; + + if (array_key_exists(3, $matches)) { + $description = $matches[3]; + + // Starting line / Number of lines / Description + if (preg_match('/^([1-9]\d*)(?:\s+((?1))\s*)?(.*)$/sux', $matches[3], $contentMatches)) { + $startingLine = (int)$contentMatches[1]; + if (isset($contentMatches[2]) && $contentMatches[2] !== '') { + $lineCount = (int)$contentMatches[2]; + } + + if (array_key_exists(3, $contentMatches)) { + $description = $contentMatches[3]; + } + } + } + + return new static( + $filePath !== null?$filePath:$fileUri, + $fileUri !== null, + $startingLine, + $lineCount, + $description + ); + } + + /** + * Returns the file path. + * + * @return string Path to a file to use as an example. + * May also be an absolute URI. + */ + public function getFilePath() + { + return $this->filePath; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->filePath . ($this->description ? ' ' . $this->description : ''); + } + + /** + * Returns true if the provided URI is relative or contains a complete scheme (and thus is absolute). + * + * @param string $uri + * + * @return bool + */ + private function isUriRelative($uri) + { + return false === strpos($uri, ':'); + } + + /** + * @return int + */ + public function getStartingLine() + { + return $this->startingLine; + } + + /** + * @return int + */ + public function getLineCount() + { + return $this->lineCount; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/StaticMethod.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/StaticMethod.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,18 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Factory; + +interface StaticMethod +{ + public static function create($body); +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/Strategy.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/Strategy.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,18 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Factory; + +interface Strategy +{ + public function create($body); +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,27 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Tag; + +interface Formatter +{ + /** + * Formats a tag into a string representation according to a specific format, such as Markdown. + * + * @param Tag $tag + * + * @return string + */ + public function format(Tag $tag); +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/AlignFormatter.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/AlignFormatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,47 @@ + + * @copyright 2017 Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +class AlignFormatter implements Formatter +{ + /** @var int The maximum tag name length. */ + protected $maxLen = 0; + + /** + * Constructor. + * + * @param Tag[] $tags All tags that should later be aligned with the formatter. + */ + public function __construct(array $tags) + { + foreach ($tags as $tag) { + $this->maxLen = max($this->maxLen, strlen($tag->getName())); + } + } + + /** + * Formats the given tag to return a simple plain text version. + * + * @param Tag $tag + * + * @return string + */ + public function format(Tag $tag) + { + return '@' . $tag->getName() . str_repeat(' ', $this->maxLen - strlen($tag->getName()) + 1) . (string)$tag; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +class PassthroughFormatter implements Formatter +{ + /** + * Formats the given tag to return a simple plain text version. + * + * @param Tag $tag + * + * @return string + */ + public function format(Tag $tag) + { + return trim('@' . $tag->getName() . ' ' . (string)$tag); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,91 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\DocBlock\StandardTagFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Parses a tag definition for a DocBlock. + */ +class Generic extends BaseTag implements Factory\StaticMethod +{ + /** + * Parses a tag and populates the member variables. + * + * @param string $name Name of the tag. + * @param Description $description The contents of the given tag. + */ + public function __construct($name, Description $description = null) + { + $this->validateTagName($name); + + $this->name = $name; + $this->description = $description; + } + + /** + * Creates a new tag that represents any unknown tag type. + * + * @param string $body + * @param string $name + * @param DescriptionFactory $descriptionFactory + * @param TypeContext $context + * + * @return static + */ + public static function create( + $body, + $name = '', + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::stringNotEmpty($name); + Assert::notNull($descriptionFactory); + + $description = $descriptionFactory && $body ? $descriptionFactory->create($body, $context) : null; + + return new static($name, $description); + } + + /** + * Returns the tag as a serialized string + * + * @return string + */ + public function __toString() + { + return ($this->description ? $this->description->render() : ''); + } + + /** + * Validates if the tag name matches the expected format, otherwise throws an exception. + * + * @param string $name + * + * @return void + */ + private function validateTagName($name) + { + if (! preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) { + throw new \InvalidArgumentException( + 'The tag name "' . $name . '" is not wellformed. Tags may only consist of letters, underscores, ' + . 'hyphens and backslashes.' + ); + } + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,77 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a @link tag in a Docblock. + */ +final class Link extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'link'; + + /** @var string */ + private $link = ''; + + /** + * Initializes a link to a URL. + * + * @param string $link + * @param Description $description + */ + public function __construct($link, Description $description = null) + { + Assert::string($link); + + $this->link = $link; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::string($body); + Assert::notNull($descriptionFactory); + + $parts = preg_split('/\s+/Su', $body, 2); + $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null; + + return new static($parts[0], $description); + } + + /** + * Gets the link + * + * @return string + */ + public function getLink() + { + return $this->link; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->link . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,242 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use phpDocumentor\Reflection\Types\Void_; +use Webmozart\Assert\Assert; + +/** + * Reflection class for an {@}method in a Docblock. + */ +final class Method extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'method'; + + /** @var string */ + private $methodName = ''; + + /** @var string[] */ + private $arguments = []; + + /** @var bool */ + private $isStatic = false; + + /** @var Type */ + private $returnType; + + public function __construct( + $methodName, + array $arguments = [], + Type $returnType = null, + $static = false, + Description $description = null + ) { + Assert::stringNotEmpty($methodName); + Assert::boolean($static); + + if ($returnType === null) { + $returnType = new Void_(); + } + + $this->methodName = $methodName; + $this->arguments = $this->filterArguments($arguments); + $this->returnType = $returnType; + $this->isStatic = $static; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([ $typeResolver, $descriptionFactory ]); + + // 1. none or more whitespace + // 2. optionally the keyword "static" followed by whitespace + // 3. optionally a word with underscores followed by whitespace : as + // type for the return value + // 4. then optionally a word with underscores followed by () and + // whitespace : as method name as used by phpDocumentor + // 5. then a word with underscores, followed by ( and any character + // until a ) and whitespace : as method name with signature + // 6. any remaining text : as description + if (!preg_match( + '/^ + # Static keyword + # Declares a static method ONLY if type is also present + (?: + (static) + \s+ + )? + # Return type + (?: + ( + (?:[\w\|_\\\\]*\$this[\w\|_\\\\]*) + | + (?: + (?:[\w\|_\\\\]+) + # array notation + (?:\[\])* + )* + ) + \s+ + )? + # Legacy method name (not captured) + (?: + [\w_]+\(\)\s+ + )? + # Method name + ([\w\|_\\\\]+) + # Arguments + (?: + \(([^\)]*)\) + )? + \s* + # Description + (.*) + $/sux', + $body, + $matches + )) { + return null; + } + + list(, $static, $returnType, $methodName, $arguments, $description) = $matches; + + $static = $static === 'static'; + + if ($returnType === '') { + $returnType = 'void'; + } + + $returnType = $typeResolver->resolve($returnType, $context); + $description = $descriptionFactory->create($description, $context); + + if (is_string($arguments) && strlen($arguments) > 0) { + $arguments = explode(',', $arguments); + foreach ($arguments as &$argument) { + $argument = explode(' ', self::stripRestArg(trim($argument)), 2); + if ($argument[0][0] === '$') { + $argumentName = substr($argument[0], 1); + $argumentType = new Void_(); + } else { + $argumentType = $typeResolver->resolve($argument[0], $context); + $argumentName = ''; + if (isset($argument[1])) { + $argument[1] = self::stripRestArg($argument[1]); + $argumentName = substr($argument[1], 1); + } + } + + $argument = [ 'name' => $argumentName, 'type' => $argumentType]; + } + } else { + $arguments = []; + } + + return new static($methodName, $arguments, $returnType, $static, $description); + } + + /** + * Retrieves the method name. + * + * @return string + */ + public function getMethodName() + { + return $this->methodName; + } + + /** + * @return string[] + */ + public function getArguments() + { + return $this->arguments; + } + + /** + * Checks whether the method tag describes a static method or not. + * + * @return bool TRUE if the method declaration is for a static method, FALSE otherwise. + */ + public function isStatic() + { + return $this->isStatic; + } + + /** + * @return Type + */ + public function getReturnType() + { + return $this->returnType; + } + + public function __toString() + { + $arguments = []; + foreach ($this->arguments as $argument) { + $arguments[] = $argument['type'] . ' $' . $argument['name']; + } + + return trim(($this->isStatic() ? 'static ' : '') + . (string)$this->returnType . ' ' + . $this->methodName + . '(' . implode(', ', $arguments) . ')' + . ($this->description ? ' ' . $this->description->render() : '')); + } + + private function filterArguments($arguments) + { + foreach ($arguments as &$argument) { + if (is_string($argument)) { + $argument = [ 'name' => $argument ]; + } + + if (! isset($argument['type'])) { + $argument['type'] = new Void_(); + } + + $keys = array_keys($argument); + sort($keys); + if ($keys !== [ 'name', 'type' ]) { + throw new \InvalidArgumentException( + 'Arguments can only have the "name" and "type" fields, found: ' . var_export($keys, true) + ); + } + } + + return $arguments; + } + + private static function stripRestArg($argument) + { + if (strpos($argument, '...') === 0) { + $argument = trim(substr($argument, 3)); + } + + return $argument; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,141 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for the {@}param tag in a Docblock. + */ +final class Param extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'param'; + + /** @var Type */ + private $type; + + /** @var string */ + private $variableName = ''; + + /** @var bool determines whether this is a variadic argument */ + private $isVariadic = false; + + /** + * @param string $variableName + * @param Type $type + * @param bool $isVariadic + * @param Description $description + */ + public function __construct($variableName, Type $type = null, $isVariadic = false, Description $description = null) + { + Assert::string($variableName); + Assert::boolean($isVariadic); + + $this->variableName = $variableName; + $this->type = $type; + $this->isVariadic = $isVariadic; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + $isVariadic = false; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$' || substr($parts[0], 0, 4) === '...$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 3) === '...') { + $isVariadic = true; + $variableName = substr($variableName, 3); + } + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $isVariadic, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns whether this tag is variadic. + * + * @return boolean + */ + public function isVariadic() + { + return $this->isVariadic; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . ($this->isVariadic() ? '...' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,118 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}property tag in a Docblock. + */ +class Property extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'property'; + + /** @var Type */ + private $type; + + /** @var string */ + protected $variableName = ''; + + /** + * @param string $variableName + * @param Type $type + * @param Description $description + */ + public function __construct($variableName, Type $type = null, Description $description = null) + { + Assert::string($variableName); + + $this->variableName = $variableName; + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,118 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}property-read tag in a Docblock. + */ +class PropertyRead extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'property-read'; + + /** @var Type */ + private $type; + + /** @var string */ + protected $variableName = ''; + + /** + * @param string $variableName + * @param Type $type + * @param Description $description + */ + public function __construct($variableName, Type $type = null, Description $description = null) + { + Assert::string($variableName); + + $this->variableName = $variableName; + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,118 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}property-write tag in a Docblock. + */ +class PropertyWrite extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'property-write'; + + /** @var Type */ + private $type; + + /** @var string */ + protected $variableName = ''; + + /** + * @param string $variableName + * @param Type $type + * @param Description $description + */ + public function __construct($variableName, Type $type = null, Description $description = null) + { + Assert::string($variableName); + + $this->variableName = $variableName; + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,42 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Reference; + +use phpDocumentor\Reflection\Fqsen as RealFqsen; + +/** + * Fqsen reference used by {@see phpDocumentor\Reflection\DocBlock\Tags\See} + */ +final class Fqsen implements Reference +{ + /** + * @var RealFqsen + */ + private $fqsen; + + /** + * Fqsen constructor. + */ + public function __construct(RealFqsen $fqsen) + { + $this->fqsen = $fqsen; + } + + /** + * @return string string representation of the referenced fqsen + */ + public function __toString() + { + return (string)$this->fqsen; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,21 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Reference; + +/** + * Interface for references in {@see phpDocumentor\Reflection\DocBlock\Tags\See} + */ +interface Reference +{ + public function __toString(); +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Url.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Url.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,40 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Reference; + +use Webmozart\Assert\Assert; + +/** + * Url reference used by {@see phpDocumentor\Reflection\DocBlock\Tags\See} + */ +final class Url implements Reference +{ + /** + * @var string + */ + private $uri; + + /** + * Url constructor. + */ + public function __construct($uri) + { + Assert::stringNotEmpty($uri); + $this->uri = $uri; + } + + public function __toString() + { + return $this->uri; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,72 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}return tag in a Docblock. + */ +final class Return_ extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'return'; + + /** @var Type */ + private $type; + + public function __construct(Type $type, Description $description = null) + { + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/\s+/Su', $body, 2); + + $type = $typeResolver->resolve(isset($parts[0]) ? $parts[0] : '', $context); + $description = $descriptionFactory->create(isset($parts[1]) ? $parts[1] : '', $context); + + return new static($type, $description); + } + + /** + * Returns the type section of the variable. + * + * @return Type + */ + public function getType() + { + return $this->type; + } + + public function __toString() + { + return $this->type . ' ' . $this->description; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,88 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen as FqsenRef; +use phpDocumentor\Reflection\DocBlock\Tags\Reference\Reference; +use phpDocumentor\Reflection\DocBlock\Tags\Reference\Url; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for an {@}see tag in a Docblock. + */ +class See extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'see'; + + /** @var Reference */ + protected $refers = null; + + /** + * Initializes this tag. + * + * @param Reference $refers + * @param Description $description + */ + public function __construct(Reference $refers, Description $description = null) + { + $this->refers = $refers; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + FqsenResolver $resolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::allNotNull([$resolver, $descriptionFactory]); + + $parts = preg_split('/\s+/Su', $body, 2); + $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null; + + // https://tools.ietf.org/html/rfc2396#section-3 + if (preg_match('/\w:\/\/\w/i', $parts[0])) { + return new static(new Url($parts[0]), $description); + } + + return new static(new FqsenRef($resolver->resolve($parts[0], $context)), $description); + } + + /** + * Returns the ref of this tag. + * + * @return Reference + */ + public function getReference() + { + return $this->refers; + } + + /** + * Returns a string representation of this tag. + * + * @return string + */ + public function __toString() + { + return $this->refers . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,94 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}since tag in a Docblock. + */ +final class Since extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'since'; + + /** + * PCRE regular expression matching a version vector. + * Assumes the "x" modifier. + */ + const REGEX_VECTOR = '(?: + # Normal release vectors. + \d\S* + | + # VCS version vectors. Per PHPCS, they are expected to + # follow the form of the VCS name, followed by ":", followed + # by the version vector itself. + # By convention, popular VCSes like CVS, SVN and GIT use "$" + # around the actual version vector. + [^\s\:]+\:\s*\$[^\$]+\$ + )'; + + /** @var string The version vector. */ + private $version = ''; + + public function __construct($version = null, Description $description = null) + { + Assert::nullOrStringNotEmpty($version); + + $this->version = $version; + $this->description = $description; + } + + /** + * @return static + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::nullOrString($body); + if (empty($body)) { + return new static(); + } + + $matches = []; + if (! preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { + return null; + } + + return new static( + $matches[1], + $descriptionFactory->create(isset($matches[2]) ? $matches[2] : '', $context) + ); + } + + /** + * Gets the version section of the tag. + * + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->version . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,97 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}source tag in a Docblock. + */ +final class Source extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'source'; + + /** @var int The starting line, relative to the structural element's location. */ + private $startingLine = 1; + + /** @var int|null The number of lines, relative to the starting line. NULL means "to the end". */ + private $lineCount = null; + + public function __construct($startingLine, $lineCount = null, Description $description = null) + { + Assert::integerish($startingLine); + Assert::nullOrIntegerish($lineCount); + + $this->startingLine = (int)$startingLine; + $this->lineCount = $lineCount !== null ? (int)$lineCount : null; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::stringNotEmpty($body); + Assert::notNull($descriptionFactory); + + $startingLine = 1; + $lineCount = null; + $description = null; + + // Starting line / Number of lines / Description + if (preg_match('/^([1-9]\d*)\s*(?:((?1))\s+)?(.*)$/sux', $body, $matches)) { + $startingLine = (int)$matches[1]; + if (isset($matches[2]) && $matches[2] !== '') { + $lineCount = (int)$matches[2]; + } + + $description = $matches[3]; + } + + return new static($startingLine, $lineCount, $descriptionFactory->create($description, $context)); + } + + /** + * Gets the starting line. + * + * @return int The starting line, relative to the structural element's + * location. + */ + public function getStartingLine() + { + return $this->startingLine; + } + + /** + * Returns the number of lines. + * + * @return int|null The number of lines, relative to the starting line. NULL + * means "to the end". + */ + public function getLineCount() + { + return $this->lineCount; + } + + public function __toString() + { + return $this->startingLine + . ($this->lineCount !== null ? ' ' . $this->lineCount : '') + . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,72 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}throws tag in a Docblock. + */ +final class Throws extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'throws'; + + /** @var Type */ + private $type; + + public function __construct(Type $type, Description $description = null) + { + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/\s+/Su', $body, 2); + + $type = $typeResolver->resolve(isset($parts[0]) ? $parts[0] : '', $context); + $description = $descriptionFactory->create(isset($parts[1]) ? $parts[1] : '', $context); + + return new static($type, $description); + } + + /** + * Returns the type section of the variable. + * + * @return Type + */ + public function getType() + { + return $this->type; + } + + public function __toString() + { + return $this->type . ' ' . $this->description; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,83 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}uses tag in a Docblock. + */ +final class Uses extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'uses'; + + /** @var Fqsen */ + protected $refers = null; + + /** + * Initializes this tag. + * + * @param Fqsen $refers + * @param Description $description + */ + public function __construct(Fqsen $refers, Description $description = null) + { + $this->refers = $refers; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + FqsenResolver $resolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::allNotNull([$resolver, $descriptionFactory]); + + $parts = preg_split('/\s+/Su', $body, 2); + + return new static( + $resolver->resolve($parts[0], $context), + $descriptionFactory->create(isset($parts[1]) ? $parts[1] : '', $context) + ); + } + + /** + * Returns the structural element this tag refers to. + * + * @return Fqsen + */ + public function getReference() + { + return $this->refers; + } + + /** + * Returns a string representation of this tag. + * + * @return string + */ + public function __toString() + { + return $this->refers . ' ' . $this->description->render(); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,118 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}var tag in a Docblock. + */ +class Var_ extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'var'; + + /** @var Type */ + private $type; + + /** @var string */ + protected $variableName = ''; + + /** + * @param string $variableName + * @param Type $type + * @param Description $description + */ + public function __construct($variableName, Type $type = null, Description $description = null) + { + Assert::string($variableName); + + $this->variableName = $variableName; + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . (empty($this->variableName) ? null : ('$' . $this->variableName)) + . ($this->description ? ' ' . $this->description : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,94 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}version tag in a Docblock. + */ +final class Version extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'version'; + + /** + * PCRE regular expression matching a version vector. + * Assumes the "x" modifier. + */ + const REGEX_VECTOR = '(?: + # Normal release vectors. + \d\S* + | + # VCS version vectors. Per PHPCS, they are expected to + # follow the form of the VCS name, followed by ":", followed + # by the version vector itself. + # By convention, popular VCSes like CVS, SVN and GIT use "$" + # around the actual version vector. + [^\s\:]+\:\s*\$[^\$]+\$ + )'; + + /** @var string The version vector. */ + private $version = ''; + + public function __construct($version = null, Description $description = null) + { + Assert::nullOrStringNotEmpty($version); + + $this->version = $version; + $this->description = $description; + } + + /** + * @return static + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::nullOrString($body); + if (empty($body)) { + return new static(); + } + + $matches = []; + if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { + return null; + } + + return new static( + $matches[1], + $descriptionFactory->create(isset($matches[2]) ? $matches[2] : '', $context) + ); + } + + /** + * Gets the version section of the tag. + * + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->version . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,277 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\DocBlock\StandardTagFactory; +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\TagFactory; +use Webmozart\Assert\Assert; + +final class DocBlockFactory implements DocBlockFactoryInterface +{ + /** @var DocBlock\DescriptionFactory */ + private $descriptionFactory; + + /** @var DocBlock\TagFactory */ + private $tagFactory; + + /** + * Initializes this factory with the required subcontractors. + * + * @param DescriptionFactory $descriptionFactory + * @param TagFactory $tagFactory + */ + public function __construct(DescriptionFactory $descriptionFactory, TagFactory $tagFactory) + { + $this->descriptionFactory = $descriptionFactory; + $this->tagFactory = $tagFactory; + } + + /** + * Factory method for easy instantiation. + * + * @param string[] $additionalTags + * + * @return DocBlockFactory + */ + public static function createInstance(array $additionalTags = []) + { + $fqsenResolver = new FqsenResolver(); + $tagFactory = new StandardTagFactory($fqsenResolver); + $descriptionFactory = new DescriptionFactory($tagFactory); + + $tagFactory->addService($descriptionFactory); + $tagFactory->addService(new TypeResolver($fqsenResolver)); + + $docBlockFactory = new self($descriptionFactory, $tagFactory); + foreach ($additionalTags as $tagName => $tagHandler) { + $docBlockFactory->registerTagHandler($tagName, $tagHandler); + } + + return $docBlockFactory; + } + + /** + * @param object|string $docblock A string containing the DocBlock to parse or an object supporting the + * getDocComment method (such as a ReflectionClass object). + * @param Types\Context $context + * @param Location $location + * + * @return DocBlock + */ + public function create($docblock, Types\Context $context = null, Location $location = null) + { + if (is_object($docblock)) { + if (!method_exists($docblock, 'getDocComment')) { + $exceptionMessage = 'Invalid object passed; the given object must support the getDocComment method'; + throw new \InvalidArgumentException($exceptionMessage); + } + + $docblock = $docblock->getDocComment(); + } + + Assert::stringNotEmpty($docblock); + + if ($context === null) { + $context = new Types\Context(''); + } + + $parts = $this->splitDocBlock($this->stripDocComment($docblock)); + list($templateMarker, $summary, $description, $tags) = $parts; + + return new DocBlock( + $summary, + $description ? $this->descriptionFactory->create($description, $context) : null, + array_filter($this->parseTagBlock($tags, $context), function ($tag) { + return $tag instanceof Tag; + }), + $context, + $location, + $templateMarker === '#@+', + $templateMarker === '#@-' + ); + } + + public function registerTagHandler($tagName, $handler) + { + $this->tagFactory->registerTagHandler($tagName, $handler); + } + + /** + * Strips the asterisks from the DocBlock comment. + * + * @param string $comment String containing the comment text. + * + * @return string + */ + private function stripDocComment($comment) + { + $comment = trim(preg_replace('#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', '$1', $comment)); + + // reg ex above is not able to remove */ from a single line docblock + if (substr($comment, -2) === '*/') { + $comment = trim(substr($comment, 0, -2)); + } + + return str_replace(["\r\n", "\r"], "\n", $comment); + } + + /** + * Splits the DocBlock into a template marker, summary, description and block of tags. + * + * @param string $comment Comment to split into the sub-parts. + * + * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split. + * @author Mike van Riel for extending the regex with template marker support. + * + * @return string[] containing the template marker (if any), summary, description and a string containing the tags. + */ + private function splitDocBlock($comment) + { + // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This + // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the + // performance impact of running a regular expression + if (strpos($comment, '@') === 0) { + return ['', '', '', $comment]; + } + + // clears all extra horizontal whitespace from the line endings to prevent parsing issues + $comment = preg_replace('/\h*$/Sum', '', $comment); + + /* + * Splits the docblock into a template marker, summary, description and tags section. + * + * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may + * occur after it and will be stripped). + * - The short description is started from the first character until a dot is encountered followed by a + * newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing + * errors). This is optional. + * - The long description, any character until a new line is encountered followed by an @ and word + * characters (a tag). This is optional. + * - Tags; the remaining characters + * + * Big thanks to RichardJ for contributing this Regular Expression + */ + preg_match( + '/ + \A + # 1. Extract the template marker + (?:(\#\@\+|\#\@\-)\n?)? + + # 2. Extract the summary + (?: + (?! @\pL ) # The summary may not start with an @ + ( + [^\n.]+ + (?: + (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines + [\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line + [^\n.]+ # Include anything else + )* + \.? + )? + ) + + # 3. Extract the description + (?: + \s* # Some form of whitespace _must_ precede a description because a summary must be there + (?! @\pL ) # The description may not start with an @ + ( + [^\n]+ + (?: \n+ + (?! [ \t]* @\pL ) # End description when an @ is found as first character on a new line + [^\n]+ # Include anything else + )* + ) + )? + + # 4. Extract the tags (anything that follows) + (\s+ [\s\S]*)? # everything that follows + /ux', + $comment, + $matches + ); + array_shift($matches); + + while (count($matches) < 4) { + $matches[] = ''; + } + + return $matches; + } + + /** + * Creates the tag objects. + * + * @param string $tags Tag block to parse. + * @param Types\Context $context Context of the parsed Tag + * + * @return DocBlock\Tag[] + */ + private function parseTagBlock($tags, Types\Context $context) + { + $tags = $this->filterTagBlock($tags); + if (!$tags) { + return []; + } + + $result = $this->splitTagBlockIntoTagLines($tags); + foreach ($result as $key => $tagLine) { + $result[$key] = $this->tagFactory->create(trim($tagLine), $context); + } + + return $result; + } + + /** + * @param string $tags + * + * @return string[] + */ + private function splitTagBlockIntoTagLines($tags) + { + $result = []; + foreach (explode("\n", $tags) as $tag_line) { + if (isset($tag_line[0]) && ($tag_line[0] === '@')) { + $result[] = $tag_line; + } else { + $result[count($result) - 1] .= "\n" . $tag_line; + } + } + + return $result; + } + + /** + * @param $tags + * @return string + */ + private function filterTagBlock($tags) + { + $tags = trim($tags); + if (!$tags) { + return null; + } + + if ('@' !== $tags[0]) { + // @codeCoverageIgnoreStart + // Can't simulate this; this only happens if there is an error with the parsing of the DocBlock that + // we didn't foresee. + throw new \LogicException('A tag block started with text instead of an at-sign(@): ' . $tags); + // @codeCoverageIgnoreEnd + } + + return $tags; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,23 @@ + - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection; - -use phpDocumentor\Reflection\DocBlock\Tag; -use phpDocumentor\Reflection\DocBlock\Context; -use phpDocumentor\Reflection\DocBlock\Location; - -/** - * Parses the DocBlock for any structure. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DocBlock implements \Reflector -{ - /** @var string The opening line for this docblock. */ - protected $short_description = ''; - - /** - * @var DocBlock\Description The actual - * description for this docblock. - */ - protected $long_description = null; - - /** - * @var Tag[] An array containing all - * the tags in this docblock; except inline. - */ - protected $tags = array(); - - /** @var Context Information about the context of this DocBlock. */ - protected $context = null; - - /** @var Location Information about the location of this DocBlock. */ - protected $location = null; - - /** @var bool Is this DocBlock (the start of) a template? */ - protected $isTemplateStart = false; - - /** @var bool Does this DocBlock signify the end of a DocBlock template? */ - protected $isTemplateEnd = false; - - /** - * Parses the given docblock and populates the member fields. - * - * The constructor may also receive namespace information such as the - * current namespace and aliases. This information is used by some tags - * (e.g. @return, @param, etc.) to turn a relative Type into a FQCN. - * - * @param \Reflector|string $docblock A docblock comment (including - * asterisks) or reflector supporting the getDocComment method. - * @param Context $context The context in which the DocBlock - * occurs. - * @param Location $location The location within the file that this - * DocBlock occurs in. - * - * @throws \InvalidArgumentException if the given argument does not have the - * getDocComment method. - */ - public function __construct( - $docblock, - Context $context = null, - Location $location = null - ) { - if (is_object($docblock)) { - if (!method_exists($docblock, 'getDocComment')) { - throw new \InvalidArgumentException( - 'Invalid object passed; the given reflector must support ' - . 'the getDocComment method' - ); - } - - $docblock = $docblock->getDocComment(); - } - - $docblock = $this->cleanInput($docblock); - - list($templateMarker, $short, $long, $tags) = $this->splitDocBlock($docblock); - $this->isTemplateStart = $templateMarker === '#@+'; - $this->isTemplateEnd = $templateMarker === '#@-'; - $this->short_description = $short; - $this->long_description = new DocBlock\Description($long, $this); - $this->parseTags($tags); - - $this->context = $context; - $this->location = $location; - } - - /** - * Strips the asterisks from the DocBlock comment. - * - * @param string $comment String containing the comment text. - * - * @return string - */ - protected function cleanInput($comment) - { - $comment = trim( - preg_replace( - '#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', - '$1', - $comment - ) - ); - - // reg ex above is not able to remove */ from a single line docblock - if (substr($comment, -2) == '*/') { - $comment = trim(substr($comment, 0, -2)); - } - - // normalize strings - $comment = str_replace(array("\r\n", "\r"), "\n", $comment); - - return $comment; - } - - /** - * Splits the DocBlock into a template marker, summary, description and block of tags. - * - * @param string $comment Comment to split into the sub-parts. - * - * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split. - * @author Mike van Riel for extending the regex with template marker support. - * - * @return string[] containing the template marker (if any), summary, description and a string containing the tags. - */ - protected function splitDocBlock($comment) - { - // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This - // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the - // performance impact of running a regular expression - if (strpos($comment, '@') === 0) { - return array('', '', '', $comment); - } - - // clears all extra horizontal whitespace from the line endings to prevent parsing issues - $comment = preg_replace('/\h*$/Sum', '', $comment); - - /* - * Splits the docblock into a template marker, short description, long description and tags section - * - * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may - * occur after it and will be stripped). - * - The short description is started from the first character until a dot is encountered followed by a - * newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing - * errors). This is optional. - * - The long description, any character until a new line is encountered followed by an @ and word - * characters (a tag). This is optional. - * - Tags; the remaining characters - * - * Big thanks to RichardJ for contributing this Regular Expression - */ - preg_match( - '/ - \A - # 1. Extract the template marker - (?:(\#\@\+|\#\@\-)\n?)? - - # 2. Extract the summary - (?: - (?! @\pL ) # The summary may not start with an @ - ( - [^\n.]+ - (?: - (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines - [\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line - [^\n.]+ # Include anything else - )* - \.? - )? - ) - - # 3. Extract the description - (?: - \s* # Some form of whitespace _must_ precede a description because a summary must be there - (?! @\pL ) # The description may not start with an @ - ( - [^\n]+ - (?: \n+ - (?! [ \t]* @\pL ) # End description when an @ is found as first character on a new line - [^\n]+ # Include anything else - )* - ) - )? - - # 4. Extract the tags (anything that follows) - (\s+ [\s\S]*)? # everything that follows - /ux', - $comment, - $matches - ); - array_shift($matches); - - while (count($matches) < 4) { - $matches[] = ''; - } - - return $matches; - } - - /** - * Creates the tag objects. - * - * @param string $tags Tag block to parse. - * - * @return void - */ - protected function parseTags($tags) - { - $result = array(); - $tags = trim($tags); - if ('' !== $tags) { - if ('@' !== $tags[0]) { - throw new \LogicException( - 'A tag block started with text instead of an actual tag,' - . ' this makes the tag block invalid: ' . $tags - ); - } - foreach (explode("\n", $tags) as $tag_line) { - if (isset($tag_line[0]) && ($tag_line[0] === '@')) { - $result[] = $tag_line; - } else { - $result[count($result) - 1] .= "\n" . $tag_line; - } - } - - // create proper Tag objects - foreach ($result as $key => $tag_line) { - $result[$key] = Tag::createInstance(trim($tag_line), $this); - } - } - - $this->tags = $result; - } - - /** - * Gets the text portion of the doc block. - * - * Gets the text portion (short and long description combined) of the doc - * block. - * - * @return string The text portion of the doc block. - */ - public function getText() - { - $short = $this->getShortDescription(); - $long = $this->getLongDescription()->getContents(); - - if ($long) { - return "{$short}\n\n{$long}"; - } else { - return $short; - } - } - - /** - * Set the text portion of the doc block. - * - * Sets the text portion (short and long description combined) of the doc - * block. - * - * @param string $docblock The new text portion of the doc block. - * - * @return $this This doc block. - */ - public function setText($comment) - { - list(,$short, $long) = $this->splitDocBlock($comment); - $this->short_description = $short; - $this->long_description = new DocBlock\Description($long, $this); - return $this; - } - /** - * Returns the opening line or also known as short description. - * - * @return string - */ - public function getShortDescription() - { - return $this->short_description; - } - - /** - * Returns the full description or also known as long description. - * - * @return DocBlock\Description - */ - public function getLongDescription() - { - return $this->long_description; - } - - /** - * Returns whether this DocBlock is the start of a Template section. - * - * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker - * (`#@+`) that is appended directly after the opening `/**` of a DocBlock. - * - * An example of such an opening is: - * - * ``` - * /**#@+ - * * My DocBlock - * * / - * ``` - * - * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all - * elements that follow until another DocBlock is found that contains the closing marker (`#@-`). - * - * @see self::isTemplateEnd() for the check whether a closing marker was provided. - * - * @return boolean - */ - public function isTemplateStart() - { - return $this->isTemplateStart; - } - - /** - * Returns whether this DocBlock is the end of a Template section. - * - * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. - * - * @return boolean - */ - public function isTemplateEnd() - { - return $this->isTemplateEnd; - } - - /** - * Returns the current context. - * - * @return Context - */ - public function getContext() - { - return $this->context; - } - - /** - * Returns the current location. - * - * @return Location - */ - public function getLocation() - { - return $this->location; - } - - /** - * Returns the tags for this DocBlock. - * - * @return Tag[] - */ - public function getTags() - { - return $this->tags; - } - - /** - * Returns an array of tags matching the given name. If no tags are found - * an empty array is returned. - * - * @param string $name String to search by. - * - * @return Tag[] - */ - public function getTagsByName($name) - { - $result = array(); - - /** @var Tag $tag */ - foreach ($this->getTags() as $tag) { - if ($tag->getName() != $name) { - continue; - } - - $result[] = $tag; - } - - return $result; - } - - /** - * Checks if a tag of a certain type is present in this DocBlock. - * - * @param string $name Tag name to check for. - * - * @return bool - */ - public function hasTag($name) - { - /** @var Tag $tag */ - foreach ($this->getTags() as $tag) { - if ($tag->getName() == $name) { - return true; - } - } - - return false; - } - - /** - * Appends a tag at the end of the list of tags. - * - * @param Tag $tag The tag to add. - * - * @return Tag The newly added tag. - * - * @throws \LogicException When the tag belongs to a different DocBlock. - */ - public function appendTag(Tag $tag) - { - if (null === $tag->getDocBlock()) { - $tag->setDocBlock($this); - } - - if ($tag->getDocBlock() === $this) { - $this->tags[] = $tag; - } else { - throw new \LogicException( - 'This tag belongs to a different DocBlock object.' - ); - } - - return $tag; - } - - - /** - * Builds a string representation of this object. - * - * @todo determine the exact format as used by PHP Reflection and - * implement it. - * - * @return string - * @codeCoverageIgnore Not yet implemented - */ - public static function export() - { - throw new \Exception('Not yet implemented'); - } - - /** - * Returns the exported information (we should use the export static method - * BUT this throws an exception at this point). - * - * @return string - * @codeCoverageIgnore Not yet implemented - */ - public function __toString() - { - return 'Not yet implemented'; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -/** - * The context in which a DocBlock occurs. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Context -{ - /** @var string The current namespace. */ - protected $namespace = ''; - - /** @var array List of namespace aliases => Fully Qualified Namespace. */ - protected $namespace_aliases = array(); - - /** @var string Name of the structural element, within the namespace. */ - protected $lsen = ''; - - /** - * Cteates a new context. - * @param string $namespace The namespace where this DocBlock - * resides in. - * @param array $namespace_aliases List of namespace aliases => Fully - * Qualified Namespace. - * @param string $lsen Name of the structural element, within - * the namespace. - */ - public function __construct( - $namespace = '', - array $namespace_aliases = array(), - $lsen = '' - ) { - if (!empty($namespace)) { - $this->setNamespace($namespace); - } - $this->setNamespaceAliases($namespace_aliases); - $this->setLSEN($lsen); - } - - /** - * @return string The namespace where this DocBlock resides in. - */ - public function getNamespace() - { - return $this->namespace; - } - - /** - * @return array List of namespace aliases => Fully Qualified Namespace. - */ - public function getNamespaceAliases() - { - return $this->namespace_aliases; - } - - /** - * Returns the Local Structural Element Name. - * - * @return string Name of the structural element, within the namespace. - */ - public function getLSEN() - { - return $this->lsen; - } - - /** - * Sets a new namespace. - * - * Sets a new namespace for the context. Leading and trailing slashes are - * trimmed, and the keywords "global" and "default" are treated as aliases - * to no namespace. - * - * @param string $namespace The new namespace to set. - * - * @return $this - */ - public function setNamespace($namespace) - { - if ('global' !== $namespace - && 'default' !== $namespace - ) { - // Srip leading and trailing slash - $this->namespace = trim((string)$namespace, '\\'); - } else { - $this->namespace = ''; - } - return $this; - } - - /** - * Sets the namespace aliases, replacing all previous ones. - * - * @param array $namespace_aliases List of namespace aliases => Fully - * Qualified Namespace. - * - * @return $this - */ - public function setNamespaceAliases(array $namespace_aliases) - { - $this->namespace_aliases = array(); - foreach ($namespace_aliases as $alias => $fqnn) { - $this->setNamespaceAlias($alias, $fqnn); - } - return $this; - } - - /** - * Adds a namespace alias to the context. - * - * @param string $alias The alias name (the part after "as", or the last - * part of the Fully Qualified Namespace Name) to add. - * @param string $fqnn The Fully Qualified Namespace Name for this alias. - * Any form of leading/trailing slashes are accepted, but what will be - * stored is a name, prefixed with a slash, and no trailing slash. - * - * @return $this - */ - public function setNamespaceAlias($alias, $fqnn) - { - $this->namespace_aliases[$alias] = '\\' . trim((string)$fqnn, '\\'); - return $this; - } - - /** - * Sets a new Local Structural Element Name. - * - * Sets a new Local Structural Element Name. A local name also contains - * punctuation determining the kind of structural element (e.g. trailing "(" - * and ")" for functions and methods). - * - * @param string $lsen The new local name of a structural element. - * - * @return $this - */ - public function setLSEN($lsen) - { - $this->lsen = (string)$lsen; - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,223 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -use phpDocumentor\Reflection\DocBlock; - -/** - * Parses a Description of a DocBlock or tag. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Description implements \Reflector -{ - /** @var string */ - protected $contents = ''; - - /** @var array The contents, as an array of strings and Tag objects. */ - protected $parsedContents = null; - - /** @var DocBlock The DocBlock which this description belongs to. */ - protected $docblock = null; - - /** - * Populates the fields of a description. - * - * @param string $content The description's conetnts. - * @param DocBlock $docblock The DocBlock which this description belongs to. - */ - public function __construct($content, DocBlock $docblock = null) - { - $this->setContent($content)->setDocBlock($docblock); - } - - /** - * Gets the text of this description. - * - * @return string - */ - public function getContents() - { - return $this->contents; - } - - /** - * Sets the text of this description. - * - * @param string $content The new text of this description. - * - * @return $this - */ - public function setContent($content) - { - $this->contents = trim($content); - - $this->parsedContents = null; - return $this; - } - - /** - * Returns the parsed text of this description. - * - * @return array An array of strings and tag objects, in the order they - * occur within the description. - */ - public function getParsedContents() - { - if (null === $this->parsedContents) { - $this->parsedContents = preg_split( - '/\{ - # "{@}" is not a valid inline tag. This ensures that - # we do not treat it as one, but treat it literally. - (?!@\}) - # We want to capture the whole tag line, but without the - # inline tag delimiters. - (\@ - # Match everything up to the next delimiter. - [^{}]* - # Nested inline tag content should not be captured, or - # it will appear in the result separately. - (?: - # Match nested inline tags. - (?: - # Because we did not catch the tag delimiters - # earlier, we must be explicit with them here. - # Notice that this also matches "{}", as a way - # to later introduce it as an escape sequence. - \{(?1)?\} - | - # Make sure we match hanging "{". - \{ - ) - # Match content after the nested inline tag. - [^{}]* - )* # If there are more inline tags, match them as well. - # We use "*" since there may not be any nested inline - # tags. - ) - \}/Sux', - $this->contents, - null, - PREG_SPLIT_DELIM_CAPTURE - ); - - $count = count($this->parsedContents); - for ($i=1; $i<$count; $i += 2) { - $this->parsedContents[$i] = Tag::createInstance( - $this->parsedContents[$i], - $this->docblock - ); - } - - //In order to allow "literal" inline tags, the otherwise invalid - //sequence "{@}" is changed to "@", and "{}" is changed to "}". - //See unit tests for examples. - for ($i=0; $i<$count; $i += 2) { - $this->parsedContents[$i] = str_replace( - array('{@}', '{}'), - array('@', '}'), - $this->parsedContents[$i] - ); - } - } - return $this->parsedContents; - } - - /** - * Return a formatted variant of the Long Description using MarkDown. - * - * @todo this should become a more intelligent piece of code where the - * configuration contains a setting what format long descriptions are. - * - * @codeCoverageIgnore Will be removed soon, in favor of adapters at - * PhpDocumentor itself that will process text in various formats. - * - * @return string - */ - public function getFormattedContents() - { - $result = $this->contents; - - // if the long description contains a plain HTML element, surround - // it with a pre element. Please note that we explicitly used str_replace - // and not preg_replace to gain performance - if (strpos($result, '') !== false) { - $result = str_replace( - array('', "\r\n", "\n", "\r", ''), - array('
    ', '', '', '', '
    '), - $result - ); - } - - if (class_exists('Parsedown')) { - $markdown = \Parsedown::instance(); - $result = $markdown->parse($result); - } elseif (class_exists('dflydev\markdown\MarkdownExtraParser')) { - $markdown = new \dflydev\markdown\MarkdownExtraParser(); - $result = $markdown->transformMarkdown($result); - } - - return trim($result); - } - - /** - * Gets the docblock this tag belongs to. - * - * @return DocBlock The docblock this description belongs to. - */ - public function getDocBlock() - { - return $this->docblock; - } - - /** - * Sets the docblock this tag belongs to. - * - * @param DocBlock $docblock The new docblock this description belongs to. - * Setting NULL removes any association. - * - * @return $this - */ - public function setDocBlock(DocBlock $docblock = null) - { - $this->docblock = $docblock; - - return $this; - } - - /** - * Builds a string representation of this object. - * - * @todo determine the exact format as used by PHP Reflection - * and implement it. - * - * @return void - * @codeCoverageIgnore Not yet implemented - */ - public static function export() - { - throw new \Exception('Not yet implemented'); - } - - /** - * Returns the long description as a string. - * - * @return string - */ - public function __toString() - { - return $this->getContents(); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -/** - * The location a DocBlock occurs within a file. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Location -{ - /** @var int Line where the DocBlock text starts. */ - protected $lineNumber = 0; - - /** @var int Column where the DocBlock text starts. */ - protected $columnNumber = 0; - - public function __construct( - $lineNumber = 0, - $columnNumber = 0 - ) { - $this->setLineNumber($lineNumber)->setColumnNumber($columnNumber); - } - - /** - * @return int Line where the DocBlock text starts. - */ - public function getLineNumber() - { - return $this->lineNumber; - } - - /** - * - * @param type $lineNumber - * @return $this - */ - public function setLineNumber($lineNumber) - { - $this->lineNumber = (int)$lineNumber; - - return $this; - } - - /** - * @return int Column where the DocBlock text starts. - */ - public function getColumnNumber() - { - return $this->columnNumber; - } - - /** - * - * @param int $columnNumber - * @return $this - */ - public function setColumnNumber($columnNumber) - { - $this->columnNumber = (int)$columnNumber; - - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ - - * @copyright 2013 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -use phpDocumentor\Reflection\DocBlock; - -/** - * Serializes a DocBlock instance. - * - * @author Barry vd. Heuvel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Serializer -{ - - /** @var string The string to indent the comment with. */ - protected $indentString = ' '; - - /** @var int The number of times the indent string is repeated. */ - protected $indent = 0; - - /** @var bool Whether to indent the first line. */ - protected $isFirstLineIndented = true; - - /** @var int|null The max length of a line. */ - protected $lineLength = null; - - /** - * Create a Serializer instance. - * - * @param int $indent The number of times the indent string is - * repeated. - * @param string $indentString The string to indent the comment with. - * @param bool $indentFirstLine Whether to indent the first line. - * @param int|null $lineLength The max length of a line or NULL to - * disable line wrapping. - */ - public function __construct( - $indent = 0, - $indentString = ' ', - $indentFirstLine = true, - $lineLength = null - ) { - $this->setIndentationString($indentString); - $this->setIndent($indent); - $this->setIsFirstLineIndented($indentFirstLine); - $this->setLineLength($lineLength); - } - - /** - * Sets the string to indent comments with. - * - * @param string $indentationString The string to indent comments with. - * - * @return $this This serializer object. - */ - public function setIndentationString($indentString) - { - $this->indentString = (string)$indentString; - return $this; - } - - /** - * Gets the string to indent comments with. - * - * @return string The indent string. - */ - public function getIndentationString() - { - return $this->indentString; - } - - /** - * Sets the number of indents. - * - * @param int $indent The number of times the indent string is repeated. - * - * @return $this This serializer object. - */ - public function setIndent($indent) - { - $this->indent = (int)$indent; - return $this; - } - - /** - * Gets the number of indents. - * - * @return int The number of times the indent string is repeated. - */ - public function getIndent() - { - return $this->indent; - } - - /** - * Sets whether or not the first line should be indented. - * - * Sets whether or not the first line (the one with the "/**") should be - * indented. - * - * @param bool $indentFirstLine The new value for this setting. - * - * @return $this This serializer object. - */ - public function setIsFirstLineIndented($indentFirstLine) - { - $this->isFirstLineIndented = (bool)$indentFirstLine; - return $this; - } - - /** - * Gets whether or not the first line should be indented. - * - * @return bool Whether or not the first line should be indented. - */ - public function isFirstLineIndented() - { - return $this->isFirstLineIndented; - } - - /** - * Sets the line length. - * - * Sets the length of each line in the serialization. Content will be - * wrapped within this limit. - * - * @param int|null $lineLength The length of each line. NULL to disable line - * wrapping altogether. - * - * @return $this This serializer object. - */ - public function setLineLength($lineLength) - { - $this->lineLength = null === $lineLength ? null : (int)$lineLength; - return $this; - } - - /** - * Gets the line length. - * - * @return int|null The length of each line or NULL if line wrapping is - * disabled. - */ - public function getLineLength() - { - return $this->lineLength; - } - - /** - * Generate a DocBlock comment. - * - * @param DocBlock The DocBlock to serialize. - * - * @return string The serialized doc block. - */ - public function getDocComment(DocBlock $docblock) - { - $indent = str_repeat($this->indentString, $this->indent); - $firstIndent = $this->isFirstLineIndented ? $indent : ''; - - $text = $docblock->getText(); - if ($this->lineLength) { - //3 === strlen(' * ') - $wrapLength = $this->lineLength - strlen($indent) - 3; - $text = wordwrap($text, $wrapLength); - } - $text = str_replace("\n", "\n{$indent} * ", $text); - - $comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n"; - - /** @var Tag $tag */ - foreach ($docblock->getTags() as $tag) { - $tagText = (string) $tag; - if ($this->lineLength) { - $tagText = wordwrap($tagText, $wrapLength); - } - $tagText = str_replace("\n", "\n{$indent} * ", $tagText); - - $comment .= "{$indent} * {$tagText}\n"; - } - - $comment .= $indent . ' */'; - - return $comment; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,377 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -use phpDocumentor\Reflection\DocBlock; - -/** - * Parses a tag definition for a DocBlock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Tag implements \Reflector -{ - /** - * PCRE regular expression matching a tag name. - */ - const REGEX_TAGNAME = '[\w\-\_\\\\]+'; - - /** @var string Name of the tag */ - protected $tag = ''; - - /** - * @var string|null Content of the tag. - * When set to NULL, it means it needs to be regenerated. - */ - protected $content = ''; - - /** @var string Description of the content of this tag */ - protected $description = ''; - - /** - * @var array|null The description, as an array of strings and Tag objects. - * When set to NULL, it means it needs to be regenerated. - */ - protected $parsedDescription = null; - - /** @var Location Location of the tag. */ - protected $location = null; - - /** @var DocBlock The DocBlock which this tag belongs to. */ - protected $docblock = null; - - /** - * @var array An array with a tag as a key, and an FQCN to a class that - * handles it as an array value. The class is expected to inherit this - * class. - */ - private static $tagHandlerMappings = array( - 'author' - => '\phpDocumentor\Reflection\DocBlock\Tag\AuthorTag', - 'covers' - => '\phpDocumentor\Reflection\DocBlock\Tag\CoversTag', - 'deprecated' - => '\phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag', - 'example' - => '\phpDocumentor\Reflection\DocBlock\Tag\ExampleTag', - 'link' - => '\phpDocumentor\Reflection\DocBlock\Tag\LinkTag', - 'method' - => '\phpDocumentor\Reflection\DocBlock\Tag\MethodTag', - 'param' - => '\phpDocumentor\Reflection\DocBlock\Tag\ParamTag', - 'property-read' - => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyReadTag', - 'property' - => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyTag', - 'property-write' - => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyWriteTag', - 'return' - => '\phpDocumentor\Reflection\DocBlock\Tag\ReturnTag', - 'see' - => '\phpDocumentor\Reflection\DocBlock\Tag\SeeTag', - 'since' - => '\phpDocumentor\Reflection\DocBlock\Tag\SinceTag', - 'source' - => '\phpDocumentor\Reflection\DocBlock\Tag\SourceTag', - 'throw' - => '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag', - 'throws' - => '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag', - 'uses' - => '\phpDocumentor\Reflection\DocBlock\Tag\UsesTag', - 'var' - => '\phpDocumentor\Reflection\DocBlock\Tag\VarTag', - 'version' - => '\phpDocumentor\Reflection\DocBlock\Tag\VersionTag' - ); - - /** - * Factory method responsible for instantiating the correct sub type. - * - * @param string $tag_line The text for this tag, including description. - * @param DocBlock $docblock The DocBlock which this tag belongs to. - * @param Location $location Location of the tag. - * - * @throws \InvalidArgumentException if an invalid tag line was presented. - * - * @return static A new tag object. - */ - final public static function createInstance( - $tag_line, - DocBlock $docblock = null, - Location $location = null - ) { - if (!preg_match( - '/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us', - $tag_line, - $matches - )) { - throw new \InvalidArgumentException( - 'Invalid tag_line detected: ' . $tag_line - ); - } - - $handler = __CLASS__; - if (isset(self::$tagHandlerMappings[$matches[1]])) { - $handler = self::$tagHandlerMappings[$matches[1]]; - } elseif (isset($docblock)) { - $tagName = (string)new Type\Collection( - array($matches[1]), - $docblock->getContext() - ); - - if (isset(self::$tagHandlerMappings[$tagName])) { - $handler = self::$tagHandlerMappings[$tagName]; - } - } - - return new $handler( - $matches[1], - isset($matches[2]) ? $matches[2] : '', - $docblock, - $location - ); - } - - /** - * Registers a handler for tags. - * - * Registers a handler for tags. The class specified is autoloaded if it's - * not available. It must inherit from this class. - * - * @param string $tag Name of tag to regiser a handler for. When - * registering a namespaced tag, the full name, along with a prefixing - * slash MUST be provided. - * @param string|null $handler FQCN of handler. Specifing NULL removes the - * handler for the specified tag, if any. - * - * @return bool TRUE on success, FALSE on failure. - */ - final public static function registerTagHandler($tag, $handler) - { - $tag = trim((string)$tag); - - if (null === $handler) { - unset(self::$tagHandlerMappings[$tag]); - return true; - } - - if ('' !== $tag - && class_exists($handler, true) - && is_subclass_of($handler, __CLASS__) - && !strpos($tag, '\\') //Accept no slash, and 1st slash at offset 0. - ) { - self::$tagHandlerMappings[$tag] = $handler; - return true; - } - - return false; - } - - /** - * Parses a tag and populates the member variables. - * - * @param string $name Name of the tag. - * @param string $content The contents of the given tag. - * @param DocBlock $docblock The DocBlock which this tag belongs to. - * @param Location $location Location of the tag. - */ - public function __construct( - $name, - $content, - DocBlock $docblock = null, - Location $location = null - ) { - $this - ->setName($name) - ->setContent($content) - ->setDocBlock($docblock) - ->setLocation($location); - } - - /** - * Gets the name of this tag. - * - * @return string The name of this tag. - */ - public function getName() - { - return $this->tag; - } - - /** - * Sets the name of this tag. - * - * @param string $name The new name of this tag. - * - * @return $this - * @throws \InvalidArgumentException When an invalid tag name is provided. - */ - public function setName($name) - { - if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) { - throw new \InvalidArgumentException( - 'Invalid tag name supplied: ' . $name - ); - } - - $this->tag = $name; - - return $this; - } - - /** - * Gets the content of this tag. - * - * @return string - */ - public function getContent() - { - if (null === $this->content) { - $this->content = $this->description; - } - - return $this->content; - } - - /** - * Sets the content of this tag. - * - * @param string $content The new content of this tag. - * - * @return $this - */ - public function setContent($content) - { - $this->setDescription($content); - $this->content = $content; - - return $this; - } - - /** - * Gets the description component of this tag. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the description component of this tag. - * - * @param string $description The new description component of this tag. - * - * @return $this - */ - public function setDescription($description) - { - $this->content = null; - $this->parsedDescription = null; - $this->description = trim($description); - - return $this; - } - - /** - * Gets the parsed text of this description. - * - * @return array An array of strings and tag objects, in the order they - * occur within the description. - */ - public function getParsedDescription() - { - if (null === $this->parsedDescription) { - $description = new Description($this->description, $this->docblock); - $this->parsedDescription = $description->getParsedContents(); - } - return $this->parsedDescription; - } - - /** - * Gets the docblock this tag belongs to. - * - * @return DocBlock The docblock this tag belongs to. - */ - public function getDocBlock() - { - return $this->docblock; - } - - /** - * Sets the docblock this tag belongs to. - * - * @param DocBlock $docblock The new docblock this tag belongs to. Setting - * NULL removes any association. - * - * @return $this - */ - public function setDocBlock(DocBlock $docblock = null) - { - $this->docblock = $docblock; - - return $this; - } - - /** - * Gets the location of the tag. - * - * @return Location The tag's location. - */ - public function getLocation() - { - return $this->location; - } - - /** - * Sets the location of the tag. - * - * @param Location $location The new location of the tag. - * - * @return $this - */ - public function setLocation(Location $location = null) - { - $this->location = $location; - - return $this; - } - - /** - * Builds a string representation of this object. - * - * @todo determine the exact format as used by PHP Reflection and implement it. - * - * @return void - * @codeCoverageIgnore Not yet implemented - */ - public static function export() - { - throw new \Exception('Not yet implemented'); - } - - /** - * Returns the tag as a serialized string - * - * @return string - */ - public function __toString() - { - return "@{$this->getName()} {$this->getContent()}"; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for an @author tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class AuthorTag extends Tag -{ - /** - * PCRE regular expression matching any valid value for the name component. - */ - const REGEX_AUTHOR_NAME = '[^\<]*'; - - /** - * PCRE regular expression matching any valid value for the email component. - */ - const REGEX_AUTHOR_EMAIL = '[^\>]*'; - - /** @var string The name of the author */ - protected $authorName = ''; - - /** @var string The email of the author */ - protected $authorEmail = ''; - - public function getContent() - { - if (null === $this->content) { - $this->content = $this->authorName; - if ('' != $this->authorEmail) { - $this->content .= "<{$this->authorEmail}>"; - } - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - if (preg_match( - '/^(' . self::REGEX_AUTHOR_NAME . - ')(\<(' . self::REGEX_AUTHOR_EMAIL . - ')\>)?$/u', - $this->description, - $matches - )) { - $this->authorName = trim($matches[1]); - if (isset($matches[3])) { - $this->authorEmail = trim($matches[3]); - } - } - - return $this; - } - - /** - * Gets the author's name. - * - * @return string The author's name. - */ - public function getAuthorName() - { - return $this->authorName; - } - - /** - * Sets the author's name. - * - * @param string $authorName The new author name. - * An invalid value will set an empty string. - * - * @return $this - */ - public function setAuthorName($authorName) - { - $this->content = null; - $this->authorName - = preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName) - ? $authorName : ''; - - return $this; - } - - /** - * Gets the author's email. - * - * @return string The author's email. - */ - public function getAuthorEmail() - { - return $this->authorEmail; - } - - /** - * Sets the author's email. - * - * @param string $authorEmail The new author email. - * An invalid value will set an empty string. - * - * @return $this - */ - public function setAuthorEmail($authorEmail) - { - $this->authorEmail - = preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail) - ? $authorEmail : ''; - - $this->content = null; - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @covers tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class CoversTag extends SeeTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag\VersionTag; - -/** - * Reflection class for a @deprecated tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DeprecatedTag extends VersionTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @example tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ExampleTag extends SourceTag -{ - /** - * @var string Path to a file to use as an example. - * May also be an absolute URI. - */ - protected $filePath = ''; - - /** - * @var bool Whether the file path component represents an URI. - * This determines how the file portion appears at {@link getContent()}. - */ - protected $isURI = false; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $filePath = ''; - if ($this->isURI) { - if (false === strpos($this->filePath, ':')) { - $filePath = str_replace( - '%2F', - '/', - rawurlencode($this->filePath) - ); - } else { - $filePath = $this->filePath; - } - } else { - $filePath = '"' . $this->filePath . '"'; - } - - $this->content = $filePath . ' ' . parent::getContent(); - } - - return $this->content; - } - /** - * {@inheritdoc} - */ - public function setContent($content) - { - Tag::setContent($content); - if (preg_match( - '/^ - # File component - (?: - # File path in quotes - \"([^\"]+)\" - | - # File URI - (\S+) - ) - # Remaining content (parsed by SourceTag) - (?:\s+(.*))? - $/sux', - $this->description, - $matches - )) { - if ('' !== $matches[1]) { - $this->setFilePath($matches[1]); - } else { - $this->setFileURI($matches[2]); - } - - if (isset($matches[3])) { - parent::setContent($matches[3]); - } else { - $this->setDescription(''); - } - $this->content = $content; - } - - return $this; - } - - /** - * Returns the file path. - * - * @return string Path to a file to use as an example. - * May also be an absolute URI. - */ - public function getFilePath() - { - return $this->filePath; - } - - /** - * Sets the file path. - * - * @param string $filePath The new file path to use for the example. - * - * @return $this - */ - public function setFilePath($filePath) - { - $this->isURI = false; - $this->filePath = trim($filePath); - - $this->content = null; - return $this; - } - - /** - * Sets the file path as an URI. - * - * This function is equivalent to {@link setFilePath()}, except that it - * convers an URI to a file path before that. - * - * There is no getFileURI(), as {@link getFilePath()} is compatible. - * - * @param type $uri The new file URI to use as an example. - */ - public function setFileURI($uri) - { - $this->isURI = true; - if (false === strpos($uri, ':')) { - //Relative URL - $this->filePath = rawurldecode( - str_replace(array('/', '\\'), '%2F', $uri) - ); - } else { - //Absolute URL or URI. - $this->filePath = $uri; - } - - $this->content = null; - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @link tag in a Docblock. - * - * @author Ben Selby - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class LinkTag extends Tag -{ - /** @var string */ - protected $link = ''; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content = "{$this->link} {$this->description}"; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - $parts = preg_split('/\s+/Su', $this->description, 2); - - $this->link = $parts[0]; - - $this->setDescription(isset($parts[1]) ? $parts[1] : $parts[0]); - - $this->content = $content; - return $this; - } - - /** - * Gets the link - * - * @return string - */ - public function getLink() - { - return $this->link; - } - - /** - * Sets the link - * - * @param string $link The link - * - * @return $this - */ - public function setLink($link) - { - $this->link = $link; - - $this->content = null; - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @method in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class MethodTag extends ReturnTag -{ - - /** @var string */ - protected $method_name = ''; - - /** @var string */ - protected $arguments = ''; - - /** @var bool */ - protected $isStatic = false; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content = ''; - if ($this->isStatic) { - $this->content .= 'static '; - } - $this->content .= $this->type . - " {$this->method_name}({$this->arguments}) " . - $this->description; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - Tag::setContent($content); - // 1. none or more whitespace - // 2. optionally the keyword "static" followed by whitespace - // 3. optionally a word with underscores followed by whitespace : as - // type for the return value - // 4. then optionally a word with underscores followed by () and - // whitespace : as method name as used by phpDocumentor - // 5. then a word with underscores, followed by ( and any character - // until a ) and whitespace : as method name with signature - // 6. any remaining text : as description - if (preg_match( - '/^ - # Static keyword - # Declates a static method ONLY if type is also present - (?: - (static) - \s+ - )? - # Return type - (?: - ([\w\|_\\\\]+) - \s+ - )? - # Legacy method name (not captured) - (?: - [\w_]+\(\)\s+ - )? - # Method name - ([\w\|_\\\\]+) - # Arguments - \(([^\)]*)\) - \s* - # Description - (.*) - $/sux', - $this->description, - $matches - )) { - list( - , - $static, - $this->type, - $this->method_name, - $this->arguments, - $this->description - ) = $matches; - if ($static) { - if (!$this->type) { - $this->type = 'static'; - } else { - $this->isStatic = true; - } - } else { - if (!$this->type) { - $this->type = 'void'; - } - } - $this->parsedDescription = null; - } - - return $this; - } - - /** - * Sets the name of this method. - * - * @param string $method_name The name of the method. - * - * @return $this - */ - public function setMethodName($method_name) - { - $this->method_name = $method_name; - - $this->content = null; - return $this; - } - - /** - * Retrieves the method name. - * - * @return string - */ - public function getMethodName() - { - return $this->method_name; - } - - /** - * Sets the arguments for this method. - * - * @param string $arguments A comma-separated arguments line. - * - * @return void - */ - public function setArguments($arguments) - { - $this->arguments = $arguments; - - $this->content = null; - return $this; - } - - /** - * Returns an array containing each argument as array of type and name. - * - * Please note that the argument sub-array may only contain 1 element if no - * type was specified. - * - * @return string[] - */ - public function getArguments() - { - if (empty($this->arguments)) { - return array(); - } - - $arguments = explode(',', $this->arguments); - foreach ($arguments as $key => $value) { - $arguments[$key] = explode(' ', trim($value)); - } - - return $arguments; - } - - /** - * Checks whether the method tag describes a static method or not. - * - * @return bool TRUE if the method declaration is for a static method, FALSE - * otherwise. - */ - public function isStatic() - { - return $this->isStatic; - } - - /** - * Sets a new value for whether the method is static or not. - * - * @param bool $isStatic The new value to set. - * - * @return $this - */ - public function setIsStatic($isStatic) - { - $this->isStatic = $isStatic; - - $this->content = null; - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @param tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ParamTag extends ReturnTag -{ - /** @var string */ - protected $variableName = ''; - - /** @var bool determines whether this is a variadic argument */ - protected $isVariadic = false; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content - = "{$this->type} {$this->variableName} {$this->description}"; - } - return $this->content; - } - /** - * {@inheritdoc} - */ - public function setContent($content) - { - Tag::setContent($content); - $parts = preg_split( - '/(\s+)/Su', - $this->description, - 3, - PREG_SPLIT_DELIM_CAPTURE - ); - - // if the first item that is encountered is not a variable; it is a type - if (isset($parts[0]) - && (strlen($parts[0]) > 0) - && ($parts[0][0] !== '$') - ) { - $this->type = array_shift($parts); - array_shift($parts); - } - - // if the next item starts with a $ or ...$ it must be the variable name - if (isset($parts[0]) - && (strlen($parts[0]) > 0) - && ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$') - ) { - $this->variableName = array_shift($parts); - array_shift($parts); - - if (substr($this->variableName, 0, 3) === '...') { - $this->isVariadic = true; - $this->variableName = substr($this->variableName, 3); - } - } - - $this->setDescription(implode('', $parts)); - - $this->content = $content; - return $this; - } - - /** - * Returns the variable's name. - * - * @return string - */ - public function getVariableName() - { - return $this->variableName; - } - - /** - * Sets the variable's name. - * - * @param string $name The new name for this variable. - * - * @return $this - */ - public function setVariableName($name) - { - $this->variableName = $name; - - $this->content = null; - return $this; - } - - /** - * Returns whether this tag is variadic. - * - * @return boolean - */ - public function isVariadic() - { - return $this->isVariadic; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @property-read tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class PropertyReadTag extends PropertyTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @property tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class PropertyTag extends ParamTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @property-write tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class PropertyWriteTag extends PropertyTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; -use phpDocumentor\Reflection\DocBlock\Type\Collection; - -/** - * Reflection class for a @return tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ReturnTag extends Tag -{ - /** @var string The raw type component. */ - protected $type = ''; - - /** @var Collection The parsed type component. */ - protected $types = null; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content = "{$this->type} {$this->description}"; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - - $parts = preg_split('/\s+/Su', $this->description, 2); - - // any output is considered a type - $this->type = $parts[0]; - $this->types = null; - - $this->setDescription(isset($parts[1]) ? $parts[1] : ''); - - $this->content = $content; - return $this; - } - - /** - * Returns the unique types of the variable. - * - * @return string[] - */ - public function getTypes() - { - return $this->getTypesCollection()->getArrayCopy(); - } - - /** - * Returns the type section of the variable. - * - * @return string - */ - public function getType() - { - return (string) $this->getTypesCollection(); - } - - /** - * Returns the type collection. - * - * @return void - */ - protected function getTypesCollection() - { - if (null === $this->types) { - $this->types = new Collection( - array($this->type), - $this->docblock ? $this->docblock->getContext() : null - ); - } - return $this->types; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @see tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SeeTag extends Tag -{ - /** @var string */ - protected $refers = null; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content = "{$this->refers} {$this->description}"; - } - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - $parts = preg_split('/\s+/Su', $this->description, 2); - - // any output is considered a type - $this->refers = $parts[0]; - - $this->setDescription(isset($parts[1]) ? $parts[1] : ''); - - $this->content = $content; - return $this; - } - - /** - * Gets the structural element this tag refers to. - * - * @return string - */ - public function getReference() - { - return $this->refers; - } - - /** - * Sets the structural element this tag refers to. - * - * @param string $refers The new type this tag refers to. - * - * @return $this - */ - public function setReference($refers) - { - $this->refers = $refers; - - $this->content = null; - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag\VersionTag; - -/** - * Reflection class for a @since tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SinceTag extends VersionTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @source tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SourceTag extends Tag -{ - /** - * @var int The starting line, relative to the structural element's - * location. - */ - protected $startingLine = 1; - - /** - * @var int|null The number of lines, relative to the starting line. NULL - * means "to the end". - */ - protected $lineCount = null; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content - = "{$this->startingLine} {$this->lineCount} {$this->description}"; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - if (preg_match( - '/^ - # Starting line - ([1-9]\d*) - \s* - # Number of lines - (?: - ((?1)) - \s+ - )? - # Description - (.*) - $/sux', - $this->description, - $matches - )) { - $this->startingLine = (int)$matches[1]; - if (isset($matches[2]) && '' !== $matches[2]) { - $this->lineCount = (int)$matches[2]; - } - $this->setDescription($matches[3]); - $this->content = $content; - } - - return $this; - } - - /** - * Gets the starting line. - * - * @return int The starting line, relative to the structural element's - * location. - */ - public function getStartingLine() - { - return $this->startingLine; - } - - /** - * Sets the starting line. - * - * @param int $startingLine The new starting line, relative to the - * structural element's location. - * - * @return $this - */ - public function setStartingLine($startingLine) - { - $this->startingLine = $startingLine; - - $this->content = null; - return $this; - } - - /** - * Returns the number of lines. - * - * @return int|null The number of lines, relative to the starting line. NULL - * means "to the end". - */ - public function getLineCount() - { - return $this->lineCount; - } - - /** - * Sets the number of lines. - * - * @param int|null $lineCount The new number of lines, relative to the - * starting line. NULL means "to the end". - * - * @return $this - */ - public function setLineCount($lineCount) - { - $this->lineCount = $lineCount; - - $this->content = null; - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @throws tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ThrowsTag extends ReturnTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @uses tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class UsesTag extends SeeTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @var tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class VarTag extends ParamTag -{ -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @version tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class VersionTag extends Tag -{ - /** - * PCRE regular expression matching a version vector. - * Assumes the "x" modifier. - */ - const REGEX_VECTOR = '(?: - # Normal release vectors. - \d\S* - | - # VCS version vectors. Per PHPCS, they are expected to - # follow the form of the VCS name, followed by ":", followed - # by the version vector itself. - # By convention, popular VCSes like CVS, SVN and GIT use "$" - # around the actual version vector. - [^\s\:]+\:\s*\$[^\$]+\$ - )'; - - /** @var string The version vector. */ - protected $version = ''; - - public function getContent() - { - if (null === $this->content) { - $this->content = "{$this->version} {$this->description}"; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - - if (preg_match( - '/^ - # The version vector - (' . self::REGEX_VECTOR . ') - \s* - # The description - (.+)? - $/sux', - $this->description, - $matches - )) { - $this->version = $matches[1]; - $this->setDescription(isset($matches[2]) ? $matches[2] : ''); - $this->content = $content; - } - - return $this; - } - - /** - * Gets the version section of the tag. - * - * @return string The version section of the tag. - */ - public function getVersion() - { - return $this->version; - } - - /** - * Sets the version section of the tag. - * - * @param string $version The new version section of the tag. - * An invalid value will set an empty string. - * - * @return $this - */ - public function setVersion($version) - { - $this->version - = preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version) - ? $version - : ''; - - $this->content = null; - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Type; - -use phpDocumentor\Reflection\DocBlock\Context; - -/** - * Collection - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Collection extends \ArrayObject -{ - /** @var string Definition of the OR operator for types */ - const OPERATOR_OR = '|'; - - /** @var string Definition of the ARRAY operator for types */ - const OPERATOR_ARRAY = '[]'; - - /** @var string Definition of the NAMESPACE operator in PHP */ - const OPERATOR_NAMESPACE = '\\'; - - /** @var string[] List of recognized keywords */ - protected static $keywords = array( - 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double', - 'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar', - 'callback', 'callable', 'false', 'true', 'self', '$this', 'static' - ); - - /** - * Current invoking location. - * - * This is used to prepend to type with a relative location. - * May also be 'default' or 'global', in which case they are ignored. - * - * @var Context - */ - protected $context = null; - - /** - * Registers the namespace and aliases; uses that to add and expand the - * given types. - * - * @param string[] $types Array containing a list of types to add to this - * container. - * @param Context $location The current invoking location. - */ - public function __construct( - array $types = array(), - Context $context = null - ) { - $this->context = null === $context ? new Context() : $context; - - foreach ($types as $type) { - $this->add($type); - } - } - - /** - * Returns the current invoking location. - * - * @return Context - */ - public function getContext() - { - return $this->context; - } - - /** - * Adds a new type to the collection and expands it if it contains a - * relative namespace. - * - * If a class in the type contains a relative namespace than this collection - * will try to expand that into a FQCN. - * - * @param string $type A 'Type' as defined in the phpDocumentor - * documentation. - * - * @throws \InvalidArgumentException if a non-string argument is passed. - * - * @see http://phpdoc.org/docs/latest/for-users/types.html for the - * definition of a type. - * - * @return void - */ - public function add($type) - { - if (!is_string($type)) { - throw new \InvalidArgumentException( - 'A type should be represented by a string, received: ' - .var_export($type, true) - ); - } - - // separate the type by the OR operator - $type_parts = explode(self::OPERATOR_OR, $type); - foreach ($type_parts as $part) { - $expanded_type = $this->expand($part); - if ($expanded_type) { - $this[] = $expanded_type; - } - } - } - - /** - * Returns a string representation of the collection. - * - * @return string The resolved types across the collection, separated with - * {@link self::OPERATOR_OR}. - */ - public function __toString() - { - return implode(self::OPERATOR_OR, $this->getArrayCopy()); - } - - /** - * Analyzes the given type and returns the FQCN variant. - * - * When a type is provided this method checks whether it is not a keyword or - * Fully Qualified Class Name. If so it will use the given namespace and - * aliases to expand the type to a FQCN representation. - * - * This method only works as expected if the namespace and aliases are set; - * no dynamic reflection is being performed here. - * - * @param string $type The relative or absolute type. - * - * @uses getNamespace to determine with what to prefix the type name. - * @uses getNamespaceAliases to check whether the first part of the relative - * type name should not be replaced with another namespace. - * - * @return string - */ - protected function expand($type) - { - $type = trim($type); - if (!$type) { - return ''; - } - - if ($this->isTypeAnArray($type)) { - return $this->expand(substr($type, 0, -2)) . self::OPERATOR_ARRAY; - } - - if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) { - $type_parts = explode(self::OPERATOR_NAMESPACE, $type, 2); - - $namespace_aliases = $this->context->getNamespaceAliases(); - // if the first segment is not an alias; prepend namespace name and - // return - if (!isset($namespace_aliases[$type_parts[0]])) { - $namespace = $this->context->getNamespace(); - if ('' !== $namespace) { - $namespace .= self::OPERATOR_NAMESPACE; - } - return self::OPERATOR_NAMESPACE . $namespace . $type; - } - - $type_parts[0] = $namespace_aliases[$type_parts[0]]; - $type = implode(self::OPERATOR_NAMESPACE, $type_parts); - } - - return $type; - } - - /** - * Detects whether the given type represents an array. - * - * @param string $type A relative or absolute type as defined in the - * phpDocumentor documentation. - * - * @return bool - */ - protected function isTypeAnArray($type) - { - return substr($type, -2) === self::OPERATOR_ARRAY; - } - - /** - * Detects whether the given type represents a PHPDoc keyword. - * - * @param string $type A relative or absolute type as defined in the - * phpDocumentor documentation. - * - * @return bool - */ - protected function isTypeAKeyword($type) - { - return in_array(strtolower($type), static::$keywords, true); - } - - /** - * Detects whether the given type represents a relative or absolute path. - * - * This method will detect keywords as being absolute; even though they are - * not preceeded by a namespace separator. - * - * @param string $type A relative or absolute type as defined in the - * phpDocumentor documentation. - * - * @return bool - */ - protected function isRelativeType($type) - { - return ($type[0] !== self::OPERATOR_NAMESPACE) - || $this->isTypeAKeyword($type); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010 Mike van Riel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,182 @@ +TypeResolver and FqsenResolver +============================== + +The specification on types in DocBlocks (PSR-5) describes various keywords and special constructs +but also how to statically resolve the partial name of a Class into a Fully Qualified Class Name (FQCN). + +PSR-5 also introduces an additional way to describe deeper elements than Classes, Interfaces and Traits +called the Fully Qualified Structural Element Name (FQSEN). Using this it is possible to refer to methods, +properties and class constants but also functions and global constants. + +This package provides two Resolvers that are capable of + +1. Returning a series of Value Object for given expression while resolving any partial class names, and +2. Returning an FQSEN object after resolving any partial Structural Element Names into Fully Qualified Structural + Element names. + +## Installing + +The easiest way to install this library is with [Composer](https://getcomposer.org) using the following command: + + $ composer require phpdocumentor/type-resolver + +## Examples + +Ready to dive in and don't want to read through all that text below? Just consult the [examples](examples) folder and +check which type of action that your want to accomplish. + +## On Types and Element Names + +This component can be used in one of two ways + +1. To resolve a Type or +2. To resolve a Fully Qualified Structural Element Name + +The big difference between these two is in the number of things it can resolve. + +The TypeResolver can resolve: + +- a php primitive or pseudo-primitive such as a string or void (`@var string` or `@return void`). +- a composite such as an array of string (`@var string[]`). +- a compound such as a string or integer (`@var string|integer`). +- an object or interface such as the TypeResolver class (`@var TypeResolver` + or `@var \phpDocumentor\Reflection\TypeResolver`) + + > please note that if you want to pass partial class names that additional steps are necessary, see the + > chapter `Resolving partial classes and FQSENs` for more information. + +Where the FqsenResolver can resolve: + +- Constant expressions (i.e. `@see \MyNamespace\MY_CONSTANT`) +- Function expressions (i.e. `@see \MyNamespace\myFunction()`) +- Class expressions (i.e. `@see \MyNamespace\MyClass`) +- Interface expressions (i.e. `@see \MyNamespace\MyInterface`) +- Trait expressions (i.e. `@see \MyNamespace\MyTrait`) +- Class constant expressions (i.e. `@see \MyNamespace\MyClass::MY_CONSTANT`) +- Property expressions (i.e. `@see \MyNamespace\MyClass::$myProperty`) +- Method expressions (i.e. `@see \MyNamespace\MyClass::myMethod()`) + +## Resolving a type + +In order to resolve a type you will have to instantiate the class `\phpDocumentor\Reflection\TypeResolver` +and call its `resolve` method like this: + +```php +$typeResolver = new \phpDocumentor\Reflection\TypeResolver(); +$type = $typeResolver->resolve('string|integer'); +``` + +In this example you will receive a Value Object of class `\phpDocumentor\Reflection\Types\Compound` that has two +elements, one of type `\phpDocumentor\Reflection\Types\String_` and one of type +`\phpDocumentor\Reflection\Types\Integer`. + +The real power of this resolver is in its capability to expand partial class names into fully qualified class names; but +in order to do that we need an additional `\phpDocumentor\Reflection\Types\Context` class that will inform the resolver +in which namespace the given expression occurs and which namespace aliases (or imports) apply. + +## Resolving an FQSEN + +A Fully Qualified Structural Element Name is a reference to another element in your code bases and can be resolved using +the `\phpDocumentor\Reflection\FqsenResolver` class' `resolve` method, like this: + +```php +$fqsenResolver = new \phpDocumentor\Reflection\FqsenResolver(); +$fqsen = $fqsenResolver->resolve('\phpDocumentor\Reflection\FqsenResolver::resolve()'); +``` + +In this example we resolve a Fully Qualified Structural Element Name (meaning that it includes the full namespace, class +name and element name) and receive a Value Object of type `\phpDocumentor\Reflection\Fqsen`. + +The real power of this resolver is in its capability to expand partial element names into Fully Qualified Structural +Element Names; but in order to do that we need an additional `\phpDocumentor\Reflection\Types\Context` class that will +inform the resolver in which namespace the given expression occurs and which namespace aliases (or imports) apply. + +## Resolving partial Classes and Structural Element Names + +Perhaps the best feature of this library is that it knows how to resolve partial class names into fully qualified class +names. + +For example, you have this file: + +```php +namespace My\Example; + +use phpDocumentor\Reflection\Types; + +class Classy +{ + /** + * @var Types\Context + * @see Classy::otherFunction() + */ + public function __construct($context) {} + + public function otherFunction(){} +} +``` + +Suppose that you would want to resolve (and expand) the type in the `@var` tag and the element name in the `@see` tag. +For the resolvers to know how to expand partial names you have to provide a bit of _Context_ for them by instantiating +a new class named `\phpDocumentor\Reflection\Types\Context` with the name of the namespace and the aliases that are in +play. + +### Creating a Context + +You can do this by manually creating a Context like this: + +```php +$context = new \phpDocumentor\Reflection\Types\Context( + '\My\Example', + [ 'Types' => '\phpDocumentor\Reflection\Types'] +); +``` + +Or by using the `\phpDocumentor\Reflection\Types\ContextFactory` to instantiate a new context based on a Reflector +object or by providing the namespace that you'd like to extract and the source code of the file in which the given +type expression occurs. + +```php +$contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); +$context = $contextFactory->createFromReflector(new ReflectionMethod('\My\Example\Classy', '__construct')); +``` + +or + +```php +$contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); +$context = $contextFactory->createForNamespace('\My\Example', file_get_contents('My/Example/Classy.php')); +``` + +### Using the Context + +After you have obtained a Context it is just a matter of passing it along with the `resolve` method of either Resolver +class as second argument and the Resolvers will take this into account when resolving partial names. + +To obtain the resolved class name for the `@var` tag in the example above you can do: + +```php +$typeResolver = new \phpDocumentor\Reflection\TypeResolver(); +$type = $typeResolver->resolve('Types\Context', $context); +``` + +When you do this you will receive an object of class `\phpDocumentor\Reflection\Types\Object_` for which you can call +the `getFqsen` method to receive a Value Object that represents the complete FQSEN. So that would be +`phpDocumentor\Reflection\Types\Context`. + +> Why is the FQSEN wrapped in another object `Object_`? +> +> The resolve method of the TypeResolver only returns object with the interface `Type` and the FQSEN is a common +> type that does not represent a Type. Also: in some cases a type can represent an "Untyped Object", meaning that it +> is an object (signified by the `object` keyword) but does not refer to a specific element using an FQSEN. + +Another example is on how to resolve the FQSEN of a method as can be seen with the `@see` tag in the example above. To +resolve that you can do the following: + +```php +$fqsenResolver = new \phpDocumentor\Reflection\FqsenResolver(); +$type = $fqsenResolver->resolve('Classy::otherFunction()', $context); +``` + +Because Classy is a Class in the current namespace its FQSEN will have the `My\Example` namespace and by calling the +`resolve` method of the FQSEN Resolver you will receive an `Fqsen` object that refers to +`\My\Example\Classy::otherFunction()`. diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/composer.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,27 @@ +{ + "name": "phpdocumentor/type-resolver", + "type": "library", + "license": "MIT", + "authors": [ + {"name": "Mike van Riel", "email": "me@mikevanriel.com"} + ], + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "autoload": { + "psr-4": {"phpDocumentor\\Reflection\\": ["src/"]} + }, + "autoload-dev": { + "psr-4": {"phpDocumentor\\Reflection\\": ["tests/unit"]} + }, + "require-dev": { + "phpunit/phpunit": "^5.2||^4.8.24", + "mockery/mockery": "^0.9.4" + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/FqsenResolver.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,77 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\Types\Context; + +class FqsenResolver +{ + /** @var string Definition of the NAMESPACE operator in PHP */ + const OPERATOR_NAMESPACE = '\\'; + + public function resolve($fqsen, Context $context = null) + { + if ($context === null) { + $context = new Context(''); + } + + if ($this->isFqsen($fqsen)) { + return new Fqsen($fqsen); + } + + return $this->resolvePartialStructuralElementName($fqsen, $context); + } + + /** + * Tests whether the given type is a Fully Qualified Structural Element Name. + * + * @param string $type + * + * @return bool + */ + private function isFqsen($type) + { + return strpos($type, self::OPERATOR_NAMESPACE) === 0; + } + + /** + * Resolves a partial Structural Element Name (i.e. `Reflection\DocBlock`) to its FQSEN representation + * (i.e. `\phpDocumentor\Reflection\DocBlock`) based on the Namespace and aliases mentioned in the Context. + * + * @param string $type + * @param Context $context + * + * @return Fqsen + * @throws \InvalidArgumentException when type is not a valid FQSEN. + */ + private function resolvePartialStructuralElementName($type, Context $context) + { + $typeParts = explode(self::OPERATOR_NAMESPACE, $type, 2); + + $namespaceAliases = $context->getNamespaceAliases(); + + // if the first segment is not an alias; prepend namespace name and return + if (!isset($namespaceAliases[$typeParts[0]])) { + $namespace = $context->getNamespace(); + if ('' !== $namespace) { + $namespace .= self::OPERATOR_NAMESPACE; + } + + return new Fqsen(self::OPERATOR_NAMESPACE . $namespace . $type); + } + + $typeParts[0] = $namespaceAliases[$typeParts[0]]; + + return new Fqsen(self::OPERATOR_NAMESPACE . implode(self::OPERATOR_NAMESPACE, $typeParts)); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Type.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Type.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,18 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +interface Type +{ + public function __toString(); +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/TypeResolver.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/TypeResolver.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,298 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\Types\Array_; +use phpDocumentor\Reflection\Types\Compound; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Iterable_; +use phpDocumentor\Reflection\Types\Nullable; +use phpDocumentor\Reflection\Types\Object_; + +final class TypeResolver +{ + /** @var string Definition of the ARRAY operator for types */ + const OPERATOR_ARRAY = '[]'; + + /** @var string Definition of the NAMESPACE operator in PHP */ + const OPERATOR_NAMESPACE = '\\'; + + /** @var string[] List of recognized keywords and unto which Value Object they map */ + private $keywords = array( + 'string' => Types\String_::class, + 'int' => Types\Integer::class, + 'integer' => Types\Integer::class, + 'bool' => Types\Boolean::class, + 'boolean' => Types\Boolean::class, + 'float' => Types\Float_::class, + 'double' => Types\Float_::class, + 'object' => Object_::class, + 'mixed' => Types\Mixed_::class, + 'array' => Array_::class, + 'resource' => Types\Resource_::class, + 'void' => Types\Void_::class, + 'null' => Types\Null_::class, + 'scalar' => Types\Scalar::class, + 'callback' => Types\Callable_::class, + 'callable' => Types\Callable_::class, + 'false' => Types\Boolean::class, + 'true' => Types\Boolean::class, + 'self' => Types\Self_::class, + '$this' => Types\This::class, + 'static' => Types\Static_::class, + 'parent' => Types\Parent_::class, + 'iterable' => Iterable_::class, + ); + + /** @var FqsenResolver */ + private $fqsenResolver; + + /** + * Initializes this TypeResolver with the means to create and resolve Fqsen objects. + * + * @param FqsenResolver $fqsenResolver + */ + public function __construct(FqsenResolver $fqsenResolver = null) + { + $this->fqsenResolver = $fqsenResolver ?: new FqsenResolver(); + } + + /** + * Analyzes the given type and returns the FQCN variant. + * + * When a type is provided this method checks whether it is not a keyword or + * Fully Qualified Class Name. If so it will use the given namespace and + * aliases to expand the type to a FQCN representation. + * + * This method only works as expected if the namespace and aliases are set; + * no dynamic reflection is being performed here. + * + * @param string $type The relative or absolute type. + * @param Context $context + * + * @uses Context::getNamespace() to determine with what to prefix the type name. + * @uses Context::getNamespaceAliases() to check whether the first part of the relative type name should not be + * replaced with another namespace. + * + * @return Type|null + */ + public function resolve($type, Context $context = null) + { + if (!is_string($type)) { + throw new \InvalidArgumentException( + 'Attempted to resolve type but it appeared not to be a string, received: ' . var_export($type, true) + ); + } + + $type = trim($type); + if (!$type) { + throw new \InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty'); + } + + if ($context === null) { + $context = new Context(''); + } + + switch (true) { + case $this->isNullableType($type): + return $this->resolveNullableType($type, $context); + case $this->isKeyword($type): + return $this->resolveKeyword($type); + case ($this->isCompoundType($type)): + return $this->resolveCompoundType($type, $context); + case $this->isTypedArray($type): + return $this->resolveTypedArray($type, $context); + case $this->isFqsen($type): + return $this->resolveTypedObject($type); + case $this->isPartialStructuralElementName($type): + return $this->resolveTypedObject($type, $context); + // @codeCoverageIgnoreStart + default: + // I haven't got the foggiest how the logic would come here but added this as a defense. + throw new \RuntimeException( + 'Unable to resolve type "' . $type . '", there is no known method to resolve it' + ); + } + // @codeCoverageIgnoreEnd + } + + /** + * Adds a keyword to the list of Keywords and associates it with a specific Value Object. + * + * @param string $keyword + * @param string $typeClassName + * + * @return void + */ + public function addKeyword($keyword, $typeClassName) + { + if (!class_exists($typeClassName)) { + throw new \InvalidArgumentException( + 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' + . ' but we could not find the class ' . $typeClassName + ); + } + + if (!in_array(Type::class, class_implements($typeClassName))) { + throw new \InvalidArgumentException( + 'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"' + ); + } + + $this->keywords[$keyword] = $typeClassName; + } + + /** + * Detects whether the given type represents an array. + * + * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. + * + * @return bool + */ + private function isTypedArray($type) + { + return substr($type, -2) === self::OPERATOR_ARRAY; + } + + /** + * Detects whether the given type represents a PHPDoc keyword. + * + * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. + * + * @return bool + */ + private function isKeyword($type) + { + return in_array(strtolower($type), array_keys($this->keywords), true); + } + + /** + * Detects whether the given type represents a relative structural element name. + * + * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. + * + * @return bool + */ + private function isPartialStructuralElementName($type) + { + return ($type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type); + } + + /** + * Tests whether the given type is a Fully Qualified Structural Element Name. + * + * @param string $type + * + * @return bool + */ + private function isFqsen($type) + { + return strpos($type, self::OPERATOR_NAMESPACE) === 0; + } + + /** + * Tests whether the given type is a compound type (i.e. `string|int`). + * + * @param string $type + * + * @return bool + */ + private function isCompoundType($type) + { + return strpos($type, '|') !== false; + } + + /** + * Test whether the given type is a nullable type (i.e. `?string`) + * + * @param string $type + * + * @return bool + */ + private function isNullableType($type) + { + return $type[0] === '?'; + } + + /** + * Resolves the given typed array string (i.e. `string[]`) into an Array object with the right types set. + * + * @param string $type + * @param Context $context + * + * @return Array_ + */ + private function resolveTypedArray($type, Context $context) + { + return new Array_($this->resolve(substr($type, 0, -2), $context)); + } + + /** + * Resolves the given keyword (such as `string`) into a Type object representing that keyword. + * + * @param string $type + * + * @return Type + */ + private function resolveKeyword($type) + { + $className = $this->keywords[strtolower($type)]; + + return new $className(); + } + + /** + * Resolves the given FQSEN string into an FQSEN object. + * + * @param string $type + * @param Context|null $context + * + * @return Object_ + */ + private function resolveTypedObject($type, Context $context = null) + { + return new Object_($this->fqsenResolver->resolve($type, $context)); + } + + /** + * Resolves a compound type (i.e. `string|int`) into the appropriate Type objects or FQSEN. + * + * @param string $type + * @param Context $context + * + * @return Compound + */ + private function resolveCompoundType($type, Context $context) + { + $types = []; + + foreach (explode('|', $type) as $part) { + $types[] = $this->resolve($part, $context); + } + + return new Compound($types); + } + + /** + * Resolve nullable types (i.e. `?string`) into a Nullable type wrapper + * + * @param string $type + * @param Context $context + * + * @return Nullable + */ + private function resolveNullableType($type, Context $context) + { + return new Nullable($this->resolve(ltrim($type, '?'), $context)); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Array_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Array_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,86 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Represents an array type as described in the PSR-5, the PHPDoc Standard. + * + * An array can be represented in two forms: + * + * 1. Untyped (`array`), where the key and value type is unknown and hence classified as 'Mixed_'. + * 2. Types (`string[]`), where the value type is provided by preceding an opening and closing square bracket with a + * type name. + */ +final class Array_ implements Type +{ + /** @var Type */ + private $valueType; + + /** @var Type */ + private $keyType; + + /** + * Initializes this representation of an array with the given Type or Fqsen. + * + * @param Type $valueType + * @param Type $keyType + */ + public function __construct(Type $valueType = null, Type $keyType = null) + { + if ($keyType === null) { + $keyType = new Compound([ new String_(), new Integer() ]); + } + if ($valueType === null) { + $valueType = new Mixed_(); + } + + $this->valueType = $valueType; + $this->keyType = $keyType; + } + + /** + * Returns the type for the keys of this array. + * + * @return Type + */ + public function getKeyType() + { + return $this->keyType; + } + + /** + * Returns the value for the keys of this array. + * + * @return Type + */ + public function getValueType() + { + return $this->valueType; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + if ($this->valueType instanceof Mixed_) { + return 'array'; + } + + return $this->valueType . '[]'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Boolean.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Boolean.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a Boolean type. + */ +final class Boolean implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'bool'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Callable_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Callable_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a Callable type. + */ +final class Callable_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'callable'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Compound.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Compound.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,93 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use ArrayIterator; +use IteratorAggregate; +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a Compound Type. + * + * A Compound Type is not so much a special keyword or object reference but is a series of Types that are separated + * using an OR operator (`|`). This combination of types signifies that whatever is associated with this compound type + * may contain a value with any of the given types. + */ +final class Compound implements Type, IteratorAggregate +{ + /** @var Type[] */ + private $types; + + /** + * Initializes a compound type (i.e. `string|int`) and tests if the provided types all implement the Type interface. + * + * @param Type[] $types + * @throws \InvalidArgumentException when types are not all instance of Type + */ + public function __construct(array $types) + { + foreach ($types as $type) { + if (!$type instanceof Type) { + throw new \InvalidArgumentException('A compound type can only have other types as elements'); + } + } + + $this->types = $types; + } + + /** + * Returns the type at the given index. + * + * @param integer $index + * + * @return Type|null + */ + public function get($index) + { + if (!$this->has($index)) { + return null; + } + + return $this->types[$index]; + } + + /** + * Tests if this compound type has a type with the given index. + * + * @param integer $index + * + * @return bool + */ + public function has($index) + { + return isset($this->types[$index]); + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return implode('|', $this->types); + } + + /** + * {@inheritdoc} + */ + public function getIterator() + { + return new ArrayIterator($this->types); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Context.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Context.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,84 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +/** + * Provides information about the Context in which the DocBlock occurs that receives this context. + * + * A DocBlock does not know of its own accord in which namespace it occurs and which namespace aliases are applicable + * for the block of code in which it is in. This information is however necessary to resolve Class names in tags since + * you can provide a short form or make use of namespace aliases. + * + * The phpDocumentor Reflection component knows how to create this class but if you use the DocBlock parser from your + * own application it is possible to generate a Context class using the ContextFactory; this will analyze the file in + * which an associated class resides for its namespace and imports. + * + * @see ContextFactory::createFromClassReflector() + * @see ContextFactory::createForNamespace() + */ +final class Context +{ + /** @var string The current namespace. */ + private $namespace; + + /** @var array List of namespace aliases => Fully Qualified Namespace. */ + private $namespaceAliases; + + /** + * Initializes the new context and normalizes all passed namespaces to be in Qualified Namespace Name (QNN) + * format (without a preceding `\`). + * + * @param string $namespace The namespace where this DocBlock resides in. + * @param array $namespaceAliases List of namespace aliases => Fully Qualified Namespace. + */ + public function __construct($namespace, array $namespaceAliases = []) + { + $this->namespace = ('global' !== $namespace && 'default' !== $namespace) + ? trim((string)$namespace, '\\') + : ''; + + foreach ($namespaceAliases as $alias => $fqnn) { + if ($fqnn[0] === '\\') { + $fqnn = substr($fqnn, 1); + } + if ($fqnn[strlen($fqnn) - 1] === '\\') { + $fqnn = substr($fqnn, 0, -1); + } + + $namespaceAliases[$alias] = $fqnn; + } + + $this->namespaceAliases = $namespaceAliases; + } + + /** + * Returns the Qualified Namespace Name (thus without `\` in front) where the associated element is in. + * + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * Returns a list of Qualified Namespace Names (thus without `\` in front) that are imported, the keys represent + * the alias for the imported Namespace. + * + * @return string[] + */ + public function getNamespaceAliases() + { + return $this->namespaceAliases; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,210 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +/** + * Convenience class to create a Context for DocBlocks when not using the Reflection Component of phpDocumentor. + * + * For a DocBlock to be able to resolve types that use partial namespace names or rely on namespace imports we need to + * provide a bit of context so that the DocBlock can read that and based on it decide how to resolve the types to + * Fully Qualified names. + * + * @see Context for more information. + */ +final class ContextFactory +{ + /** The literal used at the end of a use statement. */ + const T_LITERAL_END_OF_USE = ';'; + + /** The literal used between sets of use statements */ + const T_LITERAL_USE_SEPARATOR = ','; + + /** + * Build a Context given a Class Reflection. + * + * @param \Reflector $reflector + * + * @see Context for more information on Contexts. + * + * @return Context + */ + public function createFromReflector(\Reflector $reflector) + { + if (method_exists($reflector, 'getDeclaringClass')) { + $reflector = $reflector->getDeclaringClass(); + } + + $fileName = $reflector->getFileName(); + $namespace = $reflector->getNamespaceName(); + + if (file_exists($fileName)) { + return $this->createForNamespace($namespace, file_get_contents($fileName)); + } + + return new Context($namespace, []); + } + + /** + * Build a Context for a namespace in the provided file contents. + * + * @param string $namespace It does not matter if a `\` precedes the namespace name, this method first normalizes. + * @param string $fileContents the file's contents to retrieve the aliases from with the given namespace. + * + * @see Context for more information on Contexts. + * + * @return Context + */ + public function createForNamespace($namespace, $fileContents) + { + $namespace = trim($namespace, '\\'); + $useStatements = []; + $currentNamespace = ''; + $tokens = new \ArrayIterator(token_get_all($fileContents)); + + while ($tokens->valid()) { + switch ($tokens->current()[0]) { + case T_NAMESPACE: + $currentNamespace = $this->parseNamespace($tokens); + break; + case T_CLASS: + // Fast-forward the iterator through the class so that any + // T_USE tokens found within are skipped - these are not + // valid namespace use statements so should be ignored. + $braceLevel = 0; + $firstBraceFound = false; + while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) { + if ($tokens->current() === '{' + || $tokens->current()[0] === T_CURLY_OPEN + || $tokens->current()[0] === T_DOLLAR_OPEN_CURLY_BRACES) { + if (!$firstBraceFound) { + $firstBraceFound = true; + } + $braceLevel++; + } + + if ($tokens->current() === '}') { + $braceLevel--; + } + $tokens->next(); + } + break; + case T_USE: + if ($currentNamespace === $namespace) { + $useStatements = array_merge($useStatements, $this->parseUseStatement($tokens)); + } + break; + } + $tokens->next(); + } + + return new Context($namespace, $useStatements); + } + + /** + * Deduce the name from tokens when we are at the T_NAMESPACE token. + * + * @param \ArrayIterator $tokens + * + * @return string + */ + private function parseNamespace(\ArrayIterator $tokens) + { + // skip to the first string or namespace separator + $this->skipToNextStringOrNamespaceSeparator($tokens); + + $name = ''; + while ($tokens->valid() && ($tokens->current()[0] === T_STRING || $tokens->current()[0] === T_NS_SEPARATOR) + ) { + $name .= $tokens->current()[1]; + $tokens->next(); + } + + return $name; + } + + /** + * Deduce the names of all imports when we are at the T_USE token. + * + * @param \ArrayIterator $tokens + * + * @return string[] + */ + private function parseUseStatement(\ArrayIterator $tokens) + { + $uses = []; + $continue = true; + + while ($continue) { + $this->skipToNextStringOrNamespaceSeparator($tokens); + + list($alias, $fqnn) = $this->extractUseStatement($tokens); + $uses[$alias] = $fqnn; + if ($tokens->current()[0] === self::T_LITERAL_END_OF_USE) { + $continue = false; + } + } + + return $uses; + } + + /** + * Fast-forwards the iterator as longs as we don't encounter a T_STRING or T_NS_SEPARATOR token. + * + * @param \ArrayIterator $tokens + * + * @return void + */ + private function skipToNextStringOrNamespaceSeparator(\ArrayIterator $tokens) + { + while ($tokens->valid() && ($tokens->current()[0] !== T_STRING) && ($tokens->current()[0] !== T_NS_SEPARATOR)) { + $tokens->next(); + } + } + + /** + * Deduce the namespace name and alias of an import when we are at the T_USE token or have not reached the end of + * a USE statement yet. + * + * @param \ArrayIterator $tokens + * + * @return string + */ + private function extractUseStatement(\ArrayIterator $tokens) + { + $result = ['']; + while ($tokens->valid() + && ($tokens->current()[0] !== self::T_LITERAL_USE_SEPARATOR) + && ($tokens->current()[0] !== self::T_LITERAL_END_OF_USE) + ) { + if ($tokens->current()[0] === T_AS) { + $result[] = ''; + } + if ($tokens->current()[0] === T_STRING || $tokens->current()[0] === T_NS_SEPARATOR) { + $result[count($result) - 1] .= $tokens->current()[1]; + } + $tokens->next(); + } + + if (count($result) == 1) { + $backslashPos = strrpos($result[0], '\\'); + + if (false !== $backslashPos) { + $result[] = substr($result[0], $backslashPos + 1); + } else { + $result[] = $result[0]; + } + } + + return array_reverse($result); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Float_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a Float. + */ +final class Float_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'float'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Integer.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Integer.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,28 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +final class Integer implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'int'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing iterable type + */ +final class Iterable_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'iterable'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing an unknown, or mixed, type. + */ +final class Mixed_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'mixed'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Null_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Null_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a null value or type. + */ +final class Null_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'null'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Nullable.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Nullable.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,56 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a nullable type. The real type is wrapped. + */ +final class Nullable implements Type +{ + /** + * @var Type + */ + private $realType; + + /** + * Initialises this nullable type using the real type embedded + * + * @param Type $realType + */ + public function __construct(Type $realType) + { + $this->realType = $realType; + } + + /** + * Provide access to the actual type directly, if needed. + * + * @return Type + */ + public function getActualType() + { + return $this->realType; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return '?' . $this->realType->__toString(); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Object_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,71 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing an object. + * + * An object can be either typed or untyped. When an object is typed it means that it has an identifier, the FQSEN, + * pointing to an element in PHP. Object types that are untyped do not refer to a specific class but represent objects + * in general. + */ +final class Object_ implements Type +{ + /** @var Fqsen|null */ + private $fqsen; + + /** + * Initializes this object with an optional FQSEN, if not provided this object is considered 'untyped'. + * + * @param Fqsen $fqsen + * @throws \InvalidArgumentException when provided $fqsen is not a valid type. + */ + public function __construct(Fqsen $fqsen = null) + { + if (strpos((string)$fqsen, '::') !== false || strpos((string)$fqsen, '()') !== false) { + throw new \InvalidArgumentException( + 'Object types can only refer to a class, interface or trait but a method, function, constant or ' + . 'property was received: ' . (string)$fqsen + ); + } + + $this->fqsen = $fqsen; + } + + /** + * Returns the FQSEN associated with this object. + * + * @return Fqsen|null + */ + public function getFqsen() + { + return $this->fqsen; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + if ($this->fqsen) { + return (string)$this->fqsen; + } + + return 'object'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Parent_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,33 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'parent' type. + * + * Parent, as a Type, represents the parent class of class in which the associated element was defined. + */ +final class Parent_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'parent'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Resource_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'resource' Type. + */ +final class Resource_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'resource'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Scalar.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'scalar' pseudo-type, which is either a string, integer, float or boolean. + */ +final class Scalar implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'scalar'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Self_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Self_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,33 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'self' type. + * + * Self, as a Type, represents the class in which the associated element was defined. + */ +final class Self_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'self'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Static_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Static_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,38 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'static' type. + * + * Self, as a Type, represents the class in which the associated element was called. This differs from self as self does + * not take inheritance into account but static means that the return type is always that of the class of the called + * element. + * + * See the documentation on late static binding in the PHP Documentation for more information on the difference between + * static and self. + */ +final class Static_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'static'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/String_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/String_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the type 'string'. + */ +final class String_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'string'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/This.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/This.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,34 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the '$this' pseudo-type. + * + * $this, as a Type, represents the instance of the class associated with the element as it was called. $this is + * commonly used when documenting fluent interfaces since it represents that the same object is returned. + */ +final class This implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return '$this'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpdocumentor/type-resolver/src/Types/Void_.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpdocumentor/type-resolver/src/Types/Void_.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,34 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the pseudo-type 'void'. + * + * Void is generally only used when working with return types as it signifies that the method intentionally does not + * return any value. + */ +final class Void_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'void'; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/.gitignore --- a/vendor/phpspec/prophecy/.gitignore Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -*.tgz -*.phar -/composer.lock -/vendor -/phpunit.xml diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/.travis.yml --- a/vendor/phpspec/prophecy/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -language: php - -sudo: false - -cache: - directories: - - $HOME/.composer/cache - -branches: - except: - - /^bugfix\/.*$/ - - /^feature\/.*$/ - - /^optimization\/.*$/ - -matrix: - include: - - php: 5.3 - - php: 5.4 - - php: 5.5 - - php: 5.6 - env: DEPENDENCIES='low' - - php: 5.6 - - php: 7.0 - - php: 7.1 - # Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version - - php: hhvm - sudo: required - dist: trusty - group: edge - fast_finish: true - -install: - - export COMPOSER_ROOT_VERSION=dev-master - - if [ "$DEPENDENCIES" != "low" ]; then composer update; fi; - - if [ "$DEPENDENCIES" == "low" ]; then composer update --prefer-lowest; fi; - -script: - - vendor/bin/phpspec run -fpretty -v - - vendor/bin/phpunit diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/CHANGES.md --- a/vendor/phpspec/prophecy/CHANGES.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/CHANGES.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,3 +1,16 @@ +1.7.2 / 2017-10-04 +================== + +* Reverted "check method predictions only once" due to it breaking Spies + +1.7.1 / 2017-10-03 +================== + +* Allow PHP5 keywords methods generation on PHP7 (thanks @bycosta) +* Allow reflection-docblock v4 (thanks @GrahamCampbell) +* Check method predictions only once (thanks @dontub) +* Escape file path sent to \SplFileObjectConstructor when running on Windows (thanks @danmartin-epiphany) + 1.7.0 / 2017-03-02 ================== diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/CONTRIBUTING.md --- a/vendor/phpspec/prophecy/CONTRIBUTING.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -Contributing ------------- - -Prophecy is an open source, community-driven project. If you'd like to contribute, -feel free to do this, but remember to follow these few simple rules: - -- Make your feature addition or bug fix, -- Add either specs or examples for any changes you're making (bugfixes or additions) - (please look into `spec/` folder for some examples). This is important so we don't break - it in a future version unintentionally, -- Commit your code, but do not mess with `CHANGES.md`, - -Running tests -------------- - -Make sure that you don't break anything with your changes by running: - -```bash -$> composer install --prefer-dist -$> vendor/bin/phpspec run -$> vendor/bin/phpunit -``` diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/README.md --- a/vendor/phpspec/prophecy/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -159,7 +159,7 @@ - `ReturnPromise` or `->willReturn(1)` - returns a value from a method call - `ReturnArgumentPromise` or `->willReturnArgument($index)` - returns the nth method argument from call -- `ThrowPromise` or `->willThrow` - causes the method to throw specific exception +- `ThrowPromise` or `->willThrow($exception)` - causes the method to throw specific exception - `CallbackPromise` or `->will($callback)` - gives you a quick way to define your own custom logic Keep in mind, that you can always add even more promises by implementing diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/composer.json --- a/vendor/phpspec/prophecy/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -19,7 +19,7 @@ "require": { "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "doctrine/instantiator": "^1.0.2", "sebastian/recursion-context": "^1.0|^2.0|^3.0" @@ -27,7 +27,7 @@ "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" }, "autoload": { @@ -44,7 +44,7 @@ "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/fixtures/EmptyClass.php --- a/vendor/phpspec/prophecy/fixtures/EmptyClass.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - - - - tests - - - - - - ./src/ - - - diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -beConstructedWith(array(42, 'zet', $object)); - - $class = get_class($object->getWrappedObject()); - $hash = spl_object_hash($object->getWrappedObject()); - - $this->__toString()->shouldReturn("exact(42), exact(\"zet\"), exact($class:$hash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))"); - } - - function it_generates_string_representation_from_all_tokens_imploded( - TokenInterface $token1, - TokenInterface $token2, - TokenInterface $token3 - ) { - $token1->__toString()->willReturn('token_1'); - $token2->__toString()->willReturn('token_2'); - $token3->__toString()->willReturn('token_3'); - - $this->beConstructedWith(array($token1, $token2, $token3)); - $this->__toString()->shouldReturn('token_1, token_2, token_3'); - } - - function it_exposes_list_of_tokens(TokenInterface $token) - { - $this->beConstructedWith(array($token)); - - $this->getTokens()->shouldReturn(array($token)); - } - - function it_returns_score_of_1_if_there_are_no_tokens_and_arguments() - { - $this->beConstructedWith(array()); - - $this->scoreArguments(array())->shouldReturn(1); - } - - function it_should_return_match_score_based_on_all_tokens_score( - TokenInterface $token1, - TokenInterface $token2, - TokenInterface $token3 - ) { - $token1->scoreArgument('one')->willReturn(3); - $token1->isLast()->willReturn(false); - $token2->scoreArgument(2)->willReturn(5); - $token2->isLast()->willReturn(false); - $token3->scoreArgument($obj = new \stdClass())->willReturn(10); - $token3->isLast()->willReturn(false); - - $this->beConstructedWith(array($token1, $token2, $token3)); - $this->scoreArguments(array('one', 2, $obj))->shouldReturn(18); - } - - function it_returns_false_if_there_is_less_arguments_than_tokens( - TokenInterface $token1, - TokenInterface $token2, - TokenInterface $token3 - ) { - $token1->scoreArgument('one')->willReturn(3); - $token1->isLast()->willReturn(false); - $token2->scoreArgument(2)->willReturn(5); - $token2->isLast()->willReturn(false); - $token3->scoreArgument(null)->willReturn(false); - $token3->isLast()->willReturn(false); - - $this->beConstructedWith(array($token1, $token2, $token3)); - $this->scoreArguments(array('one', 2))->shouldReturn(false); - } - - function it_returns_false_if_there_is_less_tokens_than_arguments( - TokenInterface $token1, - TokenInterface $token2, - TokenInterface $token3 - ) { - $token1->scoreArgument('one')->willReturn(3); - $token1->isLast()->willReturn(false); - $token2->scoreArgument(2)->willReturn(5); - $token2->isLast()->willReturn(false); - $token3->scoreArgument($obj = new \stdClass())->willReturn(10); - $token3->isLast()->willReturn(false); - - $this->beConstructedWith(array($token1, $token2, $token3)); - $this->scoreArguments(array('one', 2, $obj, 4))->shouldReturn(false); - } - - function it_should_return_false_if_one_of_the_tokens_returns_false( - TokenInterface $token1, - TokenInterface $token2, - TokenInterface $token3 - ) { - $token1->scoreArgument('one')->willReturn(3); - $token1->isLast()->willReturn(false); - $token2->scoreArgument(2)->willReturn(false); - $token2->isLast()->willReturn(false); - $token3->scoreArgument($obj = new \stdClass())->willReturn(10); - $token3->isLast()->willReturn(false); - - $this->beConstructedWith(array($token1, $token2, $token3)); - $this->scoreArguments(array('one', 2, $obj))->shouldReturn(false); - } - - function it_should_calculate_score_until_last_token( - TokenInterface $token1, - TokenInterface $token2, - TokenInterface $token3 - ) { - $token1->scoreArgument('one')->willReturn(3); - $token1->isLast()->willReturn(false); - - $token2->scoreArgument(2)->willReturn(7); - $token2->isLast()->willReturn(true); - - $token3->scoreArgument($obj = new \stdClass())->willReturn(10); - $token3->isLast()->willReturn(false); - - $this->beConstructedWith(array($token1, $token2, $token3)); - $this->scoreArguments(array('one', 2, $obj))->shouldReturn(10); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function its_string_representation_is_star() - { - $this->__toString()->shouldReturn('*'); - } - - function it_scores_any_argument_as_3() - { - $this->scoreArgument(42)->shouldReturn(3); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_last() - { - $this->shouldBeLast(); - } - - function its_string_representation_is_star_with_followup() - { - $this->__toString()->shouldReturn('* [, ...]'); - } - - function it_scores_any_argument_as_2() - { - $this->scoreArgument(42)->shouldReturn(2); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ApproximateValueTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ApproximateValueTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -beConstructedWith(10.12345678, 4); - } - - function it_is_initializable() - { - $this->shouldHaveType('Prophecy\Argument\Token\ApproximateValueToken'); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_scores_10_if_rounded_argument_matches_rounded_value() - { - $this->scoreArgument(10.12345)->shouldReturn(10); - } - - function it_does_not_score_if_rounded_argument_does_not_match_rounded_value() - { - $this->scoreArgument(10.1234)->shouldReturn(false); - } - - function it_uses_a_default_precision_of_zero() - { - $this->beConstructedWith(10.7); - $this->scoreArgument(11.4)->shouldReturn(10); - } - - function it_does_not_score_if_rounded_argument_is_not_numeric() - { - $this->scoreArgument('hello')->shouldReturn(false); - } - - function it_has_simple_string_representation() - { - $this->__toString()->shouldBe('≅10.1235'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -beConstructedWith(2); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_scores_6_if_argument_array_has_proper_count() - { - $this->scoreArgument(array(1,2))->shouldReturn(6); - } - - function it_scores_6_if_argument_countable_object_has_proper_count(\Countable $countable) - { - $countable->count()->willReturn(2); - $this->scoreArgument($countable)->shouldReturn(6); - } - - function it_does_not_score_if_argument_is_neither_array_nor_countable_object() - { - $this->scoreArgument('string')->shouldBe(false); - $this->scoreArgument(5)->shouldBe(false); - $this->scoreArgument(new \stdClass)->shouldBe(false); - } - - function it_does_not_score_if_argument_array_has_wrong_count() - { - $this->scoreArgument(array(1))->shouldReturn(false); - } - - function it_does_not_score_if_argument_countable_object_has_wrong_count(\Countable $countable) - { - $countable->count()->willReturn(3); - $this->scoreArgument($countable)->shouldReturn(false); - } - - function it_has_simple_string_representation() - { - $this->__toString()->shouldBe('count(2)'); - } - -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -beConstructedWith($key, $value); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_holds_key_and_value($key, $value) - { - $this->getKey()->shouldBe($key); - $this->getValue()->shouldBe($value); - } - - function its_string_representation_tells_that_its_an_array_containing_the_key_value_pair($key, $value) - { - $key->__toString()->willReturn('key'); - $value->__toString()->willReturn('value'); - $this->__toString()->shouldBe('[..., key => value, ...]'); - } - - function it_wraps_non_token_value_into_ExactValueToken(TokenInterface $key, \stdClass $object) - { - $this->beConstructedWith($key, $object); - $this->getValue()->shouldHaveType('\Prophecy\Argument\Token\ExactValueToken'); - } - - function it_wraps_non_token_key_into_ExactValueToken(\stdClass $object, TokenInterface $value) - { - $this->beConstructedWith($object, $value); - $this->getKey()->shouldHaveType('\Prophecy\Argument\Token\ExactValueToken'); - } - - function it_scores_array_half_of_combined_scores_from_key_and_value_tokens($key, $value) - { - $key->scoreArgument('key')->willReturn(4); - $value->scoreArgument('value')->willReturn(6); - $this->scoreArgument(array('key'=>'value'))->shouldBe(5); - } - - function it_scores_traversable_object_half_of_combined_scores_from_key_and_value_tokens( - TokenInterface $key, - TokenInterface $value, - \Iterator $object - ) { - $object->current()->will(function () use ($object) { - $object->valid()->willReturn(false); - - return 'value'; - }); - $object->key()->willReturn('key'); - $object->rewind()->willReturn(null); - $object->next()->willReturn(null); - $object->valid()->willReturn(true); - $key->scoreArgument('key')->willReturn(6); - $value->scoreArgument('value')->willReturn(2); - $this->scoreArgument($object)->shouldBe(4); - } - - function it_throws_exception_during_scoring_of_array_accessible_object_if_key_is_not_ExactValueToken( - TokenInterface $key, - TokenInterface $value, - \ArrayAccess $object - ) { - $key->__toString()->willReturn('any_token'); - $this->beConstructedWith($key,$value); - $errorMessage = 'You can only use exact value tokens to match key of ArrayAccess object'.PHP_EOL. - 'But you used `any_token`.'; - $this->shouldThrow(new InvalidArgumentException($errorMessage))->duringScoreArgument($object); - } - - function it_scores_array_accessible_object_half_of_combined_scores_from_key_and_value_tokens( - ExactValueToken $key, - TokenInterface $value, - \ArrayAccess $object - ) { - $object->offsetExists('key')->willReturn(true); - $object->offsetGet('key')->willReturn('value'); - $key->getValue()->willReturn('key'); - $key->scoreArgument('key')->willReturn(3); - $value->scoreArgument('value')->willReturn(1); - $this->scoreArgument($object)->shouldBe(2); - } - - function it_accepts_any_key_token_type_to_score_object_that_is_both_traversable_and_array_accessible( - TokenInterface $key, - TokenInterface $value, - \ArrayIterator $object - ) { - $this->beConstructedWith($key, $value); - $object->current()->will(function () use ($object) { - $object->valid()->willReturn(false); - - return 'value'; - }); - $object->key()->willReturn('key'); - $object->rewind()->willReturn(null); - $object->next()->willReturn(null); - $object->valid()->willReturn(true); - $this->shouldNotThrow(new InvalidArgumentException)->duringScoreArgument($object); - } - - function it_does_not_score_if_argument_is_neither_array_nor_traversable_nor_array_accessible() - { - $this->scoreArgument('string')->shouldBe(false); - $this->scoreArgument(new \stdClass)->shouldBe(false); - } - - function it_does_not_score_empty_array() - { - $this->scoreArgument(array())->shouldBe(false); - } - - function it_does_not_score_array_if_key_and_value_tokens_do_not_score_same_entry($key, $value) - { - $argument = array(1 => 'foo', 2 => 'bar'); - $key->scoreArgument(1)->willReturn(true); - $key->scoreArgument(2)->willReturn(false); - $value->scoreArgument('foo')->willReturn(false); - $value->scoreArgument('bar')->willReturn(true); - $this->scoreArgument($argument)->shouldBe(false); - } - - function it_does_not_score_traversable_object_without_entries(\Iterator $object) - { - $object->rewind()->willReturn(null); - $object->next()->willReturn(null); - $object->valid()->willReturn(false); - $this->scoreArgument($object)->shouldBe(false); - } - - function it_does_not_score_traversable_object_if_key_and_value_tokens_do_not_score_same_entry( - TokenInterface $key, - TokenInterface $value, - \Iterator $object - ) { - $object->current()->willReturn('foo'); - $object->current()->will(function () use ($object) { - $object->valid()->willReturn(false); - - return 'bar'; - }); - $object->key()->willReturn(1); - $object->key()->willReturn(2); - $object->rewind()->willReturn(null); - $object->next()->willReturn(null); - $object->valid()->willReturn(true); - $key->scoreArgument(1)->willReturn(true); - $key->scoreArgument(2)->willReturn(false); - $value->scoreArgument('foo')->willReturn(false); - $value->scoreArgument('bar')->willReturn(true); - $this->scoreArgument($object)->shouldBe(false); - } - - function it_does_not_score_array_accessible_object_if_it_has_no_offset_with_key_token_value( - ExactValueToken $key, - \ArrayAccess $object - ) { - $object->offsetExists('key')->willReturn(false); - $key->getValue()->willReturn('key'); - $this->scoreArgument($object)->shouldBe(false); - } - - function it_does_not_score_array_accessible_object_if_key_and_value_tokens_do_not_score_same_entry( - ExactValueToken $key, - TokenInterface $value, - \ArrayAccess $object - ) { - $object->offsetExists('key')->willReturn(true); - $object->offsetGet('key')->willReturn('value'); - $key->getValue()->willReturn('key'); - $value->scoreArgument('value')->willReturn(false); - $key->scoreArgument('key')->willReturn(true); - $this->scoreArgument($object)->shouldBe(false); - } - - function its_score_is_capped_at_8($key, $value) - { - $key->scoreArgument('key')->willReturn(10); - $value->scoreArgument('value')->willReturn(10); - $this->scoreArgument(array('key'=>'value'))->shouldBe(8); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -beConstructedWith($value); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_holds_value($value) - { - $this->getValue()->shouldBe($value); - } - - function its_string_representation_tells_that_its_an_array_containing_only_value($value) - { - $value->__toString()->willReturn('value'); - $this->__toString()->shouldBe('[value, ..., value]'); - } - - function it_wraps_non_token_value_into_ExactValueToken(\stdClass $stdClass) - { - $this->beConstructedWith($stdClass); - $this->getValue()->shouldHaveType('Prophecy\Argument\Token\ExactValueToken'); - } - - function it_does_not_score_if_argument_is_neither_array_nor_traversable() - { - $this->scoreArgument('string')->shouldBe(false); - $this->scoreArgument(new \stdClass)->shouldBe(false); - } - - function it_does_not_score_empty_array() - { - $this->scoreArgument(array())->shouldBe(false); - } - - function it_does_not_score_traversable_object_without_entries(\Iterator $object) - { - $object->rewind()->willReturn(null); - $object->next()->willReturn(null); - $object->valid()->willReturn(false); - $this->scoreArgument($object)->shouldBe(false); - } - - function it_scores_avg_of_scores_from_value_tokens($value) - { - $value->scoreArgument('value1')->willReturn(6); - $value->scoreArgument('value2')->willReturn(3); - $this->scoreArgument(array('value1', 'value2'))->shouldBe(4.5); - } - - function it_scores_false_if_entry_scores_false($value) - { - $value->scoreArgument('value1')->willReturn(6); - $value->scoreArgument('value2')->willReturn(false); - $this->scoreArgument(array('value1', 'value2'))->shouldBe(false); - } - - function it_does_not_score_array_keys($value) - { - $value->scoreArgument('value')->willReturn(6); - $value->scoreArgument('key')->shouldNotBeCalled(0); - $this->scoreArgument(array('key' => 'value'))->shouldBe(6); - } - - function it_scores_traversable_object_from_value_token(TokenInterface $value, \Iterator $object) - { - $object->current()->will(function ($args, $object) { - $object->valid()->willReturn(false); - - return 'value'; - }); - $object->key()->willReturn('key'); - $object->rewind()->willReturn(null); - $object->next()->willReturn(null); - $object->valid()->willReturn(true); - $value->scoreArgument('value')->willReturn(2); - $this->scoreArgument($object)->shouldBe(2); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -beConstructedWith('get_class'); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_scores_7_if_argument_matches_callback() - { - $this->beConstructedWith(function ($argument) { return 2 === $argument; }); - - $this->scoreArgument(2)->shouldReturn(7); - } - - function it_does_not_scores_if_argument_does_not_match_callback() - { - $this->beConstructedWith(function ($argument) { return 2 === $argument; }); - - $this->scoreArgument(5)->shouldReturn(false); - } - - function its_string_representation_should_tell_that_its_callback() - { - $this->__toString()->shouldReturn('callback()'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -beConstructedWith(42); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_holds_value() - { - $this->getValue()->shouldReturn(42); - } - - function it_scores_10_if_value_is_equal_to_argument() - { - $this->scoreArgument(42)->shouldReturn(10); - $this->scoreArgument('42')->shouldReturn(10); - } - - function it_scores_10_if_value_is_an_object_and_equal_to_argument() - { - $value = new \DateTime(); - $value2 = clone $value; - - $this->beConstructedWith($value); - $this->scoreArgument($value2)->shouldReturn(10); - } - - function it_does_not_scores_if_value_is_not_equal_to_argument() - { - $this->scoreArgument(50)->shouldReturn(false); - $this->scoreArgument(new \stdClass())->shouldReturn(false); - } - - function it_does_not_scores_if_value_an_object_and_is_not_equal_to_argument() - { - $value = new ExactValueTokenFixtureB('ABC'); - $value2 = new ExactValueTokenFixtureB('CBA'); - - $this->beConstructedWith($value); - $this->scoreArgument($value2)->shouldReturn(false); - } - - function it_does_not_scores_if_value_type_and_is_not_equal_to_argument() - { - $this->beConstructedWith(false); - $this->scoreArgument(0)->shouldReturn(false); - } - - function it_generates_proper_string_representation_for_integer() - { - $this->beConstructedWith(42); - $this->__toString()->shouldReturn('exact(42)'); - } - - function it_generates_proper_string_representation_for_string() - { - $this->beConstructedWith('some string'); - $this->__toString()->shouldReturn('exact("some string")'); - } - - function it_generates_single_line_representation_for_multiline_string() - { - $this->beConstructedWith("some\nstring"); - $this->__toString()->shouldReturn('exact("some\\nstring")'); - } - - function it_generates_proper_string_representation_for_double() - { - $this->beConstructedWith(42.3); - $this->__toString()->shouldReturn('exact(42.3)'); - } - - function it_generates_proper_string_representation_for_boolean_true() - { - $this->beConstructedWith(true); - $this->__toString()->shouldReturn('exact(true)'); - } - - function it_generates_proper_string_representation_for_boolean_false() - { - $this->beConstructedWith(false); - $this->__toString()->shouldReturn('exact(false)'); - } - - function it_generates_proper_string_representation_for_null() - { - $this->beConstructedWith(null); - $this->__toString()->shouldReturn('exact(null)'); - } - - function it_generates_proper_string_representation_for_empty_array() - { - $this->beConstructedWith(array()); - $this->__toString()->shouldReturn('exact([])'); - } - - function it_generates_proper_string_representation_for_array() - { - $this->beConstructedWith(array('zet', 42)); - $this->__toString()->shouldReturn('exact(["zet", 42])'); - } - - function it_generates_proper_string_representation_for_resource() - { - $resource = fopen(__FILE__, 'r'); - $this->beConstructedWith($resource); - $this->__toString()->shouldReturn('exact(stream:'.$resource.')'); - } - - function it_generates_proper_string_representation_for_object(\stdClass $object) - { - $objHash = sprintf('%s:%s', - get_class($object->getWrappedObject()), - spl_object_hash($object->getWrappedObject()) - ); - - $this->beConstructedWith($object); - $this->__toString()->shouldReturn("exact($objHash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))"); - } -} - -class ExactValueTokenFixtureA -{ - public $errors; -} - -class ExactValueTokenFixtureB extends ExactValueTokenFixtureA -{ - public $errors; - public $value = null; - - public function __construct($value) - { - $this->value = $value; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -beConstructedWith(42); - } - - function it_is_initializable() - { - $this->shouldHaveType('Prophecy\Argument\Token\IdenticalValueToken'); - } - - function it_scores_11_if_string_value_is_identical_to_argument() - { - $this->beConstructedWith('foo'); - $this->scoreArgument('foo')->shouldReturn(11); - } - - function it_scores_11_if_boolean_value_is_identical_to_argument() - { - $this->beConstructedWith(false); - $this->scoreArgument(false)->shouldReturn(11); - } - - function it_scores_11_if_integer_value_is_identical_to_argument() - { - $this->beConstructedWith(31); - $this->scoreArgument(31)->shouldReturn(11); - } - - function it_scores_11_if_float_value_is_identical_to_argument() - { - $this->beConstructedWith(31.12); - $this->scoreArgument(31.12)->shouldReturn(11); - } - - function it_scores_11_if_array_value_is_identical_to_argument() - { - $this->beConstructedWith(array('foo' => 'bar')); - $this->scoreArgument(array('foo' => 'bar'))->shouldReturn(11); - } - - function it_scores_11_if_object_value_is_identical_to_argument() - { - $object = new \stdClass(); - - $this->beConstructedWith($object); - $this->scoreArgument($object)->shouldReturn(11); - } - - function it_scores_false_if_value_is_not_identical_to_argument() - { - $this->beConstructedWith(new \stdClass()); - $this->scoreArgument('foo')->shouldReturn(false); - } - - function it_scores_false_if_object_value_is_not_the_same_instance_than_argument() - { - $this->beConstructedWith(new \stdClass()); - $this->scoreArgument(new \stdClass())->shouldReturn(false); - } - - function it_scores_false_if_integer_value_is_not_identical_to_boolean_argument() - { - $this->beConstructedWith(1); - $this->scoreArgument(true)->shouldReturn(false); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_generates_proper_string_representation_for_integer() - { - $this->beConstructedWith(42); - $this->__toString()->shouldReturn('identical(42)'); - } - - function it_generates_proper_string_representation_for_string() - { - $this->beConstructedWith('some string'); - $this->__toString()->shouldReturn('identical("some string")'); - } - - function it_generates_single_line_representation_for_multiline_string() - { - $this->beConstructedWith("some\nstring"); - $this->__toString()->shouldReturn('identical("some\\nstring")'); - } - - function it_generates_proper_string_representation_for_double() - { - $this->beConstructedWith(42.3); - $this->__toString()->shouldReturn('identical(42.3)'); - } - - function it_generates_proper_string_representation_for_boolean_true() - { - $this->beConstructedWith(true); - $this->__toString()->shouldReturn('identical(true)'); - } - - function it_generates_proper_string_representation_for_boolean_false() - { - $this->beConstructedWith(false); - $this->__toString()->shouldReturn('identical(false)'); - } - - function it_generates_proper_string_representation_for_null() - { - $this->beConstructedWith(null); - $this->__toString()->shouldReturn('identical(null)'); - } - - function it_generates_proper_string_representation_for_empty_array() - { - $this->beConstructedWith(array()); - $this->__toString()->shouldReturn('identical([])'); - } - - function it_generates_proper_string_representation_for_array() - { - $this->beConstructedWith(array('zet', 42)); - $this->__toString()->shouldReturn('identical(["zet", 42])'); - } - - function it_generates_proper_string_representation_for_resource() - { - $resource = fopen(__FILE__, 'r'); - $this->beConstructedWith($resource); - $this->__toString()->shouldReturn('identical(stream:'.$resource.')'); - } - - function it_generates_proper_string_representation_for_object($object) - { - $objHash = sprintf('%s:%s', - get_class($object->getWrappedObject()), - spl_object_hash($object->getWrappedObject()) - ); - - $this->beConstructedWith($object); - $this->__toString()->shouldReturn("identical($objHash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))"); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -beConstructedWith(array()); - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->beConstructedWith(array()); - $this->shouldNotBeLast(); - } - - function it_generates_string_representation_from_all_tokens_imploded( - TokenInterface $token1, - TokenInterface $token2, - TokenInterface $token3 - ) { - $token1->__toString()->willReturn('token_1'); - $token2->__toString()->willReturn('token_2'); - $token3->__toString()->willReturn('token_3'); - - $this->beConstructedWith(array($token1, $token2, $token3)); - $this->__toString()->shouldReturn('bool(token_1 AND token_2 AND token_3)'); - } - - function it_wraps_non_token_arguments_into_ExactValueToken() - { - $this->beConstructedWith(array(15, '1985')); - $this->__toString()->shouldReturn("bool(exact(15) AND exact(\"1985\"))"); - } - - function it_scores_the_maximum_score_from_all_scores_returned_by_tokens(TokenInterface $token1, TokenInterface $token2) - { - $token1->scoreArgument(1)->willReturn(10); - $token2->scoreArgument(1)->willReturn(5); - $this->beConstructedWith(array($token1, $token2)); - $this->scoreArgument(1)->shouldReturn(10); - } - - function it_does_not_score_if_there_are_no_arguments_or_tokens() - { - $this->beConstructedWith(array()); - $this->scoreArgument('any')->shouldReturn(false); - } - - function it_does_not_score_if_either_of_tokens_does_not_score(TokenInterface $token1, TokenInterface $token2) - { - $token1->scoreArgument(1)->willReturn(10); - $token1->scoreArgument(2)->willReturn(false); - - $token2->scoreArgument(1)->willReturn(false); - $token2->scoreArgument(2)->willReturn(10); - - $this->beConstructedWith(array($token1, $token2)); - - $this->scoreArgument(1)->shouldReturn(false); - $this->scoreArgument(2)->shouldReturn(false); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -beConstructedWith($token); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_holds_originating_token($token) - { - $this->getOriginatingToken()->shouldReturn($token); - } - - function it_has_simple_string_representation($token) - { - $token->__toString()->willReturn('value'); - $this->__toString()->shouldBe('not(value)'); - } - - function it_wraps_non_token_argument_into_ExactValueToken() - { - $this->beConstructedWith(5); - $token = $this->getOriginatingToken(); - $token->shouldhaveType('Prophecy\Argument\Token\ExactValueToken'); - $token->getValue()->shouldBe(5); - } - - function it_scores_4_if_preset_token_does_not_match_the_argument($token) - { - $token->scoreArgument('argument')->willReturn(false); - $this->scoreArgument('argument')->shouldBe(4); - } - - function it_does_not_score_if_preset_token_matches_argument($token) - { - $token->scoreArgument('argument')->willReturn(5); - $this->scoreArgument('argument')->shouldBe(false); - } - - function it_is_last_if_preset_token_is_last($token) - { - $token->isLast()->willReturn(true); - $this->shouldBeLast(); - } - - function it_is_not_last_if_preset_token_is_not_last($token) - { - $token->isLast()->willReturn(false); - $this->shouldNotBeLast(); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -beConstructedWith('getName', 'stdClass'); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_scores_8_if_argument_object_has_specific_method_state(\ReflectionClass $reflection) - { - $reflection->getName()->willReturn('stdClass'); - - $this->scoreArgument($reflection)->shouldReturn(8); - } - - function it_scores_8_if_argument_object_has_specific_property_state(\stdClass $class) - { - $class->getName = 'stdClass'; - - $this->scoreArgument($class)->shouldReturn(8); - } - - function it_does_not_score_if_argument_method_state_does_not_match() - { - $value = new ObjectStateTokenFixtureB('ABC'); - $value2 = new ObjectStateTokenFixtureB('CBA'); - - $this->beConstructedWith('getSelf', $value); - $this->scoreArgument($value2)->shouldReturn(false); - } - - function it_does_not_score_if_argument_property_state_does_not_match(\stdClass $class) - { - $class->getName = 'SplFileInfo'; - - $this->scoreArgument($class)->shouldReturn(false); - } - - function it_does_not_score_if_argument_object_does_not_have_method_or_property(ObjectStateTokenFixtureA $class) - { - $this->scoreArgument($class)->shouldReturn(false); - } - - function it_does_not_score_if_argument_is_not_object() - { - $this->scoreArgument(42)->shouldReturn(false); - } - - function it_has_simple_string_representation() - { - $this->__toString()->shouldReturn('state(getName(), "stdClass")'); - } -} - -class ObjectStateTokenFixtureA -{ - public $errors; -} - -class ObjectStateTokenFixtureB extends ObjectStateTokenFixtureA -{ - public $errors; - public $value = null; - - public function __construct($value) - { - $this->value = $value; - } - - public function getSelf() - { - return $this; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -beConstructedWith('a substring'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Prophecy\Argument\Token\StringContainsToken'); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_holds_value() - { - $this->getValue()->shouldReturn('a substring'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_scores_6_if_the_argument_contains_the_value() - { - $this->scoreArgument('Argument containing a substring')->shouldReturn(6); - } - - function it_does_not_score_if_the_argument_does_not_contain_the_value() - { - $this->scoreArgument('Argument will not match')->shouldReturn(false); - } - - function its_string_representation_shows_substring() - { - $this->__toString()->shouldReturn('contains("a substring")'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -beConstructedWith('integer'); - } - - function it_implements_TokenInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface'); - } - - function it_is_not_last() - { - $this->shouldNotBeLast(); - } - - function it_scores_5_if_argument_matches_simple_type() - { - $this->beConstructedWith('integer'); - - $this->scoreArgument(42)->shouldReturn(5); - } - - function it_does_not_scores_if_argument_does_not_match_simple_type() - { - $this->beConstructedWith('integer'); - - $this->scoreArgument(42.0)->shouldReturn(false); - } - - function it_scores_5_if_argument_is_an_instance_of_specified_class(\ReflectionObject $object) - { - $this->beConstructedWith('ReflectionClass'); - - $this->scoreArgument($object)->shouldReturn(5); - } - - function it_has_simple_string_representation() - { - $this->__toString()->shouldReturn('type(integer)'); - } - - function it_scores_5_if_argument_is_an_instance_of_specified_interface(TokenInterface $interface) - { - $this->beConstructedWith('Prophecy\Argument\Token\TokenInterface'); - - $this->scoreArgument($interface)->shouldReturn(5); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -exact(42); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ExactValueToken'); - $token->getValue()->shouldReturn(42); - } - - function it_has_a_shortcut_for_any_argument_token() - { - $token = $this->any(); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\AnyValueToken'); - } - - function it_has_a_shortcut_for_multiple_arguments_token() - { - $token = $this->cetera(); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\AnyValuesToken'); - } - - function it_has_a_shortcut_for_type_token() - { - $token = $this->type('integer'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\TypeToken'); - } - - function it_has_a_shortcut_for_callback_token() - { - $token = $this->that('get_class'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\CallbackToken'); - } - - function it_has_a_shortcut_for_object_state_token() - { - $token = $this->which('getName', 'everzet'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ObjectStateToken'); - } - - function it_has_a_shortcut_for_logical_and_token() - { - $token = $this->allOf('integer', 5); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\LogicalAndToken'); - } - - function it_has_a_shortcut_for_array_count_token() - { - $token = $this->size(5); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayCountToken'); - } - - function it_has_a_shortcut_for_array_entry_token() - { - $token = $this->withEntry('key', 'value'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken'); - } - - function it_has_a_shortcut_for_array_every_entry_token() - { - $token = $this->withEveryEntry('value'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEveryEntryToken'); - } - - function it_has_a_shortcut_for_identical_value_token() - { - $token = $this->is('value'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\IdenticalValueToken'); - } - - function it_has_a_shortcut_for_array_entry_token_matching_any_key() - { - $token = $this->containing('value'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken'); - $token->getKey()->shouldHaveType('Prophecy\Argument\Token\AnyValueToken'); - } - - function it_has_a_shortcut_for_array_entry_token_matching_any_value() - { - $token = $this->withKey('key'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken'); - $token->getValue()->shouldHaveType('Prophecy\Argument\Token\AnyValueToken'); - } - - function it_has_a_shortcut_for_logical_not_token() - { - $token = $this->not('kagux'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\LogicalNotToken'); - } - - function it_has_a_shortcut_for_string_contains_token() - { - $token = $this->containingString('string'); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\StringContainsToken'); - } - - function it_has_a_shortcut_for_approximate_token() - { - $token = $this->approximate(10); - $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ApproximateValueToken'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -scoreArguments(array(5, 2, 3))->willReturn(10); - $objectProphecy->getMethodProphecies()->willReturn(array()); - - $this->makeCall($objectProphecy, 'setValues', array(5, 2, 3)); - - $calls = $this->findCalls('setValues', $wildcard); - $calls->shouldHaveCount(1); - - $calls[0]->shouldBeAnInstanceOf('Prophecy\Call\Call'); - $calls[0]->getMethodName()->shouldReturn('setValues'); - $calls[0]->getArguments()->shouldReturn(array(5, 2, 3)); - $calls[0]->getReturnValue()->shouldReturn(null); - } - - function it_returns_null_for_any_call_through_makeCall_if_no_method_prophecies_added( - $objectProphecy - ) - { - $objectProphecy->getMethodProphecies()->willReturn(array()); - - $this->makeCall($objectProphecy, 'setValues', array(5, 2, 3))->shouldReturn(null); - } - - function it_executes_promise_of_method_prophecy_that_matches_signature_passed_to_makeCall( - $objectProphecy, - MethodProphecy $method1, - MethodProphecy $method2, - MethodProphecy $method3, - ArgumentsWildcard $arguments1, - ArgumentsWildcard $arguments2, - ArgumentsWildcard $arguments3, - PromiseInterface $promise - ) { - $method1->hasReturnVoid()->willReturn(false); - $method1->getMethodName()->willReturn('getName'); - $method1->getArgumentsWildcard()->willReturn($arguments1); - $arguments1->scoreArguments(array('world', 'everything'))->willReturn(false); - - $method2->hasReturnVoid()->willReturn(false); - $method2->getMethodName()->willReturn('setTitle'); - $method2->getArgumentsWildcard()->willReturn($arguments2); - $arguments2->scoreArguments(array('world', 'everything'))->willReturn(false); - - $method3->hasReturnVoid()->willReturn(false); - $method3->getMethodName()->willReturn('getName'); - $method3->getArgumentsWildcard()->willReturn($arguments3); - $method3->getPromise()->willReturn($promise); - $arguments3->scoreArguments(array('world', 'everything'))->willReturn(200); - - $objectProphecy->getMethodProphecies()->willReturn(array( - 'method1' => array($method1), - 'method2' => array($method2, $method3) - )); - $objectProphecy->getMethodProphecies('getName')->willReturn(array($method1, $method3)); - $objectProphecy->reveal()->willReturn(new \stdClass()); - - $promise->execute(array('world', 'everything'), $objectProphecy->getWrappedObject(), $method3)->willReturn(42); - - $this->makeCall($objectProphecy, 'getName', array('world', 'everything'))->shouldReturn(42); - - $calls = $this->findCalls('getName', $arguments3); - $calls->shouldHaveCount(1); - $calls[0]->getReturnValue()->shouldReturn(42); - } - - function it_executes_promise_of_method_prophecy_that_matches_with_highest_score_to_makeCall( - $objectProphecy, - MethodProphecy $method1, - MethodProphecy $method2, - MethodProphecy $method3, - ArgumentsWildcard $arguments1, - ArgumentsWildcard $arguments2, - ArgumentsWildcard $arguments3, - PromiseInterface $promise - ) { - $method1->hasReturnVoid()->willReturn(false); - $method1->getMethodName()->willReturn('getName'); - $method1->getArgumentsWildcard()->willReturn($arguments1); - $arguments1->scoreArguments(array('world', 'everything'))->willReturn(50); - - $method2->hasReturnVoid()->willReturn(false); - $method2->getMethodName()->willReturn('getName'); - $method2->getArgumentsWildcard()->willReturn($arguments2); - $method2->getPromise()->willReturn($promise); - $arguments2->scoreArguments(array('world', 'everything'))->willReturn(300); - - $method3->hasReturnVoid()->willReturn(false); - $method3->getMethodName()->willReturn('getName'); - $method3->getArgumentsWildcard()->willReturn($arguments3); - $arguments3->scoreArguments(array('world', 'everything'))->willReturn(200); - - $objectProphecy->getMethodProphecies()->willReturn(array( - 'method1' => array($method1), - 'method2' => array($method2, $method3) - )); - $objectProphecy->getMethodProphecies('getName')->willReturn(array( - $method1, $method2, $method3 - )); - $objectProphecy->reveal()->willReturn(new \stdClass()); - - $promise->execute(array('world', 'everything'), $objectProphecy->getWrappedObject(), $method2) - ->willReturn('second'); - - $this->makeCall($objectProphecy, 'getName', array('world', 'everything')) - ->shouldReturn('second'); - } - - function it_throws_exception_if_call_does_not_match_any_of_defined_method_prophecies( - $objectProphecy, - MethodProphecy $method, - ArgumentsWildcard $arguments - ) { - $method->getMethodName()->willReturn('getName'); - $method->getArgumentsWildcard()->willReturn($arguments); - $arguments->scoreArguments(array('world', 'everything'))->willReturn(false); - $arguments->__toString()->willReturn('arg1, arg2'); - - $objectProphecy->getMethodProphecies()->willReturn(array('method1' => array($method))); - $objectProphecy->getMethodProphecies('getName')->willReturn(array($method)); - - $this->shouldThrow('Prophecy\Exception\Call\UnexpectedCallException') - ->duringMakeCall($objectProphecy, 'getName', array('world', 'everything')); - } - - function it_returns_null_if_method_prophecy_that_matches_makeCall_arguments_has_no_promise( - $objectProphecy, - MethodProphecy $method, - ArgumentsWildcard $arguments - ) { - $method->hasReturnVoid()->willReturn(false); - $method->getMethodName()->willReturn('getName'); - $method->getArgumentsWildcard()->willReturn($arguments); - $method->getPromise()->willReturn(null); - $arguments->scoreArguments(array('world', 'everything'))->willReturn(100); - - $objectProphecy->getMethodProphecies()->willReturn(array($method)); - $objectProphecy->getMethodProphecies('getName')->willReturn(array($method)); - - $this->makeCall($objectProphecy, 'getName', array('world', 'everything')) - ->shouldReturn(null); - } - - function it_finds_recorded_calls_by_a_method_name_and_arguments_wildcard( - $objectProphecy, - ArgumentsWildcard $wildcard - ) { - $objectProphecy->getMethodProphecies()->willReturn(array()); - - $this->makeCall($objectProphecy, 'getName', array('world')); - $this->makeCall($objectProphecy, 'getName', array('everything')); - $this->makeCall($objectProphecy, 'setName', array(42)); - - $wildcard->scoreArguments(array('world'))->willReturn(false); - $wildcard->scoreArguments(array('everything'))->willReturn(10); - - $calls = $this->findCalls('getName', $wildcard); - - $calls->shouldHaveCount(1); - $calls[0]->getMethodName()->shouldReturn('getName'); - $calls[0]->getArguments()->shouldReturn(array('everything')); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -beConstructedWith('setValues', array(5, 2), 42, $exception, 'some_file.php', 23); - } - - function it_exposes_method_name_through_getter() - { - $this->getMethodName()->shouldReturn('setValues'); - } - - function it_exposes_arguments_through_getter() - { - $this->getArguments()->shouldReturn(array(5, 2)); - } - - function it_exposes_return_value_through_getter() - { - $this->getReturnValue()->shouldReturn(42); - } - - function it_exposes_exception_through_getter($exception) - { - $this->getException()->shouldReturn($exception); - } - - function it_exposes_file_and_line_through_getter() - { - $this->getFile()->shouldReturn('some_file.php'); - $this->getLine()->shouldReturn(23); - } - - function it_returns_shortpath_to_callPlace() - { - $this->getCallPlace()->shouldReturn('some_file.php:23'); - } - - function it_returns_unknown_as_callPlace_if_no_file_or_line_provided() - { - $this->beConstructedWith('setValues', array(), 0, null, null, null); - - $this->getCallPlace()->shouldReturn('unknown'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Comparator/ClosureComparatorSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Comparator/ClosureComparatorSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -shouldHaveType('SebastianBergmann\Comparator\Comparator'); - } - - function it_accepts_only_closures() - { - $this->accepts(123, 321)->shouldReturn(false); - $this->accepts('string', 'string')->shouldReturn(false); - $this->accepts(false, true)->shouldReturn(false); - $this->accepts(true, false)->shouldReturn(false); - $this->accepts((object)array(), (object)array())->shouldReturn(false); - $this->accepts(function(){}, (object)array())->shouldReturn(false); - $this->accepts(function(){}, (object)array())->shouldReturn(false); - - $this->accepts(function(){}, function(){})->shouldReturn(true); - } - - function it_asserts_that_all_closures_are_different() - { - $this->shouldThrow()->duringAssertEquals(function(){}, function(){}); - } - - function it_asserts_that_all_closures_are_different_even_if_its_the_same_closure() - { - $closure = function(){}; - - $this->shouldThrow()->duringAssertEquals($closure, $closure); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Comparator/FactorySpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Comparator/FactorySpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -shouldHaveType('SebastianBergmann\Comparator\Factory'); - } - - function it_should_have_ClosureComparator_registered() - { - $comparator = $this->getInstance()->getComparatorFor(function(){}, function(){}); - $comparator->shouldHaveType('Prophecy\Comparator\ClosureComparator'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Comparator/ProphecyComparatorSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Comparator/ProphecyComparatorSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -shouldHaveType('SebastianBergmann\Comparator\ObjectComparator'); - } - - function it_accepts_only_prophecy_objects() - { - $this->accepts(123, 321)->shouldReturn(false); - $this->accepts('string', 'string')->shouldReturn(false); - $this->accepts(false, true)->shouldReturn(false); - $this->accepts(true, false)->shouldReturn(false); - $this->accepts((object)array(), (object)array())->shouldReturn(false); - $this->accepts(function(){}, (object)array())->shouldReturn(false); - $this->accepts(function(){}, function(){})->shouldReturn(false); - - $prophet = new Prophet(); - $prophecy = $prophet->prophesize('Prophecy\Prophecy\ObjectProphecy'); - - $this->accepts($prophecy, $prophecy)->shouldReturn(true); - } - - function it_asserts_that_an_object_is_equal_to_its_revealed_prophecy() - { - $prophet = new Prophet(); - $prophecy = $prophet->prophesize('Prophecy\Prophecy\ObjectProphecy'); - - $this->shouldNotThrow()->duringAssertEquals($prophecy->reveal(), $prophecy); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); - } - - function its_priority_is_100() - { - $this->getPriority()->shouldReturn(100); - } - - function it_supports_anything(ClassNode $node) - { - $this->supports($node)->shouldReturn(true); - } - - function it_makes_all_constructor_arguments_optional( - ClassNode $class, - MethodNode $method, - ArgumentNode $arg1, - ArgumentNode $arg2 - ) { - $class->hasMethod('__construct')->willReturn(true); - $class->getMethod('__construct')->willReturn($method); - $method->getArguments()->willReturn(array($arg1, $arg2)); - - $arg1->setDefault(null)->shouldBeCalled(); - $arg2->setDefault(null)->shouldBeCalled(); - - $method->setCode(Argument::type('string'))->shouldBeCalled(); - - $this->apply($class); - } - - function it_creates_new_constructor_if_object_has_none(ClassNode $class) - { - $class->hasMethod('__construct')->willReturn(false); - $class->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode')) - ->shouldBeCalled(); - - $this->apply($class); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); - } - - function its_priority_is_minus_50() - { - $this->getPriority()->shouldReturn(-50); - } - - function it_uses_parent_code_for_setTraceOptions(ClassNode $node, MethodNode $method, MethodNode $getterMethod) - { - $node->hasMethod('setTraceOptions')->willReturn(true); - $node->getMethod('setTraceOptions')->willReturn($method); - $node->hasMethod('getTraceOptions')->willReturn(true); - $node->getMethod('getTraceOptions')->willReturn($getterMethod); - - $method->useParentCode()->shouldBeCalled(); - $getterMethod->useParentCode()->shouldBeCalled(); - - $this->apply($node); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); - } - - function its_priority_is_49() - { - $this->getPriority()->shouldReturn(49); - } - - function it_will_remove_echo_and_eval_methods( - ClassNode $node, - MethodNode $method1, - MethodNode $method2, - MethodNode $method3 - ) { - $node->removeMethod('eval')->shouldBeCalled(); - $node->removeMethod('echo')->shouldBeCalled(); - - $method1->getName()->willReturn('echo'); - $method2->getName()->willReturn('eval'); - $method3->getName()->willReturn('notKeyword'); - - $node->getMethods()->willReturn(array( - 'echo' => $method1, - 'eval' => $method2, - 'notKeyword' => $method3, - )); - - $this->apply($node); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); - } - - function it_supports_anything(ClassNode $node) - { - $this->supports($node)->shouldReturn(true); - } - - function it_discovers_api_using_phpdoc(ClassNode $node) - { - $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApi'); - $node->getInterfaces()->willReturn(array()); - - $node->addMethod(new MethodNode('undefinedMethod'))->shouldBeCalled(); - - $this->apply($node); - } - - function it_ignores_existing_methods(ClassNode $node) - { - $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiExtended'); - $node->getInterfaces()->willReturn(array()); - - $node->addMethod(new MethodNode('undefinedMethod'))->shouldBeCalled(); - $node->addMethod(new MethodNode('definedMethod'))->shouldNotBeCalled(); - - $this->apply($node); - } - - function it_ignores_empty_methods_from_phpdoc(ClassNode $node) - { - $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiInvalidMethodDefinition'); - $node->getInterfaces()->willReturn(array()); - - $node->addMethod(new MethodNode(''))->shouldNotBeCalled(); - - $this->apply($node); - } - - function it_discovers_api_using_phpdoc_from_implemented_interfaces(ClassNode $node) - { - $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplemented'); - $node->getInterfaces()->willReturn(array()); - - $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled(); - - $this->apply($node); - } - - function it_discovers_api_using_phpdoc_from_own_interfaces(ClassNode $node) - { - $node->getParentClass()->willReturn('stdClass'); - $node->getInterfaces()->willReturn(array('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplemented')); - - $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled(); - - $this->apply($node); - } - - function it_discovers_api_using_phpdoc_from_extended_parent_interfaces(ClassNode $node) - { - $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplementedExtended'); - $node->getInterfaces()->willReturn(array()); - - $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled(); - - $this->apply($node); - } - - function it_has_50_priority() - { - $this->getPriority()->shouldReturn(50); - } -} - -/** - * @method void undefinedMethod() - */ -class MagicalApi -{ - /** - * @return void - */ - public function definedMethod() - { - - } -} - -/** - * @method void invalidMethodDefinition - * @method void - * @method - */ -class MagicalApiInvalidMethodDefinition -{ -} - -/** - * @method void undefinedMethod() - * @method void definedMethod() - */ -class MagicalApiExtended extends MagicalApi -{ - -} - -/** - */ -class MagicalApiImplemented implements MagicalApiInterface -{ - -} - -/** - */ -class MagicalApiImplementedExtended extends MagicalApiImplemented -{ -} - -/** - * @method void implementedMethod() - */ -interface MagicalApiInterface -{ - -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); - } - - function it_has_priority_of_0() - { - $this->getPriority()->shouldReturn(0); - } - - function it_supports_any_class(ClassNode $node) - { - $this->supports($node)->shouldReturn(true); - } - - function it_forces_class_to_implement_ProphecySubjectInterface(ClassNode $node) - { - $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface')->shouldBeCalled(); - - $node->addProperty('objectProphecy', 'private')->willReturn(null); - $node->getMethods()->willReturn(array()); - $node->hasMethod(Argument::any())->willReturn(false); - $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null); - $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null); - - $this->apply($node); - } - - function it_forces_all_class_methods_except_constructor_to_proxy_calls_into_prophecy_makeCall( - ClassNode $node, - MethodNode $constructor, - MethodNode $method1, - MethodNode $method2, - MethodNode $method3 - ) { - $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface')->willReturn(null); - $node->addProperty('objectProphecy', 'private')->willReturn(null); - $node->hasMethod(Argument::any())->willReturn(false); - $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null); - $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null); - - $constructor->getName()->willReturn('__construct'); - $method1->getName()->willReturn('method1'); - $method2->getName()->willReturn('method2'); - $method3->getName()->willReturn('method3'); - - $method1->getReturnType()->willReturn('int'); - $method2->getReturnType()->willReturn('int'); - $method3->getReturnType()->willReturn('void'); - - $node->getMethods()->willReturn(array( - 'method1' => $method1, - 'method2' => $method2, - 'method3' => $method3, - )); - - $constructor->setCode(Argument::any())->shouldNotBeCalled(); - - $method1->setCode('return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());') - ->shouldBeCalled(); - $method2->setCode('return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());') - ->shouldBeCalled(); - $method3->setCode('$this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());') - ->shouldBeCalled(); - - $this->apply($node); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); - } - - function its_priority_is_50() - { - $this->getPriority()->shouldReturn(50); - } - - function it_supports_ReflectionClass_only(ClassNode $reflectionClassNode, ClassNode $anotherClassNode) - { - $reflectionClassNode->getParentClass()->willReturn('ReflectionClass'); - $anotherClassNode->getParentClass()->willReturn('stdClass'); - - $this->supports($reflectionClassNode)->shouldReturn(true); - $this->supports($anotherClassNode)->shouldReturn(false); - } - - function it_makes_all_newInstance_arguments_optional( - ClassNode $class, - MethodNode $method, - ArgumentNode $arg1 - ) { - $class->getMethod('newInstance')->willReturn($method); - $method->getArguments()->willReturn(array($arg1)); - $arg1->setDefault(null)->shouldBeCalled(); - - $this->apply($class); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); - } - - function its_priority_is_50() - { - $this->getPriority()->shouldReturn(50); - } - - function it_does_not_support_nodes_without_parent_class(ClassNode $node) - { - $node->getParentClass()->willReturn('stdClass'); - $this->supports($node)->shouldReturn(false); - } - - function it_supports_nodes_with_SplFileInfo_as_parent_class(ClassNode $node) - { - $node->getParentClass()->willReturn('SplFileInfo'); - $this->supports($node)->shouldReturn(true); - } - - function it_supports_nodes_with_derivative_of_SplFileInfo_as_parent_class(ClassNode $node) - { - $node->getParentClass()->willReturn('SplFileInfo'); - $this->supports($node)->shouldReturn(true); - } - - function it_adds_a_method_to_node_if_not_exists(ClassNode $node) - { - $node->hasMethod('__construct')->willReturn(false); - $node->addMethod(Argument::any())->shouldBeCalled(); - $node->getParentClass()->shouldBeCalled(); - - $this->apply($node); - } - - function it_updates_existing_method_if_found(ClassNode $node, MethodNode $method) - { - $node->hasMethod('__construct')->willReturn(true); - $node->getMethod('__construct')->willReturn($method); - $node->getParentClass()->shouldBeCalled(); - - $method->useParentCode()->shouldBeCalled(); - - $this->apply($node); - } - - function it_should_not_supply_a_file_for_a_directory_iterator(ClassNode $node, MethodNode $method) - { - $node->hasMethod('__construct')->willReturn(true); - $node->getMethod('__construct')->willReturn($method); - $node->getParentClass()->willReturn('DirectoryIterator'); - - $method->setCode(Argument::that(function($value) { - return strpos($value, '.php') === false; - }))->shouldBeCalled(); - - $this->apply($node); - } - - function it_should_supply_a_file_for_a_spl_file_object(ClassNode $node, MethodNode $method) - { - $node->hasMethod('__construct')->willReturn(true); - $node->getMethod('__construct')->willReturn($method); - $node->getParentClass()->willReturn('SplFileObject'); - - $method->setCode(Argument::that(function($value) { - return strpos($value, '.php') !== false; - }))->shouldBeCalled(); - - $this->apply($node); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); - } - - function it_supports_class_that_implements_only_Traversable(ClassNode $node) - { - $node->getInterfaces()->willReturn(array('Traversable')); - - $this->supports($node)->shouldReturn(true); - } - - function it_does_not_support_class_that_implements_Iterator(ClassNode $node) - { - $node->getInterfaces()->willReturn(array('Traversable', 'Iterator')); - - $this->supports($node)->shouldReturn(false); - } - - function it_does_not_support_class_that_implements_IteratorAggregate(ClassNode $node) - { - $node->getInterfaces()->willReturn(array('Traversable', 'IteratorAggregate')); - - $this->supports($node)->shouldReturn(false); - } - - function it_has_100_priority() - { - $this->getPriority()->shouldReturn(100); - } - - function it_forces_node_to_implement_IteratorAggregate(ClassNode $node) - { - $node->addInterface('Iterator')->shouldBeCalled(); - - $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null); - - $this->apply($node); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -beConstructedWith($mirror, $creator, $namer); - } - - function it_does_not_have_patches_by_default() - { - $this->getClassPatches()->shouldHaveCount(0); - } - - function its_registerClassPatch_adds_a_patch_to_the_doubler(ClassPatchInterface $patch) - { - $this->registerClassPatch($patch); - $this->getClassPatches()->shouldReturn(array($patch)); - } - - function its_getClassPatches_sorts_patches_by_priority( - ClassPatchInterface $alt1, - ClassPatchInterface $alt2, - ClassPatchInterface $alt3, - ClassPatchInterface $alt4 - ) { - $alt1->getPriority()->willReturn(2); - $alt2->getPriority()->willReturn(50); - $alt3->getPriority()->willReturn(10); - $alt4->getPriority()->willReturn(0); - - $this->registerClassPatch($alt1); - $this->registerClassPatch($alt2); - $this->registerClassPatch($alt3); - $this->registerClassPatch($alt4); - - $this->getClassPatches()->shouldReturn(array($alt2, $alt3, $alt1, $alt4)); - } - - function its_double_mirrors_alterates_and_instantiates_provided_class( - $mirror, - $creator, - $namer, - ClassPatchInterface $alt1, - ClassPatchInterface $alt2, - \ReflectionClass $class, - \ReflectionClass $interface1, - \ReflectionClass $interface2, - ClassNode $node - ) { - $mirror->reflect($class, array($interface1, $interface2))->willReturn($node); - $alt1->supports($node)->willReturn(true); - $alt2->supports($node)->willReturn(false); - $alt1->getPriority()->willReturn(1); - $alt2->getPriority()->willReturn(2); - $namer->name($class, array($interface1, $interface2))->willReturn('SplStack'); - $class->getName()->willReturn('stdClass'); - $interface1->getName()->willReturn('ArrayAccess'); - $interface2->getName()->willReturn('Iterator'); - - $alt1->apply($node)->shouldBeCalled(); - $alt2->apply($node)->shouldNotBeCalled(); - $creator->create('SplStack', $node)->shouldBeCalled(); - - $this->registerClassPatch($alt1); - $this->registerClassPatch($alt2); - - $this->double($class, array($interface1, $interface2)) - ->shouldReturnAnInstanceOf('SplStack'); - } - - function it_double_instantiates_a_class_with_constructor_argument( - $mirror, - \ReflectionClass $class, - ClassNode $node, - $namer - ) { - $class->getName()->willReturn('ReflectionClass'); - $mirror->reflect($class, array())->willReturn($node); - $namer->name($class, array())->willReturn('ReflectionClass'); - - $double = $this->double($class, array(), array('stdClass')); - $double->shouldBeAnInstanceOf('ReflectionClass'); - $double->getName()->shouldReturn('stdClass'); - } - - function it_can_instantiate_class_with_final_constructor( - $mirror, - \ReflectionClass $class, - ClassNode $node, - $namer - ) { - $class->getName()->willReturn('spec\Prophecy\Doubler\WithFinalConstructor'); - $mirror->reflect($class, array())->willReturn($node); - $namer->name($class, array())->willReturn('spec\Prophecy\Doubler\WithFinalConstructor'); - - $double = $this->double($class, array()); - - $double->shouldBeAnInstanceOf('spec\Prophecy\Doubler\WithFinalConstructor'); - } -} - -class WithFinalConstructor -{ - final public function __construct() {} -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,362 +0,0 @@ -getParentClass()->willReturn('RuntimeException'); - $class->getInterfaces()->willReturn(array( - 'Prophecy\Doubler\Generator\MirroredInterface', 'ArrayAccess', 'ArrayIterator' - )); - $class->getProperties()->willReturn(array('name' => 'public', 'email' => 'private')); - $class->getMethods()->willReturn(array($method1, $method2, $method3, $method4)); - - $method1->getName()->willReturn('getName'); - $method1->getVisibility()->willReturn('public'); - $method1->returnsReference()->willReturn(false); - $method1->isStatic()->willReturn(true); - $method1->getArguments()->willReturn(array($argument11, $argument12)); - $method1->hasReturnType()->willReturn(true); - $method1->getReturnType()->willReturn('string'); - $method1->hasNullableReturnType()->willReturn(true); - $method1->getCode()->willReturn('return $this->name;'); - - $method2->getName()->willReturn('getEmail'); - $method2->getVisibility()->willReturn('protected'); - $method2->returnsReference()->willReturn(false); - $method2->isStatic()->willReturn(false); - $method2->getArguments()->willReturn(array($argument21)); - $method2->hasReturnType()->willReturn(false); - $method2->hasNullableReturnType()->willReturn(true); - $method2->getCode()->willReturn('return $this->email;'); - - $method3->getName()->willReturn('getRefValue'); - $method3->getVisibility()->willReturn('public'); - $method3->returnsReference()->willReturn(true); - $method3->isStatic()->willReturn(false); - $method3->getArguments()->willReturn(array($argument31)); - $method3->hasReturnType()->willReturn(true); - $method3->getReturnType()->willReturn('string'); - $method3->hasNullableReturnType()->willReturn(false); - $method3->getCode()->willReturn('return $this->refValue;'); - - $method4->getName()->willReturn('doSomething'); - $method4->getVisibility()->willReturn('public'); - $method4->returnsReference()->willReturn(false); - $method4->isStatic()->willReturn(false); - $method4->getArguments()->willReturn(array()); - $method4->hasReturnType()->willReturn(true); - $method4->getReturnType()->willReturn('void'); - $method4->hasNullableReturnType()->willReturn(false); - $method4->getCode()->willReturn('return;'); - - $argument11->getName()->willReturn('fullname'); - $argument11->getTypeHint()->willReturn('array'); - $argument11->isOptional()->willReturn(true); - $argument11->getDefault()->willReturn(null); - $argument11->isPassedByReference()->willReturn(false); - $argument11->isVariadic()->willReturn(false); - $argument11->isNullable()->willReturn(false); - - $argument12->getName()->willReturn('class'); - $argument12->getTypeHint()->willReturn('ReflectionClass'); - $argument12->isOptional()->willReturn(false); - $argument12->isPassedByReference()->willReturn(false); - $argument12->isVariadic()->willReturn(false); - $argument12->isNullable()->willReturn(false); - - $argument21->getName()->willReturn('default'); - $argument21->getTypeHint()->willReturn('string'); - $argument21->isOptional()->willReturn(true); - $argument21->getDefault()->willReturn('ever.zet@gmail.com'); - $argument21->isPassedByReference()->willReturn(false); - $argument21->isVariadic()->willReturn(false); - $argument21->isNullable()->willReturn(true); - - $argument31->getName()->willReturn('refValue'); - $argument31->getTypeHint()->willReturn(null); - $argument31->isOptional()->willReturn(false); - $argument31->getDefault()->willReturn(); - $argument31->isPassedByReference()->willReturn(false); - $argument31->isVariadic()->willReturn(false); - $argument31->isNullable()->willReturn(false); - - $code = $this->generate('CustomClass', $class); - - if (version_compare(PHP_VERSION, '7.1', '>=')) { - $expected = <<<'PHP' -namespace { -class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface, \ArrayAccess, \ArrayIterator { -public $name; -private $email; - -public static function getName(array $fullname = NULL, \ReflectionClass $class): ?string { -return $this->name; -} -protected function getEmail(?string $default = 'ever.zet@gmail.com') { -return $this->email; -} -public function &getRefValue( $refValue): string { -return $this->refValue; -} -public function doSomething(): void { -return; -} - -} -} -PHP; - } elseif (version_compare(PHP_VERSION, '7.0', '>=')) { - $expected = <<<'PHP' -namespace { -class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface, \ArrayAccess, \ArrayIterator { -public $name; -private $email; - -public static function getName(array $fullname = NULL, \ReflectionClass $class): string { -return $this->name; -} -protected function getEmail(string $default = 'ever.zet@gmail.com') { -return $this->email; -} -public function &getRefValue( $refValue): string { -return $this->refValue; -} -public function doSomething() { -return; -} - -} -} -PHP; - } else { - $expected = <<<'PHP' -namespace { -class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface, \ArrayAccess, \ArrayIterator { -public $name; -private $email; - -public static function getName(array $fullname = NULL, \ReflectionClass $class) { -return $this->name; -} -protected function getEmail(\string $default = 'ever.zet@gmail.com') { -return $this->email; -} -public function &getRefValue( $refValue) { -return $this->refValue; -} -public function doSomething() { -return; -} - -} -} -PHP; - } - $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n")); - $code->shouldBe($expected); - } - - function it_generates_proper_php_code_for_variadics( - ClassNode $class, - MethodNode $method1, - MethodNode $method2, - MethodNode $method3, - MethodNode $method4, - ArgumentNode $argument1, - ArgumentNode $argument2, - ArgumentNode $argument3, - ArgumentNode $argument4 - ) { - $class->getParentClass()->willReturn('stdClass'); - $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface')); - $class->getProperties()->willReturn(array()); - $class->getMethods()->willReturn(array( - $method1, $method2, $method3, $method4 - )); - - $method1->getName()->willReturn('variadic'); - $method1->getVisibility()->willReturn('public'); - $method1->returnsReference()->willReturn(false); - $method1->isStatic()->willReturn(false); - $method1->getArguments()->willReturn(array($argument1)); - $method1->hasReturnType()->willReturn(false); - $method1->getCode()->willReturn(''); - - $method2->getName()->willReturn('variadicByRef'); - $method2->getVisibility()->willReturn('public'); - $method2->returnsReference()->willReturn(false); - $method2->isStatic()->willReturn(false); - $method2->getArguments()->willReturn(array($argument2)); - $method2->hasReturnType()->willReturn(false); - $method2->getCode()->willReturn(''); - - $method3->getName()->willReturn('variadicWithType'); - $method3->getVisibility()->willReturn('public'); - $method3->returnsReference()->willReturn(false); - $method3->isStatic()->willReturn(false); - $method3->getArguments()->willReturn(array($argument3)); - $method3->hasReturnType()->willReturn(false); - $method3->getCode()->willReturn(''); - - $method4->getName()->willReturn('variadicWithTypeByRef'); - $method4->getVisibility()->willReturn('public'); - $method4->returnsReference()->willReturn(false); - $method4->isStatic()->willReturn(false); - $method4->getArguments()->willReturn(array($argument4)); - $method4->hasReturnType()->willReturn(false); - $method4->getCode()->willReturn(''); - - $argument1->getName()->willReturn('args'); - $argument1->getTypeHint()->willReturn(null); - $argument1->isOptional()->willReturn(false); - $argument1->isPassedByReference()->willReturn(false); - $argument1->isVariadic()->willReturn(true); - $argument1->isNullable()->willReturn(false); - - $argument2->getName()->willReturn('args'); - $argument2->getTypeHint()->willReturn(null); - $argument2->isOptional()->willReturn(false); - $argument2->isPassedByReference()->willReturn(true); - $argument2->isVariadic()->willReturn(true); - $argument2->isNullable()->willReturn(false); - - $argument3->getName()->willReturn('args'); - $argument3->getTypeHint()->willReturn('\ReflectionClass'); - $argument3->isOptional()->willReturn(false); - $argument3->isPassedByReference()->willReturn(false); - $argument3->isVariadic()->willReturn(true); - $argument3->isNullable()->willReturn(false); - - $argument4->getName()->willReturn('args'); - $argument4->getTypeHint()->willReturn('\ReflectionClass'); - $argument4->isOptional()->willReturn(false); - $argument4->isPassedByReference()->willReturn(true); - $argument4->isVariadic()->willReturn(true); - $argument4->isNullable()->willReturn(false); - - $code = $this->generate('CustomClass', $class); - $expected = <<<'PHP' -namespace { -class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface { - -public function variadic( ...$args) { - -} -public function variadicByRef( &...$args) { - -} -public function variadicWithType(\\ReflectionClass ...$args) { - -} -public function variadicWithTypeByRef(\\ReflectionClass &...$args) { - -} - -} -} -PHP; - $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n")); - $code->shouldBe($expected); - } - - function it_overrides_properly_methods_with_args_passed_by_reference( - ClassNode $class, - MethodNode $method, - ArgumentNode $argument - ) { - $class->getParentClass()->willReturn('RuntimeException'); - $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface')); - $class->getProperties()->willReturn(array()); - $class->getMethods()->willReturn(array($method)); - - $method->getName()->willReturn('getName'); - $method->getVisibility()->willReturn('public'); - $method->isStatic()->willReturn(false); - $method->getArguments()->willReturn(array($argument)); - $method->hasReturnType()->willReturn(false); - $method->returnsReference()->willReturn(false); - $method->getCode()->willReturn('return $this->name;'); - - $argument->getName()->willReturn('fullname'); - $argument->getTypeHint()->willReturn('array'); - $argument->isOptional()->willReturn(true); - $argument->getDefault()->willReturn(null); - $argument->isPassedByReference()->willReturn(true); - $argument->isVariadic()->willReturn(false); - $argument->isNullable()->willReturn(false); - - $code = $this->generate('CustomClass', $class); - $expected =<<<'PHP' -namespace { -class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface { - -public function getName(array &$fullname = NULL) { -return $this->name; -} - -} -} -PHP; - $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n")); - $code->shouldBe($expected); - } - - function it_generates_empty_class_for_empty_ClassNode(ClassNode $class) - { - $class->getParentClass()->willReturn('stdClass'); - $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface')); - $class->getProperties()->willReturn(array()); - $class->getMethods()->willReturn(array()); - - $code = $this->generate('CustomClass', $class); - $expected =<<<'PHP' -namespace { -class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface { - - -} -} -PHP; - $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n")); - $code->shouldBe($expected); - } - - function it_wraps_class_in_namespace_if_it_is_namespaced(ClassNode $class) - { - $class->getParentClass()->willReturn('stdClass'); - $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface')); - $class->getProperties()->willReturn(array()); - $class->getMethods()->willReturn(array()); - - $code = $this->generate('My\Awesome\CustomClass', $class); - $expected =<<<'PHP' -namespace My\Awesome { -class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface { - - -} -} -PHP; - $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n")); - $code->shouldBe($expected); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -beConstructedWith($generator); - } - - function it_evaluates_code_generated_by_ClassCodeGenerator($generator, ClassNode $class) - { - $generator->generate('stdClass', $class)->shouldBeCalled()->willReturn( - 'return 42;' - ); - - $this->create('stdClass', $class)->shouldReturn(42); - } - - function it_throws_an_exception_if_class_does_not_exist_after_evaluation($generator, ClassNode $class) - { - $generator->generate('CustomClass', $class)->shouldBeCalled()->willReturn( - 'return 42;' - ); - - $class->getParentClass()->willReturn('stdClass'); - $class->getInterfaces()->willReturn(array('Interface1', 'Interface2')); - - $this->shouldThrow('Prophecy\Exception\Doubler\ClassCreatorException') - ->duringCreate('CustomClass', $class); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -beConstructedWith('name'); - } - - function it_is_not_be_passed_by_reference_by_default() - { - $this->shouldNotBePassedByReference(); - } - - function it_is_passed_by_reference_if_marked() - { - $this->setAsPassedByReference(); - $this->shouldBePassedByReference(); - } - - function it_is_not_variadic_by_default() - { - $this->shouldNotBeVariadic(); - } - - function it_is_variadic_if_marked() - { - $this->setAsVariadic(); - $this->shouldBeVariadic(); - } - - function it_does_not_have_default_by_default() - { - $this->shouldNotHaveDefault(); - } - - function it_does_not_have_default_if_variadic() - { - $this->setDefault(null); - $this->setAsVariadic(); - $this->shouldNotHaveDefault(); - } - - function it_does_have_default_if_not_variadic() - { - $this->setDefault(null); - $this->setAsVariadic(false); - $this->hasDefault()->shouldReturn(true); - } - - function it_has_name_with_which_it_was_been_constructed() - { - $this->getName()->shouldReturn('name'); - } - - function it_has_no_typehint_by_default() - { - $this->getTypeHint()->shouldReturn(null); - } - - function its_typeHint_is_mutable() - { - $this->setTypeHint('array'); - $this->getTypeHint()->shouldReturn('array'); - } - - function it_does_not_have_default_value_by_default() - { - $this->getDefault()->shouldReturn(null); - } - - function it_is_not_optional_by_default() - { - $this->isOptional()->shouldReturn(false); - } - - function its_default_is_mutable() - { - $this->setDefault(array()); - $this->getDefault()->shouldReturn(array()); - } - - function it_is_marked_as_optional_when_default_is_set() - { - $this->setDefault(null); - $this->isOptional()->shouldReturn(true); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ -getParentClass()->shouldReturn('stdClass'); - } - - function its_parentClass_is_mutable() - { - $this->setParentClass('Exception'); - $this->getParentClass()->shouldReturn('Exception'); - } - - function its_parentClass_is_set_to_stdClass_if_user_set_null() - { - $this->setParentClass(null); - $this->getParentClass()->shouldReturn('stdClass'); - } - - function it_does_not_implement_any_interface_by_default() - { - $this->getInterfaces()->shouldHaveCount(0); - } - - function its_addInterface_adds_item_to_the_list_of_implemented_interfaces() - { - $this->addInterface('MyInterface'); - $this->getInterfaces()->shouldHaveCount(1); - } - - function its_hasInterface_returns_true_if_class_implements_interface() - { - $this->addInterface('MyInterface'); - $this->hasInterface('MyInterface')->shouldReturn(true); - } - - function its_hasInterface_returns_false_if_class_does_not_implements_interface() - { - $this->hasInterface('MyInterface')->shouldReturn(false); - } - - function it_supports_implementation_of_multiple_interfaces() - { - $this->addInterface('MyInterface'); - $this->addInterface('MySecondInterface'); - $this->getInterfaces()->shouldHaveCount(2); - } - - function it_ignores_same_interfaces_added_twice() - { - $this->addInterface('MyInterface'); - $this->addInterface('MyInterface'); - - $this->getInterfaces()->shouldHaveCount(1); - $this->getInterfaces()->shouldReturn(array('MyInterface')); - } - - function it_does_not_have_methods_by_default() - { - $this->getMethods()->shouldHaveCount(0); - } - - function it_can_has_methods(MethodNode $method1, MethodNode $method2) - { - $method1->getName()->willReturn('__construct'); - $method2->getName()->willReturn('getName'); - - $this->addMethod($method1); - $this->addMethod($method2); - - $this->getMethods()->shouldReturn(array( - '__construct' => $method1, - 'getName' => $method2 - )); - } - - function its_hasMethod_returns_true_if_method_exists(MethodNode $method) - { - $method->getName()->willReturn('getName'); - - $this->addMethod($method); - - $this->hasMethod('getName')->shouldReturn(true); - } - - function its_getMethod_returns_method_by_name(MethodNode $method) - { - $method->getName()->willReturn('getName'); - - $this->addMethod($method); - - $this->getMethod('getName')->shouldReturn($method); - } - - function its_hasMethod_returns_false_if_method_does_not_exists() - { - $this->hasMethod('getName')->shouldReturn(false); - } - - function its_hasMethod_returns_false_if_method_has_been_removed(MethodNode $method) - { - $method->getName()->willReturn('getName'); - $this->addMethod($method); - $this->removeMethod('getName'); - - $this->hasMethod('getName')->shouldReturn(false); - } - - - function it_does_not_have_properties_by_default() - { - $this->getProperties()->shouldHaveCount(0); - } - - function it_is_able_to_have_properties() - { - $this->addProperty('title'); - $this->addProperty('text', 'private'); - $this->getProperties()->shouldReturn(array( - 'title' => 'public', - 'text' => 'private' - )); - } - - function its_addProperty_does_not_accept_unsupported_visibility() - { - $this->shouldThrow('InvalidArgumentException')->duringAddProperty('title', 'town'); - } - - function its_addProperty_lowercases_visibility_before_setting() - { - $this->addProperty('text', 'PRIVATE'); - $this->getProperties()->shouldReturn(array('text' => 'private')); - } - - function its_has_no_unextendable_methods_by_default() - { - $this->getUnextendableMethods()->shouldHaveCount(0); - } - - function its_addUnextendableMethods_adds_an_unextendable_method() - { - $this->addUnextendableMethod('testMethod'); - $this->getUnextendableMethods()->shouldHaveCount(1); - } - - function its_methods_are_extendable_by_default() - { - $this->isExtendable('testMethod')->shouldReturn(true); - } - - function its_unextendable_methods_are_not_extendable() - { - $this->addUnextendableMethod('testMethod'); - $this->isExtendable('testMethod')->shouldReturn(false); - } - - function its_addUnextendableMethods_doesnt_create_duplicates() - { - $this->addUnextendableMethod('testMethod'); - $this->addUnextendableMethod('testMethod'); - $this->getUnextendableMethods()->shouldHaveCount(1); - } - - function it_throws_an_exception_when_adding_a_method_that_isnt_extendable(MethodNode $method) - { - $this->addUnextendableMethod('testMethod'); - $method->getName()->willReturn('testMethod'); - - $expectedException = new MethodNotExtendableException( - "Method `testMethod` is not extendable, so can not be added.", - "stdClass", - "testMethod" - ); - $this->shouldThrow($expectedException)->duringAddMethod($method); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -beConstructedWith('getTitle'); - } - - function it_has_a_name() - { - $this->getName()->shouldReturn('getTitle'); - } - - function it_has_public_visibility_by_default() - { - $this->getVisibility()->shouldReturn('public'); - } - - function its_visibility_is_mutable() - { - $this->setVisibility('private'); - $this->getVisibility()->shouldReturn('private'); - } - - function it_is_not_static_by_default() - { - $this->shouldNotBeStatic(); - } - - function it_does_not_return_a_reference_by_default() - { - $this->returnsReference()->shouldReturn(false); - } - - function it_should_be_settable_as_returning_a_reference_through_setter() - { - $this->setReturnsReference(); - $this->returnsReference()->shouldReturn(true); - } - - function it_should_be_settable_as_static_through_setter() - { - $this->setStatic(); - $this->shouldBeStatic(); - } - - function it_accepts_only_supported_visibilities() - { - $this->shouldThrow('InvalidArgumentException')->duringSetVisibility('stealth'); - } - - function it_lowercases_visibility_before_setting_it() - { - $this->setVisibility('Public'); - $this->getVisibility()->shouldReturn('public'); - } - - function its_useParentCode_causes_method_to_call_parent(ArgumentNode $argument1, ArgumentNode $argument2) - { - $argument1->getName()->willReturn('objectName'); - $argument2->getName()->willReturn('default'); - - $argument1->isVariadic()->willReturn(false); - $argument2->isVariadic()->willReturn(true); - - $this->addArgument($argument1); - $this->addArgument($argument2); - - $this->useParentCode(); - - $this->getCode()->shouldReturn( - 'return parent::getTitle($objectName, ...$default);' - ); - } - - function its_code_is_mutable() - { - $this->setCode('echo "code";'); - $this->getCode()->shouldReturn('echo "code";'); - } - - function its_reference_returning_methods_will_generate_exceptions() - { - $this->setCode('echo "code";'); - $this->setReturnsReference(); - $this->getCode()->shouldReturn("throw new \Prophecy\Exception\Doubler\ReturnByReferenceException('Returning by reference not supported', get_class(\$this), 'getTitle');"); - } - - function its_setCode_provided_with_null_cleans_method_body() - { - $this->setCode(null); - $this->getCode()->shouldReturn(''); - } - - function it_is_constructable_with_code() - { - $this->beConstructedWith('getTitle', 'die();'); - $this->getCode()->shouldReturn('die();'); - } - - function it_does_not_have_arguments_by_default() - { - $this->getArguments()->shouldHaveCount(0); - } - - function it_supports_adding_arguments(ArgumentNode $argument1, ArgumentNode $argument2) - { - $this->addArgument($argument1); - $this->addArgument($argument2); - - $this->getArguments()->shouldReturn(array($argument1, $argument2)); - } - - function it_does_not_have_return_type_by_default() - { - $this->hasReturnType()->shouldReturn(false); - } - - function it_setReturnType_sets_return_type() - { - $returnType = 'string'; - - $this->setReturnType($returnType); - - $this->hasReturnType()->shouldReturn(true); - $this->getReturnType()->shouldReturn($returnType); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -beConstructedWith($doubler); - } - - function it_returns_anonymous_double_instance_by_default($doubler, ProphecySubjectInterface $double) - { - $doubler->double(null, array())->willReturn($double); - - $this->getInstance()->shouldReturn($double); - } - - function it_returns_class_double_instance_if_set($doubler, ProphecySubjectInterface $double, \ReflectionClass $class) - { - $doubler->double($class, array())->willReturn($double); - - $this->setParentClass($class); - - $this->getInstance()->shouldReturn($double); - } - - function it_returns_same_double_instance_if_called_2_times( - $doubler, - ProphecySubjectInterface $double1, - ProphecySubjectInterface $double2 - ) { - $doubler->double(null, array())->willReturn($double1); - $doubler->double(null, array())->willReturn($double2); - - $this->getInstance()->shouldReturn($double2); - $this->getInstance()->shouldReturn($double2); - } - - function its_setParentClass_throws_ClassNotFoundException_if_class_not_found() - { - $this->shouldThrow('Prophecy\Exception\Doubler\ClassNotFoundException') - ->duringSetParentClass('SomeUnexistingClass'); - } - - function its_setParentClass_throws_exception_if_prophecy_is_already_created( - $doubler, - ProphecySubjectInterface $double - ) { - $doubler->double(null, array())->willReturn($double); - - $this->getInstance(); - - $this->shouldThrow('Prophecy\Exception\Doubler\DoubleException') - ->duringSetParentClass('stdClass'); - } - - function its_addInterface_throws_InterfaceNotFoundException_if_no_interface_found() - { - $this->shouldThrow('Prophecy\Exception\Doubler\InterfaceNotFoundException') - ->duringAddInterface('SomeUnexistingInterface'); - } - - function its_addInterface_throws_exception_if_prophecy_is_already_created( - $doubler, - ProphecySubjectInterface $double - ) { - $doubler->double(null, array())->willReturn($double); - - $this->getInstance(); - - $this->shouldThrow('Prophecy\Exception\Doubler\DoubleException') - ->duringAddInterface('ArrayAccess'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -getName()->willReturn('stdClass'); - $this->name($class, array())->shouldStartWith('Double\stdClass\\'); - } - - function its_name_generates_name_based_on_namespaced_class_reflection(\ReflectionClass $class) - { - $class->getName()->willReturn('Some\Custom\Class'); - $this->name($class, array())->shouldStartWith('Double\Some\Custom\Class\P'); - } - - function its_name_generates_name_based_on_interface_shortnames( - \ReflectionClass $interface1, - \ReflectionClass $interface2 - ) { - $interface1->getShortName()->willReturn('HandlerInterface'); - $interface2->getShortName()->willReturn('LoaderInterface'); - - $this->name(null, array($interface1, $interface2))->shouldStartWith( - 'Double\HandlerInterface\LoaderInterface\P' - ); - } - - function it_generates_proper_name_for_no_class_and_interfaces_list() - { - $this->name(null, array())->shouldStartWith('Double\stdClass\P'); - } - - function its_name_generates_name_based_only_on_class_if_its_available( - \ReflectionClass $class, - \ReflectionClass $interface1, - \ReflectionClass $interface2 - ) { - $class->getName()->willReturn('Some\Custom\Class'); - $interface1->getShortName()->willReturn('HandlerInterface'); - $interface2->getShortName()->willReturn('LoaderInterface'); - - $this->name($class, array($interface1, $interface2))->shouldStartWith( - 'Double\Some\Custom\Class\P' - ); - } - - public function getMatchers() - { - return array( - 'startWith' => function ($subject, $string) { - return 0 === strpos($subject, $string); - }, - ); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -beConstructedWith('msg', $objectProphecy, 'getName', array('arg1', 'arg2')); - } - - function it_is_prophecy_exception() - { - $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ObjectProphecyException'); - } - - function it_exposes_method_name_through_getter() - { - $this->getMethodName()->shouldReturn('getName'); - } - - function it_exposes_arguments_through_getter() - { - $this->getArguments()->shouldReturn(array('arg1', 'arg2')); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -beConstructedWith('', $node); - } - - function it_is_a_prophecy_exception() - { - $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception'); - $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException'); - } - - function it_contains_a_reflected_node($node) - { - $this->getClassNode()->shouldReturn($node); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -beConstructedWith('', $class); - } - - function it_is_a_prophecy_exception() - { - $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception'); - $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException'); - } - - function it_contains_a_reflected_class_link($class) - { - $this->getReflectedClass()->shouldReturn($class); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -beConstructedWith('msg', 'CustomClass'); - } - - function it_is_a_prophecy_exception() - { - $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception'); - $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoubleException'); - } - - function its_getClassname_returns_classname() - { - $this->getClassname()->shouldReturn('CustomClass'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -shouldBeAnInstanceOf('RuntimeException'); - $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -beConstructedWith('msg', 'CustomInterface'); - } - - function it_extends_ClassNotFoundException() - { - $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\ClassNotFoundException'); - } - - function its_getClassname_returns_classname() - { - $this->getClassname()->shouldReturn('CustomInterface'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotExtendableExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotExtendableExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -beConstructedWith('', 'User', 'getName'); - } - - function it_is_DoubleException() - { - $this->shouldHaveType('Prophecy\Exception\Doubler\DoubleException'); - } - - function it_has_MethodName() - { - $this->getMethodName()->shouldReturn('getName'); - } - - function it_has_classname() - { - $this->getClassName()->shouldReturn('User'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -beConstructedWith('', 'User', 'getName', array(1, 2, 3)); - } - - function it_is_DoubleException() - { - $this->shouldHaveType('Prophecy\Exception\Doubler\DoubleException'); - } - - function it_has_MethodName() - { - $this->getMethodName()->shouldReturn('getName'); - } - - function it_has_classnamej() - { - $this->getClassname()->shouldReturn('User'); - } - - function it_has_an_arguments_list() - { - $this->getArguments()->shouldReturn(array(1, 2, 3)); - } - - function it_has_a_default_null_argument_list() - { - $this->beConstructedWith('', 'User', 'getName'); - $this->getArguments()->shouldReturn(null); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -beConstructedWith(null); - } - - function it_is_prediction_exception() - { - $this->shouldBeAnInstanceOf('RuntimeException'); - $this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\PredictionException'); - } - - function it_can_store_objectProphecy_link(ObjectProphecy $object) - { - $this->setObjectProphecy($object); - $this->getObjectProphecy()->shouldReturn($object); - } - - function it_should_not_have_exceptions_at_the_beginning() - { - $this->getExceptions()->shouldHaveCount(0); - } - - function it_should_append_exception_through_append_method(PredictionException $exception) - { - $exception->getMessage()->willReturn('Exception #1'); - - $this->append($exception); - - $this->getExceptions()->shouldReturn(array($exception)); - } - - function it_should_update_message_during_append(PredictionException $exception) - { - $exception->getMessage()->willReturn('Exception #1'); - - $this->append($exception); - - $this->getMessage()->shouldReturn(" Exception #1"); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -getObjectProphecy()->willReturn($objectProphecy); - - $this->beConstructedWith('message', $methodProphecy); - } - - function it_is_PredictionException() - { - $this->shouldHaveType('Prophecy\Exception\Prediction\PredictionException'); - } - - function it_extends_MethodProphecyException() - { - $this->shouldHaveType('Prophecy\Exception\Prophecy\MethodProphecyException'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -getObjectProphecy()->willReturn($objectProphecy); - - $this->beConstructedWith('message', $methodProphecy, 5, array($call1, $call2)); - } - - function it_extends_UnexpectedCallsException() - { - $this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\UnexpectedCallsException'); - } - - function it_should_expose_expectedCount_through_getter() - { - $this->getExpectedCount()->shouldReturn(5); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -getObjectProphecy()->willReturn($objectProphecy); - - $this->beConstructedWith('message', $methodProphecy, array($call1, $call2)); - } - - function it_is_PredictionException() - { - $this->shouldHaveType('Prophecy\Exception\Prediction\PredictionException'); - } - - function it_extends_MethodProphecyException() - { - $this->shouldHaveType('Prophecy\Exception\Prophecy\MethodProphecyException'); - } - - function it_should_expose_calls_list_through_getter($call1, $call2) - { - $this->getCalls()->shouldReturn(array($call1, $call2)); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -getObjectProphecy()->willReturn($objectProphecy); - - $this->beConstructedWith('message', $methodProphecy); - } - - function it_extends_DoubleException() - { - $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ObjectProphecyException'); - } - - function it_holds_a_stub_reference($methodProphecy) - { - $this->getMethodProphecy()->shouldReturn($methodProphecy); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -beConstructedWith('message', $objectProphecy); - } - - function it_should_be_a_prophecy_exception() - { - $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ProphecyException'); - } - - function it_holds_double_reference($objectProphecy) - { - $this->getObjectProphecy()->shouldReturn($objectProphecy); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -shouldHaveType('Prophecy\Prediction\PredictionInterface'); - } - - function it_does_nothing_if_there_is_more_than_one_call_been_made( - ObjectProphecy $object, - MethodProphecy $method, - Call $call - ) { - $this->check(array($call), $object, $method)->shouldReturn(null); - } - - function it_throws_NoCallsException_if_no_calls_found( - ObjectProphecy $object, - MethodProphecy $method, - ArgumentsWildcard $arguments - ) { - $method->getObjectProphecy()->willReturn($object); - $method->getMethodName()->willReturn('getName'); - $method->getArgumentsWildcard()->willReturn($arguments); - $arguments->__toString()->willReturn('123'); - $object->reveal()->willReturn(new \stdClass()); - $object->findProphecyMethodCalls('getName', Argument::any())->willReturn(array()); - - $this->shouldThrow('Prophecy\Exception\Prediction\NoCallsException') - ->duringCheck(array(), $object, $method); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -beConstructedWith(2); - } - - function it_is_prediction() - { - $this->shouldHaveType('Prophecy\Prediction\PredictionInterface'); - } - - function it_does_nothing_if_there_were_exact_amount_of_calls_being_made( - ObjectProphecy $object, - MethodProphecy $method, - Call $call1, - Call $call2 - ) { - $this->check(array($call1, $call2), $object, $method)->shouldReturn(null); - } - - function it_throws_UnexpectedCallsCountException_if_calls_found( - ObjectProphecy $object, - MethodProphecy $method, - Call $call, - ArgumentsWildcard $arguments - ) { - $method->getObjectProphecy()->willReturn($object); - $method->getMethodName()->willReturn('getName'); - $method->getArgumentsWildcard()->willReturn($arguments); - $arguments->__toString()->willReturn('123'); - - $call->getMethodName()->willReturn('getName'); - $call->getArguments()->willReturn(array(5, 4, 'three')); - $call->getCallPlace()->willReturn('unknown'); - - $this->shouldThrow('Prophecy\Exception\Prediction\UnexpectedCallsCountException') - ->duringCheck(array($call), $object, $method); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -beConstructedWith('get_class'); - } - - function it_is_prediction() - { - $this->shouldHaveType('Prophecy\Prediction\PredictionInterface'); - } - - function it_proxies_call_to_callback(ObjectProphecy $object, MethodProphecy $method, Call $call) - { - $returnFirstCallCallback = function ($calls, $object, $method) { - throw new RuntimeException; - }; - - $this->beConstructedWith($returnFirstCallCallback); - - $this->shouldThrow('RuntimeException')->duringCheck(array($call), $object, $method); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -shouldHaveType('Prophecy\Prediction\PredictionInterface'); - } - - function it_does_nothing_if_there_is_no_calls_made(ObjectProphecy $object, MethodProphecy $method) - { - $this->check(array(), $object, $method)->shouldReturn(null); - } - - function it_throws_UnexpectedCallsException_if_calls_found( - ObjectProphecy $object, - MethodProphecy $method, - Call $call, - ArgumentsWildcard $arguments - ) { - $method->getObjectProphecy()->willReturn($object); - $method->getMethodName()->willReturn('getName'); - $method->getArgumentsWildcard()->willReturn($arguments); - $arguments->__toString()->willReturn('123'); - - $call->getMethodName()->willReturn('getName'); - $call->getArguments()->willReturn(array(5, 4, 'three')); - $call->getCallPlace()->willReturn('unknown'); - - $this->shouldThrow('Prophecy\Exception\Prediction\UnexpectedCallsException') - ->duringCheck(array($call), $object, $method); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -beConstructedWith('get_class'); - } - - function it_is_promise() - { - $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface'); - } - - function it_should_execute_closure_callback(ObjectProphecy $object, MethodProphecy $method) - { - $firstArgumentCallback = function ($args) { - return $args[0]; - }; - - $this->beConstructedWith($firstArgumentCallback); - - $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one'); - } - - function it_should_execute_static_array_callback(ObjectProphecy $object, MethodProphecy $method) - { - $firstArgumentCallback = array('spec\Prophecy\Promise\ClassCallback', 'staticCallbackMethod'); - - $this->beConstructedWith($firstArgumentCallback); - - $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one'); - } - - function it_should_execute_instance_array_callback(ObjectProphecy $object, MethodProphecy $method) - { - $class = new ClassCallback(); - $firstArgumentCallback = array($class, 'callbackMethod'); - - $this->beConstructedWith($firstArgumentCallback); - - $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one'); - } - - function it_should_execute_string_function_callback(ObjectProphecy $object, MethodProphecy $method) - { - $firstArgumentCallback = 'spec\Prophecy\Promise\functionCallbackFirstArgument'; - - $this->beConstructedWith($firstArgumentCallback); - - $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one'); - } - -} - -/** - * Class used to test callbackpromise - * - * @param array - * @return string - */ -class ClassCallback -{ - /** - * @param array $args - */ - function callbackMethod($args) - { - return $args[0]; - } - - /** - * @param array $args - */ - static function staticCallbackMethod($args) - { - return $args[0]; - } -} - -/** - * Callback function used to test callbackpromise - * - * @param array - * @return string - */ -function functionCallbackFirstArgument($args) -{ - return $args[0]; -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface'); - } - - function it_should_return_first_argument_if_provided(ObjectProphecy $object, MethodProphecy $method) - { - $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one'); - } - - function it_should_return_null_if_no_arguments_provided(ObjectProphecy $object, MethodProphecy $method) - { - $this->execute(array(), $object, $method)->shouldReturn(null); - } - - function it_should_return_nth_argument_if_provided(ObjectProphecy $object, MethodProphecy $method) - { - $this->beConstructedWith(1); - $this->execute(array('one', 'two'), $object, $method)->shouldReturn('two'); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -beConstructedWith(array(42)); - } - - function it_is_promise() - { - $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface'); - } - - function it_returns_value_it_was_constructed_with(ObjectProphecy $object, MethodProphecy $method) - { - $this->execute(array(), $object, $method)->shouldReturn(42); - } - - function it_always_returns_last_value_left_in_the_return_values(ObjectProphecy $object, MethodProphecy $method) - { - $this->execute(array(), $object, $method)->shouldReturn(42); - $this->execute(array(), $object, $method)->shouldReturn(42); - } - - function it_consequently_returns_multiple_values_it_was_constructed_with( - ObjectProphecy $object, - MethodProphecy $method - ) { - $this->beConstructedWith(array(42, 24, 12)); - - $this->execute(array(), $object, $method)->shouldReturn(42); - $this->execute(array(), $object, $method)->shouldReturn(24); - $this->execute(array(), $object, $method)->shouldReturn(12); - } - - function it_returns_null_if_constructed_with_empty_array(ObjectProphecy $object, MethodProphecy $method) - { - $this->beConstructedWith(array()); - - $this->execute(array(), $object, $method)->shouldReturn(null); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -beConstructedWith('RuntimeException'); - } - - function it_is_promise() - { - $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface'); - } - - function it_instantiates_and_throws_exception_from_provided_classname(ObjectProphecy $object, MethodProphecy $method) - { - $this->beConstructedWith('InvalidArgumentException'); - - $this->shouldThrow('InvalidArgumentException') - ->duringExecute(array(), $object, $method); - } - - function it_instantiates_exceptions_with_required_arguments(ObjectProphecy $object, MethodProphecy $method) - { - $this->beConstructedWith('spec\Prophecy\Promise\RequiredArgumentException'); - - $this->shouldThrow('spec\Prophecy\Promise\RequiredArgumentException') - ->duringExecute(array(), $object, $method); - } - - function it_throws_provided_exception(ObjectProphecy $object, MethodProphecy $method) - { - $this->beConstructedWith($exc = new \RuntimeException('Some exception')); - - $this->shouldThrow($exc)->duringExecute(array(), $object, $method); - } - - function it_throws_error_instances(ObjectProphecy $object, MethodProphecy $method) - { - if (!class_exists('\Error')) { - throw new SkippingException('The class Error, introduced in PHP 7, does not exist'); - } - - $this->beConstructedWith($exc = new \Error('Error exception')); - - $this->shouldThrow($exc)->duringExecute(array(), $object, $method); - } - - function it_throws_errors_by_class_name() - { - if (!class_exists('\Error')) { - throw new SkippingException('The class Error, introduced in PHP 7, does not exist'); - } - - $this->beConstructedWith('\Error'); - - $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); - } - - function it_does_not_throw_something_that_is_not_throwable_by_class_name() - { - $this->beConstructedWith('\stdClass'); - - $this->shouldThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); - } - - function it_does_not_throw_something_that_is_not_throwable_by_instance() - { - $this->beConstructedWith(new \stdClass()); - - $this->shouldThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); - } - - function it_throws_an_exception_by_class_name() - { - $this->beConstructedWith('\Exception'); - - $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation(); - } -} - -class RequiredArgumentException extends \Exception -{ - final public function __construct($message, $code) {} -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,342 +0,0 @@ -reveal()->willReturn($reflection); - - $this->beConstructedWith($objectProphecy, 'getName', null); - } - - function it_is_initializable() - { - $this->shouldHaveType('Prophecy\Prophecy\MethodProphecy'); - } - - function its_constructor_throws_MethodNotFoundException_for_unexisting_method($objectProphecy) - { - $this->shouldThrow('Prophecy\Exception\Doubler\MethodNotFoundException')->during( - '__construct', array($objectProphecy, 'getUnexisting', null) - ); - } - - function its_constructor_throws_MethodProphecyException_for_final_methods($objectProphecy, ClassWithFinalMethod $subject) - { - $objectProphecy->reveal()->willReturn($subject); - - $this->shouldThrow('Prophecy\Exception\Prophecy\MethodProphecyException')->during( - '__construct', array($objectProphecy, 'finalMethod', null) - ); - } - - function its_constructor_transforms_array_passed_as_3rd_argument_to_ArgumentsWildcard( - $objectProphecy - ) - { - $this->beConstructedWith($objectProphecy, 'getName', array(42, 33)); - - $wildcard = $this->getArgumentsWildcard(); - $wildcard->shouldNotBe(null); - $wildcard->__toString()->shouldReturn('exact(42), exact(33)'); - } - - function its_constructor_does_not_touch_third_argument_if_it_is_null($objectProphecy) - { - $this->beConstructedWith($objectProphecy, 'getName', null); - - $wildcard = $this->getArgumentsWildcard(); - $wildcard->shouldBe(null); - } - - function it_records_promise_through_will_method(PromiseInterface $promise, $objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->will($promise); - $this->getPromise()->shouldReturn($promise); - } - - function it_adds_itself_to_ObjectProphecy_during_call_to_will(PromiseInterface $objectProphecy, $promise) - { - $objectProphecy->addMethodProphecy($this)->shouldBeCalled(); - - $this->will($promise); - } - - function it_adds_ReturnPromise_during_willReturn_call($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->willReturn(42); - $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ReturnPromise'); - } - - function it_adds_ThrowPromise_during_willThrow_call($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->willThrow('RuntimeException'); - $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ThrowPromise'); - } - - function it_adds_ReturnArgumentPromise_during_willReturnArgument_call($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->willReturnArgument(); - $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ReturnArgumentPromise'); - } - - function it_adds_ReturnArgumentPromise_during_willReturnArgument_call_with_index_argument($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->willReturnArgument(1); - $promise = $this->getPromise(); - $promise->shouldBeAnInstanceOf('Prophecy\Promise\ReturnArgumentPromise'); - $promise->execute(array('one', 'two'), $objectProphecy, $this)->shouldReturn('two'); - } - - function it_adds_CallbackPromise_during_will_call_with_callback_argument($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $callback = function () {}; - - $this->will($callback); - $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\CallbackPromise'); - } - - function it_records_prediction_through_should_method(PredictionInterface $prediction, $objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->callOnWrappedObject('should', array($prediction)); - $this->getPrediction()->shouldReturn($prediction); - } - - function it_adds_CallbackPrediction_during_should_call_with_callback_argument($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $callback = function () {}; - - $this->callOnWrappedObject('should', array($callback)); - $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallbackPrediction'); - } - - function it_adds_itself_to_ObjectProphecy_during_call_to_should($objectProphecy, PredictionInterface $prediction) - { - $objectProphecy->addMethodProphecy($this)->shouldBeCalled(); - - $this->callOnWrappedObject('should', array($prediction)); - } - - function it_adds_CallPrediction_during_shouldBeCalled_call($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->callOnWrappedObject('shouldBeCalled', array()); - $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallPrediction'); - } - - function it_adds_NoCallsPrediction_during_shouldNotBeCalled_call($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->callOnWrappedObject('shouldNotBeCalled', array()); - $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\NoCallsPrediction'); - } - - function it_adds_CallTimesPrediction_during_shouldBeCalledTimes_call($objectProphecy) - { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->callOnWrappedObject('shouldBeCalledTimes', array(5)); - $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallTimesPrediction'); - } - - function it_checks_prediction_via_shouldHave_method_call( - $objectProphecy, - ArgumentsWildcard $arguments, - PredictionInterface $prediction, - Call $call1, - Call $call2 - ) { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled(); - $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2)); - - $this->withArguments($arguments); - $this->callOnWrappedObject('shouldHave', array($prediction)); - } - - function it_sets_return_promise_during_shouldHave_call_if_none_was_set_before( - $objectProphecy, - ArgumentsWildcard $arguments, - PredictionInterface $prediction, - Call $call1, - Call $call2 - ) { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled(); - $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2)); - - $this->withArguments($arguments); - $this->callOnWrappedObject('shouldHave', array($prediction)); - - $this->getPromise()->shouldReturnAnInstanceOf('Prophecy\Promise\ReturnPromise'); - } - - function it_does_not_set_return_promise_during_shouldHave_call_if_it_was_set_before( - $objectProphecy, - ArgumentsWildcard $arguments, - PredictionInterface $prediction, - Call $call1, - Call $call2, - PromiseInterface $promise - ) { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled(); - $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2)); - - $this->will($promise); - $this->withArguments($arguments); - $this->callOnWrappedObject('shouldHave', array($prediction)); - - $this->getPromise()->shouldReturn($promise); - } - - function it_records_checked_predictions( - $objectProphecy, - ArgumentsWildcard $arguments, - PredictionInterface $prediction1, - PredictionInterface $prediction2, - Call $call1, - Call $call2, - PromiseInterface $promise - ) { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - $prediction1->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willReturn(); - $prediction2->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willReturn(); - $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2)); - - $this->will($promise); - $this->withArguments($arguments); - $this->callOnWrappedObject('shouldHave', array($prediction1)); - $this->callOnWrappedObject('shouldHave', array($prediction2)); - - $this->getCheckedPredictions()->shouldReturn(array($prediction1, $prediction2)); - } - - function it_records_even_failed_checked_predictions( - $objectProphecy, - ArgumentsWildcard $arguments, - PredictionInterface $prediction, - Call $call1, - Call $call2, - PromiseInterface $promise - ) { - $objectProphecy->addMethodProphecy($this)->willReturn(null); - $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willThrow(new \RuntimeException()); - $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2)); - - $this->will($promise); - $this->withArguments($arguments); - - try { - $this->callOnWrappedObject('shouldHave', array($prediction)); - } catch (\Exception $e) {} - - $this->getCheckedPredictions()->shouldReturn(array($prediction)); - } - - function it_checks_prediction_via_shouldHave_method_call_with_callback( - $objectProphecy, - ArgumentsWildcard $arguments, - Call $call1, - Call $call2 - ) { - $callback = function ($calls, $object, $method) { - throw new \RuntimeException; - }; - $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2)); - - $this->withArguments($arguments); - $this->shouldThrow('RuntimeException')->duringShouldHave($callback); - } - - function it_does_nothing_during_checkPrediction_if_no_prediction_set() - { - $this->checkPrediction()->shouldReturn(null); - } - - function it_checks_set_prediction_during_checkPrediction( - $objectProphecy, - ArgumentsWildcard $arguments, - PredictionInterface $prediction, - Call $call1, - Call $call2 - ) { - $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled(); - $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2)); - $objectProphecy->addMethodProphecy($this)->willReturn(null); - - $this->withArguments($arguments); - $this->callOnWrappedObject('should', array($prediction)); - $this->checkPrediction(); - } - - function it_links_back_to_ObjectProphecy_through_getter($objectProphecy) - { - $this->getObjectProphecy()->shouldReturn($objectProphecy); - } - - function it_has_MethodName() - { - $this->getMethodName()->shouldReturn('getName'); - } - - function it_contains_ArgumentsWildcard_it_was_constructed_with($objectProphecy, ArgumentsWildcard $wildcard) - { - $this->beConstructedWith($objectProphecy, 'getName', $wildcard); - - $this->getArgumentsWildcard()->shouldReturn($wildcard); - } - - function its_ArgumentWildcard_is_mutable_through_setter(ArgumentsWildcard $wildcard) - { - $this->withArguments($wildcard); - - $this->getArgumentsWildcard()->shouldReturn($wildcard); - } - - function its_withArguments_transforms_passed_array_into_ArgumentsWildcard() - { - $this->withArguments(array(42, 33)); - - $wildcard = $this->getArgumentsWildcard(); - $wildcard->shouldNotBe(null); - $wildcard->__toString()->shouldReturn('exact(42), exact(33)'); - } - - function its_withArguments_throws_exception_if_wrong_arguments_provided() - { - $this->shouldThrow('Prophecy\Exception\InvalidArgumentException')->duringWithArguments(42); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,283 +0,0 @@ -beConstructedWith($lazyDouble); - - $lazyDouble->getInstance()->willReturn($double); - } - - function it_implements_ProphecyInterface() - { - $this->shouldBeAnInstanceOf('Prophecy\Prophecy\ProphecyInterface'); - } - - function it_sets_parentClass_during_willExtend_call($lazyDouble) - { - $lazyDouble->setParentClass('123')->shouldBeCalled(); - - $this->willExtend('123'); - } - - function it_adds_interface_during_willImplement_call($lazyDouble) - { - $lazyDouble->addInterface('222')->shouldBeCalled(); - - $this->willImplement('222'); - } - - function it_sets_constructor_arguments_during_willBeConstructedWith_call($lazyDouble) - { - $lazyDouble->setArguments(array(1, 2, 5))->shouldBeCalled(); - - $this->willBeConstructedWith(array(1, 2, 5)); - } - - function it_does_not_have_method_prophecies_by_default() - { - $this->getMethodProphecies()->shouldHaveCount(0); - } - - function it_should_get_method_prophecies_by_method_name( - MethodProphecy $method1, - MethodProphecy $method2, - ArgumentsWildcard $arguments - ) { - $method1->getMethodName()->willReturn('getName'); - $method1->getArgumentsWildcard()->willReturn($arguments); - $method2->getMethodName()->willReturn('setName'); - $method2->getArgumentsWildcard()->willReturn($arguments); - - $this->addMethodProphecy($method1); - $this->addMethodProphecy($method2); - - $methods = $this->getMethodProphecies('setName'); - $methods->shouldHaveCount(1); - $methods[0]->getMethodName()->shouldReturn('setName'); - } - - function it_should_return_empty_array_if_no_method_prophecies_found() - { - $methods = $this->getMethodProphecies('setName'); - $methods->shouldHaveCount(0); - } - - function it_should_proxy_makeProphecyMethodCall_to_CallCenter($lazyDouble, CallCenter $callCenter) - { - $this->beConstructedWith($lazyDouble, $callCenter); - - $callCenter->makeCall($this->getWrappedObject(), 'setName', array('everzet'))->willReturn(42); - - $this->makeProphecyMethodCall('setName', array('everzet'))->shouldReturn(42); - } - - function it_should_reveal_arguments_and_return_values_from_callCenter( - $lazyDouble, - CallCenter $callCenter, - RevealerInterface $revealer - ) { - $this->beConstructedWith($lazyDouble, $callCenter, $revealer); - - $revealer->reveal(array('question'))->willReturn(array('life')); - $revealer->reveal('answer')->willReturn(42); - - $callCenter->makeCall($this->getWrappedObject(), 'setName', array('life'))->willReturn('answer'); - - $this->makeProphecyMethodCall('setName', array('question'))->shouldReturn(42); - } - - function it_should_proxy_getProphecyMethodCalls_to_CallCenter( - $lazyDouble, - CallCenter $callCenter, - ArgumentsWildcard $wildcard, - Call $call - ) { - $this->beConstructedWith($lazyDouble, $callCenter); - - $callCenter->findCalls('setName', $wildcard)->willReturn(array($call)); - - $this->findProphecyMethodCalls('setName', $wildcard)->shouldReturn(array($call)); - } - - function its_addMethodProphecy_adds_method_prophecy( - MethodProphecy $methodProphecy, - ArgumentsWildcard $argumentsWildcard - ) { - $methodProphecy->getArgumentsWildcard()->willReturn($argumentsWildcard); - $methodProphecy->getMethodName()->willReturn('getUsername'); - - $this->addMethodProphecy($methodProphecy); - - $this->getMethodProphecies()->shouldReturn(array( - 'getUsername' => array($methodProphecy) - )); - } - - function its_addMethodProphecy_handles_prophecies_with_different_arguments( - MethodProphecy $methodProphecy1, - MethodProphecy $methodProphecy2, - ArgumentsWildcard $argumentsWildcard1, - ArgumentsWildcard $argumentsWildcard2 - ) { - $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1); - $methodProphecy1->getMethodName()->willReturn('getUsername'); - - $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2); - $methodProphecy2->getMethodName()->willReturn('getUsername'); - - $this->addMethodProphecy($methodProphecy1); - $this->addMethodProphecy($methodProphecy2); - - $this->getMethodProphecies()->shouldReturn(array( - 'getUsername' => array( - $methodProphecy1, - $methodProphecy2, - ) - )); - } - - function its_addMethodProphecy_handles_prophecies_for_different_methods( - MethodProphecy $methodProphecy1, - MethodProphecy $methodProphecy2, - ArgumentsWildcard $argumentsWildcard1, - ArgumentsWildcard $argumentsWildcard2 - ) { - $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1); - $methodProphecy1->getMethodName()->willReturn('getUsername'); - - $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2); - $methodProphecy2->getMethodName()->willReturn('isUsername'); - - $this->addMethodProphecy($methodProphecy1); - $this->addMethodProphecy($methodProphecy2); - - $this->getMethodProphecies()->shouldReturn(array( - 'getUsername' => array( - $methodProphecy1 - ), - 'isUsername' => array( - $methodProphecy2 - ) - )); - } - - function its_addMethodProphecy_throws_exception_when_method_has_no_ArgumentsWildcard(MethodProphecy $methodProphecy) - { - $methodProphecy->getArgumentsWildcard()->willReturn(null); - $methodProphecy->getObjectProphecy()->willReturn($this); - $methodProphecy->getMethodName()->willReturn('getTitle'); - - $this->shouldThrow('Prophecy\Exception\Prophecy\MethodProphecyException')->duringAddMethodProphecy( - $methodProphecy - ); - } - - function it_returns_null_after_checkPredictions_call_if_there_is_no_method_prophecies() - { - $this->checkProphecyMethodsPredictions()->shouldReturn(null); - } - - function it_throws_AggregateException_during_checkPredictions_if_predictions_fail( - MethodProphecy $methodProphecy1, MethodProphecy $methodProphecy2, - ArgumentsWildcard $argumentsWildcard1, - ArgumentsWildcard $argumentsWildcard2 - ) { - $methodProphecy1->getMethodName()->willReturn('getName'); - $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1); - $methodProphecy1->checkPrediction() - ->willThrow('Prophecy\Exception\Prediction\AggregateException'); - - $methodProphecy2->getMethodName()->willReturn('setName'); - $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2); - $methodProphecy2->checkPrediction() - ->willThrow('Prophecy\Exception\Prediction\AggregateException'); - - $this->addMethodProphecy($methodProphecy1); - $this->addMethodProphecy($methodProphecy2); - - $this->shouldThrow('Prophecy\Exception\Prediction\AggregateException') - ->duringCheckProphecyMethodsPredictions(); - } - - function it_returns_new_MethodProphecy_instance_for_arbitrary_call( - Doubler $doubler, - ProphecySubjectInterface $reflection - ) { - $doubler->double(Argument::any())->willReturn($reflection); - - $return = $this->getProphecy(); - $return->shouldBeAnInstanceOf('Prophecy\Prophecy\MethodProphecy'); - $return->getMethodName()->shouldReturn('getProphecy'); - } - - function it_returns_same_MethodProphecy_for_same_registered_signature( - Doubler $doubler, - ProphecySubjectInterface $reflection - ) { - $doubler->double(Argument::any())->willReturn($reflection); - - $this->addMethodProphecy($methodProphecy1 = $this->getProphecy(1, 2, 3)); - $methodProphecy2 = $this->getProphecy(1, 2, 3); - - $methodProphecy2->shouldBe($methodProphecy1); - } - - function it_returns_new_MethodProphecy_for_different_signatures( - Doubler $doubler, - ProphecySubjectInterface $reflection - ) { - $doubler->double(Argument::any())->willReturn($reflection); - - $value = new ObjectProphecySpecFixtureB('ABC'); - $value2 = new ObjectProphecySpecFixtureB('CBA'); - - $this->addMethodProphecy($methodProphecy1 = $this->getProphecy(1, 2, 3, $value)); - $methodProphecy2 = $this->getProphecy(1, 2, 3, $value2); - - $methodProphecy2->shouldNotBe($methodProphecy1); - } - - function it_returns_new_MethodProphecy_for_all_callback_signatures( - Doubler $doubler, - ProphecySubjectInterface $reflection - ) { - $doubler->double(Argument::any())->willReturn($reflection); - - $this->addMethodProphecy($methodProphecy1 = $this->getProphecy(function(){})); - $methodProphecy2 = $this->getProphecy(function(){}); - - $methodProphecy2->shouldNotBe($methodProphecy1); - } -} - -class ObjectProphecySpecFixtureA -{ - public $errors; -} - -class ObjectProphecySpecFixtureB extends ObjectProphecySpecFixtureA -{ - public $errors; - public $value = null; - - public function __construct($value) - { - $this->value = $value; - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -shouldBeAnInstanceOf('Prophecy\Prophecy\RevealerInterface'); - } - - function it_reveals_single_instance_of_ProphecyInterface(ProphecyInterface $prophecy, \stdClass $object) - { - $prophecy->reveal()->willReturn($object); - - $this->reveal($prophecy)->shouldReturn($object); - } - - function it_reveals_instances_of_ProphecyInterface_inside_array( - ProphecyInterface $prophecy1, - ProphecyInterface $prophecy2, - \stdClass $object1, - \stdClass $object2 - ) { - $prophecy1->reveal()->willReturn($object1); - $prophecy2->reveal()->willReturn($object2); - - $this->reveal(array( - array('item' => $prophecy2), - $prophecy1 - ))->shouldReturn(array( - array('item' => $object2), - $object1 - )); - } - - function it_does_not_touch_non_prophecy_interface() - { - $this->reveal(42)->shouldReturn(42); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -double(null, array())->willReturn($double); - - $this->beConstructedWith($doubler); - } - - function it_constructs_new_prophecy_on_prophesize_call() - { - $prophecy = $this->prophesize(); - $prophecy->shouldBeAnInstanceOf('Prophecy\Prophecy\ObjectProphecy'); - } - - function it_constructs_new_prophecy_with_parent_class_if_specified($doubler, ProphecySubjectInterface $newDouble) - { - $doubler->double(Argument::any(), array())->willReturn($newDouble); - - $this->prophesize('Prophecy\Prophet')->reveal()->shouldReturn($newDouble); - } - - function it_constructs_new_prophecy_with_interface_if_specified($doubler, ProphecySubjectInterface $newDouble) - { - $doubler->double(null, Argument::any())->willReturn($newDouble); - - $this->prophesize('ArrayAccess')->reveal()->shouldReturn($newDouble); - } - - function it_exposes_all_created_prophecies_through_getter() - { - $prophecy1 = $this->prophesize(); - $prophecy2 = $this->prophesize(); - - $this->getProphecies()->shouldReturn(array($prophecy1, $prophecy2)); - } - - function it_does_nothing_during_checkPredictions_call_if_no_predictions_defined() - { - $this->checkPredictions()->shouldReturn(null); - } - - function it_throws_AggregateException_if_defined_predictions_fail( - MethodProphecy $method1, - MethodProphecy $method2, - ArgumentsWildcard $arguments1, - ArgumentsWildcard $arguments2 - ) { - $method1->getMethodName()->willReturn('getName'); - $method1->getArgumentsWildcard()->willReturn($arguments1); - $method1->checkPrediction()->willReturn(null); - - $method2->getMethodName()->willReturn('isSet'); - $method2->getArgumentsWildcard()->willReturn($arguments2); - $method2->checkPrediction()->willThrow( - 'Prophecy\Exception\Prediction\AggregateException' - ); - - $this->prophesize()->addMethodProphecy($method1); - $this->prophesize()->addMethodProphecy($method2); - - $this->shouldThrow('Prophecy\Exception\Prediction\AggregateException') - ->duringCheckPredictions(); - } - - function it_exposes_doubler_through_getter($doubler) - { - $this->getDoubler()->shouldReturn($doubler); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php --- a/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -stringify(42)->shouldReturn('42'); - } - - function it_generates_proper_string_representation_for_string() - { - $this->stringify('some string')->shouldReturn('"some string"'); - } - - function it_generates_single_line_representation_for_multiline_string() - { - $this->stringify("some\nstring")->shouldReturn('"some\\nstring"'); - } - - function it_generates_proper_string_representation_for_double() - { - $this->stringify(42.3)->shouldReturn('42.3'); - } - - function it_generates_proper_string_representation_for_boolean_true() - { - $this->stringify(true)->shouldReturn('true'); - } - - function it_generates_proper_string_representation_for_boolean_false() - { - $this->stringify(false)->shouldReturn('false'); - } - - function it_generates_proper_string_representation_for_null() - { - $this->stringify(null)->shouldReturn('null'); - } - - function it_generates_proper_string_representation_for_empty_array() - { - $this->stringify(array())->shouldReturn('[]'); - } - - function it_generates_proper_string_representation_for_array() - { - $this->stringify(array('zet', 42))->shouldReturn('["zet", 42]'); - } - - function it_generates_proper_string_representation_for_hash_containing_one_value() - { - $this->stringify(array('ever' => 'zet'))->shouldReturn('["ever" => "zet"]'); - } - - function it_generates_proper_string_representation_for_hash() - { - $this->stringify(array('ever' => 'zet', 52 => 'hey', 'num' => 42))->shouldReturn( - '["ever" => "zet", 52 => "hey", "num" => 42]' - ); - } - - function it_generates_proper_string_representation_for_resource() - { - $resource = fopen(__FILE__, 'r'); - $this->stringify($resource)->shouldReturn('stream:'.$resource); - } - - function it_generates_proper_string_representation_for_object(\stdClass $object) - { - $objHash = sprintf('%s:%s', - get_class($object->getWrappedObject()), - spl_object_hash($object->getWrappedObject()) - ) . " Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n)"; - - $this->stringify($object)->shouldReturn("$objHash"); - } - - function it_generates_proper_string_representation_for_object_without_exporting(\stdClass $object) - { - $objHash = sprintf('%s:%s', - get_class($object->getWrappedObject()), - spl_object_hash($object->getWrappedObject()) - ); - - $this->stringify($object, false)->shouldReturn("$objHash"); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,7 +51,8 @@ * * @return int Priority number (higher - earlier) */ - public function getPriority() { + public function getPriority() + { return 49; } @@ -60,7 +61,11 @@ * * @return array */ - private function getKeywords() { + private function getKeywords() + { + if (\PHP_VERSION_ID >= 70000) { + return array('__halt_compiler'); + } return array( '__halt_compiler', diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,7 +34,6 @@ if (null === $node->getParentClass()) { return false; } - return 'SplFileInfo' === $node->getParentClass() || is_subclass_of($node->getParentClass(), 'SplFileInfo') ; @@ -61,7 +60,15 @@ } if ($this->nodeIsSplFileObject($node)) { - $constructor->setCode('return parent::__construct("' . __FILE__ .'");'); + $filePath = str_replace('\\','\\\\',__FILE__); + $constructor->setCode('return parent::__construct("' . $filePath .'");'); + + return; + } + + if ($this->nodeIsSymfonySplFileInfo($node)) { + $filePath = str_replace('\\','\\\\',__FILE__); + $constructor->setCode('return parent::__construct("' . $filePath .'", "", "");'); return; } @@ -102,4 +109,15 @@ return 'SplFileObject' === $parent || is_subclass_of($parent, 'SplFileObject'); } + + /** + * @param ClassNode $node + * @return boolean + */ + private function nodeIsSymfonySplFileInfo(ClassNode $node) + { + $parent = $node->getParentClass(); + + return 'Symfony\\Component\\Finder\\SplFileInfo' === $parent; + } } diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,6 +20,16 @@ class ClassCodeGenerator { /** + * @var TypeHintReference + */ + private $typeHintReference; + + public function __construct(TypeHintReference $typeHintReference = null) + { + $this->typeHintReference = $typeHintReference ?: new TypeHintReference(); + } + + /** * Generates PHP code for class node. * * @param string $classname @@ -91,7 +101,8 @@ private function generateArguments(array $arguments) { - return array_map(function (Node\ArgumentNode $argument) { + $typeHintReference = $this->typeHintReference; + return array_map(function (Node\ArgumentNode $argument) use ($typeHintReference) { $php = ''; if (version_compare(PHP_VERSION, '7.1', '>=')) { @@ -99,34 +110,7 @@ } if ($hint = $argument->getTypeHint()) { - switch ($hint) { - case 'array': - case 'callable': - $php .= $hint; - break; - - case 'iterable': - if (version_compare(PHP_VERSION, '7.1', '>=')) { - $php .= $hint; - break; - } - - $php .= '\\'.$hint; - break; - - case 'string': - case 'int': - case 'float': - case 'bool': - if (version_compare(PHP_VERSION, '7.0', '>=')) { - $php .= $hint; - break; - } - // Fall-through to default case for PHP 5.x - - default: - $php .= '\\'.$hint; - } + $php .= $typeHintReference->isBuiltInParamTypeHint($hint) ? $hint : '\\'.$hint; } $php .= ' '.($argument->isPassedByReference() ? '&' : ''); diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php Fri Feb 23 15:52:07 2018 +0000 @@ -11,6 +11,7 @@ namespace Prophecy\Doubler\Generator\Node; +use Prophecy\Doubler\Generator\TypeHintReference; use Prophecy\Exception\InvalidArgumentException; /** @@ -34,13 +35,19 @@ private $arguments = array(); /** + * @var TypeHintReference + */ + private $typeHintReference; + + /** * @param string $name * @param string $code */ - public function __construct($name, $code = null) + public function __construct($name, $code = null, TypeHintReference $typeHintReference = null) { $this->name = $name; $this->code = $code; + $this->typeHintReference = $typeHintReference ?: new TypeHintReference(); } public function getVisibility() @@ -112,38 +119,22 @@ */ public function setReturnType($type = null) { - switch ($type) { - case '': - $this->returnType = null; - break; - - case 'string'; - case 'float': - case 'int': - case 'bool': - case 'array': - case 'callable': - case 'iterable': - case 'void': - $this->returnType = $type; - break; - - case 'double': - case 'real': - $this->returnType = 'float'; - break; - - case 'boolean': - $this->returnType = 'bool'; - break; - - case 'integer': - $this->returnType = 'int'; - break; - - default: - $this->returnType = '\\' . ltrim($type, '\\'); + if ($type === '' || $type === null) { + $this->returnType = null; + return; } + $typeMap = array( + 'double' => 'float', + 'real' => 'float', + 'boolean' => 'bool', + 'integer' => 'int', + ); + if (isset($typeMap[$type])) { + $type = $typeMap[$type]; + } + $this->returnType = $this->typeHintReference->isBuiltInReturnTypeHint($type) ? + $type : + '\\' . ltrim($type, '\\'); } public function getReturnType() diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/TypeHintReference.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/TypeHintReference.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,46 @@ += 50400; + + case 'bool': + case 'float': + case 'int': + case 'string': + return PHP_VERSION_ID >= 70000; + + case 'iterable': + return PHP_VERSION_ID >= 70100; + + case 'object': + return PHP_VERSION_ID >= 70200; + + default: + return false; + } + } + + public function isBuiltInReturnTypeHint($type) + { + if ($type === 'void') { + return PHP_VERSION_ID >= 70100; + } + + return $this->isBuiltInParamTypeHint($type); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php Fri Feb 23 15:52:07 2018 +0000 @@ -14,7 +14,7 @@ class MethodNotFoundException extends DoubleException { /** - * @var string + * @var string|object */ private $classname; @@ -30,7 +30,7 @@ /** * @param string $message - * @param string $classname + * @param string|object $classname * @param string $methodName * @param null|Argument\ArgumentsWildcard|array $arguments */ diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php --- a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php Fri Feb 23 15:52:07 2018 +0000 @@ -164,7 +164,7 @@ /** * Sets return promise to the prophecy. * - * @see Prophecy\Promise\ReturnPromise + * @see \Prophecy\Promise\ReturnPromise * * @return $this */ @@ -185,7 +185,7 @@ * * @param int $index The zero-indexed number of the argument to return * - * @see Prophecy\Promise\ReturnArgumentPromise + * @see \Prophecy\Promise\ReturnArgumentPromise * * @return $this */ @@ -201,7 +201,7 @@ /** * Sets throw promise to the prophecy. * - * @see Prophecy\Promise\ThrowPromise + * @see \Prophecy\Promise\ThrowPromise * * @param string|\Exception $exception Exception class or instance * @@ -243,7 +243,7 @@ /** * Sets call prediction to the prophecy. * - * @see Prophecy\Prediction\CallPrediction + * @see \Prophecy\Prediction\CallPrediction * * @return $this */ @@ -255,7 +255,7 @@ /** * Sets no calls prediction to the prophecy. * - * @see Prophecy\Prediction\NoCallsPrediction + * @see \Prophecy\Prediction\NoCallsPrediction * * @return $this */ @@ -267,7 +267,7 @@ /** * Sets call times prediction to the prophecy. * - * @see Prophecy\Prediction\CallTimesPrediction + * @see \Prophecy\Prediction\CallTimesPrediction * * @param $count * @@ -324,7 +324,7 @@ /** * Checks call prediction. * - * @see Prophecy\Prediction\CallPrediction + * @see \Prophecy\Prediction\CallPrediction * * @return $this */ @@ -336,7 +336,7 @@ /** * Checks no calls prediction. * - * @see Prophecy\Prediction\NoCallsPrediction + * @see \Prophecy\Prediction\NoCallsPrediction * * @return $this */ @@ -348,7 +348,7 @@ /** * Checks no calls prediction. * - * @see Prophecy\Prediction\NoCallsPrediction + * @see \Prophecy\Prediction\NoCallsPrediction * @deprecated * * @return $this @@ -361,7 +361,7 @@ /** * Checks call times prediction. * - * @see Prophecy\Prediction\CallTimesPrediction + * @see \Prophecy\Prediction\CallTimesPrediction * * @param int $count * diff -r bfffd8d7479a -r 7a779792577d vendor/phpspec/prophecy/tests/Doubler/Generator/ClassMirrorTest.php --- a/vendor/phpspec/prophecy/tests/Doubler/Generator/ClassMirrorTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,469 +0,0 @@ -reflect($class, array()); - - $this->assertCount(7, $node->getMethods()); - } - - /** - * @test - */ - public function it_reflects_protected_abstract_methods() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithProtectedAbstractMethod'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - - $this->assertEquals('Fixtures\Prophecy\WithProtectedAbstractMethod', $classNode->getParentClass()); - - $methodNodes = $classNode->getMethods(); - $this->assertCount(1, $methodNodes); - - $this->assertEquals('protected', $methodNodes['innerDetail']->getVisibility()); - } - - /** - * @test - */ - public function it_reflects_public_static_methods() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithStaticMethod'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - - $this->assertEquals('Fixtures\Prophecy\WithStaticMethod', $classNode->getParentClass()); - - $methodNodes = $classNode->getMethods(); - $this->assertCount(1, $methodNodes); - - $this->assertTrue($methodNodes['innerDetail']->isStatic()); - } - - /** - * @test - */ - public function it_marks_required_args_without_types_as_not_optional() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithArguments'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - $methodNode = $classNode->getMethod('methodWithoutTypeHints'); - $argNodes = $methodNode->getArguments(); - - $this->assertCount(1, $argNodes); - - $this->assertEquals('arg', $argNodes[0]->getName()); - $this->assertNull($argNodes[0]->getTypeHint()); - $this->assertFalse($argNodes[0]->isOptional()); - $this->assertNull($argNodes[0]->getDefault()); - $this->assertFalse($argNodes[0]->isPassedByReference()); - $this->assertFalse($argNodes[0]->isVariadic()); - } - - /** - * @test - */ - public function it_properly_reads_methods_arguments_with_types() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithArguments'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - $methodNode = $classNode->getMethod('methodWithArgs'); - $argNodes = $methodNode->getArguments(); - - $this->assertCount(3, $argNodes); - - $this->assertEquals('arg_1', $argNodes[0]->getName()); - $this->assertEquals('array', $argNodes[0]->getTypeHint()); - $this->assertTrue($argNodes[0]->isOptional()); - $this->assertEquals(array(), $argNodes[0]->getDefault()); - $this->assertFalse($argNodes[0]->isPassedByReference()); - $this->assertFalse($argNodes[0]->isVariadic()); - - $this->assertEquals('arg_2', $argNodes[1]->getName()); - $this->assertEquals('ArrayAccess', $argNodes[1]->getTypeHint()); - $this->assertFalse($argNodes[1]->isOptional()); - - $this->assertEquals('arg_3', $argNodes[2]->getName()); - $this->assertEquals('ArrayAccess', $argNodes[2]->getTypeHint()); - $this->assertTrue($argNodes[2]->isOptional()); - $this->assertNull($argNodes[2]->getDefault()); - $this->assertFalse($argNodes[2]->isPassedByReference()); - $this->assertFalse($argNodes[2]->isVariadic()); - } - - /** - * @test - * @requires PHP 5.4 - */ - public function it_properly_reads_methods_arguments_with_callable_types() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithCallableArgument'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - $methodNode = $classNode->getMethod('methodWithArgs'); - $argNodes = $methodNode->getArguments(); - - $this->assertCount(2, $argNodes); - - $this->assertEquals('arg_1', $argNodes[0]->getName()); - $this->assertEquals('callable', $argNodes[0]->getTypeHint()); - $this->assertFalse($argNodes[0]->isOptional()); - $this->assertFalse($argNodes[0]->isPassedByReference()); - $this->assertFalse($argNodes[0]->isVariadic()); - - $this->assertEquals('arg_2', $argNodes[1]->getName()); - $this->assertEquals('callable', $argNodes[1]->getTypeHint()); - $this->assertTrue($argNodes[1]->isOptional()); - $this->assertNull($argNodes[1]->getDefault()); - $this->assertFalse($argNodes[1]->isPassedByReference()); - $this->assertFalse($argNodes[1]->isVariadic()); - } - - /** - * @test - * @requires PHP 5.6 - */ - public function it_properly_reads_methods_variadic_arguments() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithVariadicArgument'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - $methodNode = $classNode->getMethod('methodWithArgs'); - $argNodes = $methodNode->getArguments(); - - $this->assertCount(1, $argNodes); - - $this->assertEquals('args', $argNodes[0]->getName()); - $this->assertNull($argNodes[0]->getTypeHint()); - $this->assertFalse($argNodes[0]->isOptional()); - $this->assertFalse($argNodes[0]->isPassedByReference()); - $this->assertTrue($argNodes[0]->isVariadic()); - } - - /** - * @test - * @requires PHP 5.6 - */ - public function it_properly_reads_methods_typehinted_variadic_arguments() - { - if (defined('HHVM_VERSION_ID')) { - $this->markTestSkipped('HHVM does not support typehints on variadic arguments.'); - } - - $class = new \ReflectionClass('Fixtures\Prophecy\WithTypehintedVariadicArgument'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - $methodNode = $classNode->getMethod('methodWithTypeHintedArgs'); - $argNodes = $methodNode->getArguments(); - - $this->assertCount(1, $argNodes); - - $this->assertEquals('args', $argNodes[0]->getName()); - $this->assertEquals('array', $argNodes[0]->getTypeHint()); - $this->assertFalse($argNodes[0]->isOptional()); - $this->assertFalse($argNodes[0]->isPassedByReference()); - $this->assertTrue($argNodes[0]->isVariadic()); - } - - /** - * @test - */ - public function it_marks_passed_by_reference_args_as_passed_by_reference() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithReferences'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - - $this->assertTrue($classNode->hasMethod('methodWithReferenceArgument')); - - $argNodes = $classNode->getMethod('methodWithReferenceArgument')->getArguments(); - - $this->assertCount(2, $argNodes); - - $this->assertTrue($argNodes[0]->isPassedByReference()); - $this->assertTrue($argNodes[1]->isPassedByReference()); - } - - /** - * @test - */ - public function it_throws_an_exception_if_class_is_final() - { - $class = new \ReflectionClass('Fixtures\Prophecy\FinalClass'); - - $mirror = new ClassMirror(); - - $this->setExpectedException('Prophecy\Exception\Doubler\ClassMirrorException'); - - $mirror->reflect($class, array()); - } - - /** - * @test - */ - public function it_ignores_final_methods() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithFinalMethod'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - - $this->assertCount(0, $classNode->getMethods()); - } - - /** - * @test - */ - public function it_marks_final_methods_as_unextendable() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithFinalMethod'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - - $this->assertCount(1, $classNode->getUnextendableMethods()); - $this->assertFalse($classNode->isExtendable('finalImplementation')); - } - - /** - * @test - */ - public function it_throws_an_exception_if_interface_provided_instead_of_class() - { - $class = new \ReflectionClass('Fixtures\Prophecy\EmptyInterface'); - - $mirror = new ClassMirror(); - - $this->setExpectedException('Prophecy\Exception\InvalidArgumentException'); - - $mirror->reflect($class, array()); - } - - /** - * @test - */ - public function it_reflects_all_interfaces_methods() - { - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect(null, array( - new \ReflectionClass('Fixtures\Prophecy\Named'), - new \ReflectionClass('Fixtures\Prophecy\ModifierInterface'), - )); - - $this->assertEquals('stdClass', $classNode->getParentClass()); - $this->assertEquals(array( - 'Prophecy\Doubler\Generator\ReflectionInterface', - 'Fixtures\Prophecy\ModifierInterface', - 'Fixtures\Prophecy\Named', - ), $classNode->getInterfaces()); - - $this->assertCount(3, $classNode->getMethods()); - $this->assertTrue($classNode->hasMethod('getName')); - $this->assertTrue($classNode->hasMethod('isAbstract')); - $this->assertTrue($classNode->hasMethod('getVisibility')); - } - - /** - * @test - */ - public function it_ignores_virtually_private_methods() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithVirtuallyPrivateMethod'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - - $this->assertCount(2, $classNode->getMethods()); - $this->assertTrue($classNode->hasMethod('isAbstract')); - $this->assertTrue($classNode->hasMethod('__toString')); - $this->assertFalse($classNode->hasMethod('_getName')); - } - - /** - * @test - */ - public function it_does_not_throw_exception_for_virtually_private_finals() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithFinalVirtuallyPrivateMethod'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - - $this->assertCount(0, $classNode->getMethods()); - } - - /** - * @test - * @requires PHP 7 - */ - public function it_reflects_return_typehints() - { - $class = new \ReflectionClass('Fixtures\Prophecy\WithReturnTypehints'); - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class, array()); - - $this->assertCount(3, $classNode->getMethods()); - $this->assertTrue($classNode->hasMethod('getName')); - $this->assertTrue($classNode->hasMethod('getSelf')); - $this->assertTrue($classNode->hasMethod('getParent')); - - $this->assertEquals('string', $classNode->getMethod('getName')->getReturnType()); - $this->assertEquals('\Fixtures\Prophecy\WithReturnTypehints', $classNode->getMethod('getSelf')->getReturnType()); - $this->assertEquals('\Fixtures\Prophecy\EmptyClass', $classNode->getMethod('getParent')->getReturnType()); - } - - /** - * @test - */ - public function it_throws_an_exception_if_class_provided_in_interfaces_list() - { - $class = new \ReflectionClass('Fixtures\Prophecy\EmptyClass'); - - $mirror = new ClassMirror(); - - $this->setExpectedException('InvalidArgumentException'); - - $mirror->reflect(null, array($class)); - } - - /** - * @test - */ - public function it_throws_an_exception_if_not_reflection_provided_as_interface() - { - $mirror = new ClassMirror(); - - $this->setExpectedException('InvalidArgumentException'); - - $mirror->reflect(null, array(null)); - } - - /** - * @test - */ - public function it_doesnt_use_scalar_typehints() - { - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect(new \ReflectionClass('ReflectionMethod'), array()); - $method = $classNode->getMethod('export'); - $arguments = $method->getArguments(); - - $this->assertNull($arguments[0]->getTypeHint()); - $this->assertNull($arguments[1]->getTypeHint()); - $this->assertNull($arguments[2]->getTypeHint()); - } - - /** - * @test - */ - public function it_doesnt_fail_to_typehint_nonexistent_FQCN() - { - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect(new \ReflectionClass('Fixtures\Prophecy\OptionalDepsClass'), array()); - $method = $classNode->getMethod('iHaveAStrangeTypeHintedArg'); - $arguments = $method->getArguments(); - $this->assertEquals('I\Simply\Am\Nonexistent', $arguments[0]->getTypeHint()); - } - - /** - * @test - */ - public function it_doesnt_fail_to_typehint_nonexistent_RQCN() - { - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect(new \ReflectionClass('Fixtures\Prophecy\OptionalDepsClass'), array()); - $method = $classNode->getMethod('iHaveAnEvenStrangerTypeHintedArg'); - $arguments = $method->getArguments(); - $this->assertEquals('I\Simply\Am\Not', $arguments[0]->getTypeHint()); - } - - /** - * @test - */ - function it_changes_argument_names_if_they_are_varying() - { - // Use test doubles in this test, as arguments named ... in the Reflection API can only happen for internal classes - $class = $this->prophesize('ReflectionClass'); - $method = $this->prophesize('ReflectionMethod'); - $parameter = $this->prophesize('ReflectionParameter'); - - $class->getName()->willReturn('Custom\ClassName'); - $class->isInterface()->willReturn(false); - $class->isFinal()->willReturn(false); - $class->getMethods(\ReflectionMethod::IS_PUBLIC)->willReturn(array($method)); - $class->getMethods(\ReflectionMethod::IS_ABSTRACT)->willReturn(array()); - - $method->getParameters()->willReturn(array($parameter)); - $method->getName()->willReturn('methodName'); - $method->isFinal()->willReturn(false); - $method->isProtected()->willReturn(false); - $method->isStatic()->willReturn(false); - $method->returnsReference()->willReturn(false); - - if (version_compare(PHP_VERSION, '7.0', '>=')) { - $method->hasReturnType()->willReturn(false); - } - - $parameter->getName()->willReturn('...'); - $parameter->isDefaultValueAvailable()->willReturn(true); - $parameter->getDefaultValue()->willReturn(null); - $parameter->isPassedByReference()->willReturn(false); - $parameter->getClass()->willReturn($class); - if (version_compare(PHP_VERSION, '5.6', '>=')) { - $parameter->isVariadic()->willReturn(false); - } - - $mirror = new ClassMirror(); - - $classNode = $mirror->reflect($class->reveal(), array()); - - $methodNodes = $classNode->getMethods(); - - $argumentNodes = $methodNodes['methodName']->getArguments(); - $argumentNode = $argumentNodes[0]; - - $this->assertEquals('__dot_dot_dot__', $argumentNode->getName()); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/phpunit/php-file-iterator/ChangeLog.md --- a/vendor/phpunit/php-file-iterator/ChangeLog.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpunit/php-file-iterator/ChangeLog.md Fri Feb 23 15:52:07 2018 +0000 @@ -2,9 +2,40 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [1.4.0] - 2015-04-02 +## [1.4.5] - 2017-11-27 + +### Fixed + +* Fixed [#37](https://github.com/sebastianbergmann/php-file-iterator/issues/37): Regression caused by fix for [#30](https://github.com/sebastianbergmann/php-file-iterator/issues/30) + +## [1.4.4] - 2017-11-27 + +### Fixed + +* Fixed [#30](https://github.com/sebastianbergmann/php-file-iterator/issues/30): Exclude is not considered if it is a parent of the base path + +## [1.4.3] - 2017-11-25 + +### Fixed + +* Fixed [#34](https://github.com/sebastianbergmann/php-file-iterator/issues/34): Factory should use canonical directory names + +## [1.4.2] - 2016-11-26 + +No changes + +## [1.4.1] - 2015-07-26 + +No changes + +## 1.4.0 - 2015-04-02 ### Added * [Added support for wildcards (glob) in exclude](https://github.com/sebastianbergmann/php-file-iterator/pull/23) +[1.4.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.4...1.4.5 +[1.4.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.3...1.4.4 +[1.4.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.2...1.4.3 +[1.4.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.0...1.4.1 diff -r bfffd8d7479a -r 7a779792577d vendor/phpunit/php-file-iterator/src/Factory.php --- a/vendor/phpunit/php-file-iterator/src/Factory.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpunit/php-file-iterator/src/Factory.php Fri Feb 23 15:52:07 2018 +0000 @@ -80,9 +80,9 @@ foreach ($paths as $path) { if ($locals = glob($path, GLOB_ONLYDIR)) { - $_paths = array_merge($_paths, $locals); + $_paths = array_merge($_paths, array_map('realpath', $locals)); } else { - $_paths[] = $path; + $_paths[] = realpath($path); } } diff -r bfffd8d7479a -r 7a779792577d vendor/phpunit/php-file-iterator/src/Iterator.php --- a/vendor/phpunit/php-file-iterator/src/Iterator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpunit/php-file-iterator/src/Iterator.php Fri Feb 23 15:52:07 2018 +0000 @@ -131,7 +131,7 @@ /** * @param string $filename - * @param array $subString + * @param array $subStrings * @param int $type * @return bool * @since Method available since Release 1.1.0 diff -r bfffd8d7479a -r 7a779792577d vendor/phpunit/php-token-stream/.travis.yml --- a/vendor/phpunit/php-token-stream/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpunit/php-token-stream/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -21,7 +21,10 @@ - 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 diff -r bfffd8d7479a -r 7a779792577d vendor/phpunit/php-token-stream/src/Token/Stream.php --- a/vendor/phpunit/php-token-stream/src/Token/Stream.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/phpunit/php-token-stream/src/Token/Stream.php Fri Feb 23 15:52:07 2018 +0000 @@ -176,6 +176,7 @@ $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; } diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/.php_cs --- a/vendor/psy/psysh/.php_cs Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/.php_cs Fri Feb 23 15:52:07 2018 +0000 @@ -1,8 +1,11 @@ in(__DIR__) + ->name('.php_cs') + ->name('build-manual') + ->name('build-phar') + ->exclude('build-vendor'); $header = <<level(FixerInterface::SYMFONY_LEVEL) - ->fixers(array( - 'align_double_arrow', - 'concat_with_spaces', - 'header_comment', - 'long_array_syntax', - 'ordered_use', - 'strict', - '-concat_without_spaces', - '-method_argument_space', - '-pre_increment', - '-unalign_double_arrow', - '-unalign_equals', - '-no_empty_comment', // stop removing slashes in the middle of multi-line comments +return PhpCsFixer\Config::create() + ->setRules(array( + '@Symfony' => true, + 'array_syntax' => array('syntax' => 'long'), + 'binary_operator_spaces' => false, + 'concat_space' => array('spacing' => 'one'), + 'header_comment' => array('header' => $header), + 'increment_style' => array('style' => 'post'), + 'method_argument_space' => array('keep_multiple_spaces_after_comma' => true), + 'ordered_imports' => true, + 'pre_increment' => false, + 'yoda_style' => false, )) - ->setUsingLinter(false); - -$finder = $config->getFinder() - ->in(__DIR__) - ->name('.php_cs') - ->name('build-manual') - ->name('build-phar') - ->exclude('build-vendor'); - -return $config; + ->setFinder($finder); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/.travis.yml --- a/vendor/psy/psysh/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -32,4 +32,4 @@ on: tags: true repo: bobthecow/psysh - condition: ($TRAVIS_PHP_VERSION = 5.3* || $TRAVIS_PHP_VERSION = 7.1*) + condition: ($TRAVIS_PHP_VERSION = 5.3* || $TRAVIS_PHP_VERSION = 7.0*) diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/bin/build-manual --- a/vendor/psy/psysh/bin/build-manual Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/bin/build-manual Fri Feb 23 15:52:07 2018 +0000 @@ -53,8 +53,7 @@ case '>': $inTag = false; - - default: + break; } if ($inTag) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/composer.json --- a/vendor/psy/psysh/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -14,16 +14,15 @@ ], "require": { "php": ">=5.3.9", - "symfony/console": "~2.3.10|^2.4.2|~3.0", - "symfony/var-dumper": "~2.7|~3.0", + "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", + "symfony/var-dumper": "~2.7|~3.0|~4.0", "nikic/php-parser": "~1.3|~2.0|~3.0", "dnoegel/php-xdg-base-dir": "0.1", "jakub-onderka/php-console-highlighter": "0.3.*" }, "require-dev": { "phpunit/phpunit": "^4.8.35|^5.4.3", - "symfony/finder": "~2.1|~3.0", - "friendsofphp/php-cs-fixer": "~1.11", + "symfony/finder": "~2.1|~3.0|~4.0", "hoa/console": "~3.16|~1.14" }, "suggest": { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/CodeCleaner/ValidFunctionNamePass.php --- a/vendor/psy/psysh/src/Psy/CodeCleaner/ValidFunctionNamePass.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/CodeCleaner/ValidFunctionNamePass.php Fri Feb 23 15:52:07 2018 +0000 @@ -78,7 +78,7 @@ if (!$name instanceof Expr && !$name instanceof Variable) { $shortName = implode('\\', $name->parts); $fullName = $this->getFullyQualifiedName($name); - $inScope = isset($this->currentScope[strtolower($fullName)]); + $inScope = isset($this->currentScope[strtolower($fullName)]); if (!$inScope && !function_exists($shortName) && !function_exists($fullName)) { $message = sprintf('Call to undefined function %s()', $name); throw new FatalErrorException($message, 0, E_ERROR, null, $node->getLine()); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Command/ListCommand/MethodEnumerator.php --- a/vendor/psy/psysh/src/Psy/Command/ListCommand/MethodEnumerator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Command/ListCommand/MethodEnumerator.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,9 +39,9 @@ return; } - $showAll = $input->getOption('all'); + $showAll = $input->getOption('all'); $noInherit = $input->getOption('no-inherit'); - $methods = $this->prepareMethods($this->getMethods($showAll, $reflector, $noInherit)); + $methods = $this->prepareMethods($this->getMethods($showAll, $reflector, $noInherit)); if (empty($methods)) { return; diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Command/ListCommand/PropertyEnumerator.php --- a/vendor/psy/psysh/src/Psy/Command/ListCommand/PropertyEnumerator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Command/ListCommand/PropertyEnumerator.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,8 +39,8 @@ return; } - $showAll = $input->getOption('all'); - $noInherit = $input->getOption('no-inherit'); + $showAll = $input->getOption('all'); + $noInherit = $input->getOption('no-inherit'); $properties = $this->prepareProperties($this->getProperties($showAll, $reflector, $noInherit), $target); if (empty($properties)) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Command/ParseCommand.php --- a/vendor/psy/psysh/src/Psy/Command/ParseCommand.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Command/ParseCommand.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,7 +38,7 @@ public function __construct($name = null) { $this->parserFactory = new ParserFactory(); - $this->parsers = array(); + $this->parsers = array(); parent::__construct($name); } diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Command/ReflectingCommand.php --- a/vendor/psy/psysh/src/Psy/Command/ReflectingCommand.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Command/ReflectingCommand.php Fri Feb 23 15:52:07 2018 +0000 @@ -65,10 +65,9 @@ // @todo maybe do something interesting with these at some point? if (array_key_exists($matches[1], $GLOBALS)) { throw new RuntimeException('Unable to inspect a non-object'); - } else { - throw new RuntimeException('Unknown target: ' . $valueName); } + throw new RuntimeException('Unknown target: ' . $valueName); case preg_match(self::CLASS_OR_FUNC, $valueName, $matches): return array($this->resolveName($matches[0], true), null, 0); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Command/WhereamiCommand.php --- a/vendor/psy/psysh/src/Psy/Command/WhereamiCommand.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Command/WhereamiCommand.php Fri Feb 23 15:52:07 2018 +0000 @@ -116,12 +116,12 @@ */ protected function execute(InputInterface $input, OutputInterface $output) { - $info = $this->fileInfo(); - $num = $input->getOption('num'); - $factory = new ConsoleColorFactory($this->colorMode); - $colors = $factory->getConsoleColor(); + $info = $this->fileInfo(); + $num = $input->getOption('num'); + $factory = new ConsoleColorFactory($this->colorMode); + $colors = $factory->getConsoleColor(); $highlighter = new Highlighter($colors); - $contents = file_get_contents($info['file']); + $contents = file_get_contents($info['file']); $output->startPaging(); $output->writeln(''); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Command/WtfCommand.php --- a/vendor/psy/psysh/src/Psy/Command/WtfCommand.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Command/WtfCommand.php Fri Feb 23 15:52:07 2018 +0000 @@ -98,13 +98,13 @@ $output->startPaging(); do { $traceCount = count($exception->getTrace()); - $showLines = $count; + $showLines = $count; // Show the whole trace if we'd only be hiding a few lines if ($traceCount < max($count * 1.2, $count + 2)) { $showLines = PHP_INT_MAX; } - $trace = $this->getBacktrace($exception, $showLines); + $trace = $this->getBacktrace($exception, $showLines); $moreLines = $traceCount - count($trace); $output->writeln($shell->formatException($exception)); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Configuration.php --- a/vendor/psy/psysh/src/Psy/Configuration.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Configuration.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,8 +35,8 @@ */ class Configuration { - const COLOR_MODE_AUTO = 'auto'; - const COLOR_MODE_FORCED = 'forced'; + const COLOR_MODE_AUTO = 'auto'; + const COLOR_MODE_FORCED = 'forced'; const COLOR_MODE_DISABLED = 'disabled'; private static $AVAILABLE_OPTIONS = array( @@ -80,12 +80,12 @@ private $useBracketedPaste; private $hasPcntl; private $usePcntl; - private $newCommands = array(); + private $newCommands = array(); private $requireSemicolons = false; private $useUnicode; private $tabCompletion; private $tabCompletionMatchers = array(); - private $errorLoggingLevel = E_ALL; + private $errorLoggingLevel = E_ALL; private $warnOnMultipleConfigs = false; private $colorMode; private $updateCheck; diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Formatter/CodeFormatter.php --- a/vendor/psy/psysh/src/Psy/Formatter/CodeFormatter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Formatter/CodeFormatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,8 +50,8 @@ $start = $reflector->getStartLine(); $end = $reflector->getEndLine() - $start; - $factory = new ConsoleColorFactory($colorMode); - $colors = $factory->getConsoleColor(); + $factory = new ConsoleColorFactory($colorMode); + $colors = $factory->getConsoleColor(); $highlighter = new Highlighter($colors); return $highlighter->getCodeSnippet($file, $start, 0, $end); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Formatter/SignatureFormatter.php --- a/vendor/psy/psysh/src/Psy/Formatter/SignatureFormatter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Formatter/SignatureFormatter.php Fri Feb 23 15:52:07 2018 +0000 @@ -254,7 +254,7 @@ $typeStyle = self::getTypeStyle($value); $value = is_array($value) ? 'array()' : is_null($value) ? 'null' : var_export($value, true); } - $default = sprintf(' = <%s>%s', $typeStyle, OutputFormatter::escape($value), $typeStyle); + $default = sprintf(' = <%s>%s', $typeStyle, OutputFormatter::escape($value), $typeStyle); } else { $default = ''; } diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Input/ShellInput.php --- a/vendor/psy/psysh/src/Psy/Input/ShellInput.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Input/ShellInput.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,7 +50,7 @@ $hasCodeArgument = false; if ($definition->getArgumentCount() > 0) { - $args = $definition->getArguments(); + $args = $definition->getArguments(); $lastArg = array_pop($args); foreach ($args as $arg) { if ($arg instanceof CodeArgument) { @@ -218,7 +218,7 @@ private function parseShortOptionSet($name) { $len = strlen($name); - for ($i = 0; $i < $len; ++$i) { + for ($i = 0; $i < $len; $i++) { if (!$this->definition->hasShortcut($name[$i])) { throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); } diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Readline/GNUReadline.php --- a/vendor/psy/psysh/src/Psy/Readline/GNUReadline.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Readline/GNUReadline.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,7 +50,7 @@ { $this->historyFile = ($historyFile !== null) ? $historyFile : false; $this->historySize = $historySize; - $this->eraseDups = $eraseDups; + $this->eraseDups = $eraseDups; } /** diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Reflection/ReflectionConstant.php --- a/vendor/psy/psysh/src/Psy/Reflection/ReflectionConstant.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Reflection/ReflectionConstant.php Fri Feb 23 15:52:07 2018 +0000 @@ -60,7 +60,7 @@ // // While this isn't _technically_ correct, it's prolly close enough. do { - $class = $parent; + $class = $parent; $parent = $class->getParentClass(); } while ($parent && $parent->hasConstant($this->name) && $parent->getConstant($this->name) === $this->value); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Reflection/ReflectionLanguageConstructParameter.php --- a/vendor/psy/psysh/src/Psy/Reflection/ReflectionLanguageConstructParameter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Reflection/ReflectionLanguageConstructParameter.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,9 +24,9 @@ public function __construct($function, $parameter, array $opts) { - $this->function = $function; + $this->function = $function; $this->parameter = $parameter; - $this->opts = $opts; + $this->opts = $opts; } /** diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Shell.php --- a/vendor/psy/psysh/src/Psy/Shell.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Shell.php Fri Feb 23 15:52:07 2018 +0000 @@ -44,7 +44,7 @@ */ class Shell extends Application { - const VERSION = 'v0.8.15'; + const VERSION = 'v0.8.17'; const PROMPT = '>>> '; const BUFF_PROMPT = '... '; @@ -75,13 +75,13 @@ */ public function __construct(Configuration $config = null) { - $this->config = $config ?: new Configuration(); - $this->cleaner = $this->config->getCodeCleaner(); - $this->loop = $this->config->getLoop(); - $this->context = new Context(); - $this->includes = array(); - $this->readline = $this->config->getReadline(); - $this->inputBuffer = array(); + $this->config = $config ?: new Configuration(); + $this->cleaner = $this->config->getCodeCleaner(); + $this->loop = $this->config->getLoop(); + $this->context = new Context(); + $this->includes = array(); + $this->readline = $this->config->getReadline(); + $this->inputBuffer = array(); $this->stdoutBuffer = ''; parent::__construct('Psy Shell', self::VERSION); @@ -1013,7 +1013,7 @@ try { $client = $this->config->getChecker(); if (!$client->isLatest()) { - $this->output->writeln(sprintf('New version is available (current: %s, latest: %s)',self::VERSION, $client->getLatest())); + $this->output->writeln(sprintf('New version is available (current: %s, latest: %s)', self::VERSION, $client->getLatest())); } } catch (\InvalidArgumentException $e) { $this->output->writeln($e->getMessage()); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/Sudo/SudoVisitor.php --- a/vendor/psy/psysh/src/Psy/Sudo/SudoVisitor.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/Sudo/SudoVisitor.php Fri Feb 23 15:52:07 2018 +0000 @@ -55,7 +55,7 @@ return $this->prepareCall(self::PROPERTY_FETCH, $args); } elseif ($node instanceof Assign && $node->var instanceof PropertyFetch) { $target = $node->var; - $args = array( + $args = array( $target->var, is_string($target->name) ? new String_($target->name) : $target->name, $node->expr, @@ -71,7 +71,7 @@ return new StaticCall(new FullyQualifiedName(self::SUDO_CLASS), self::METHOD_CALL, $args); } elseif ($node instanceof StaticPropertyFetch) { $class = $node->class instanceof Name ? (string) $node->class : $node->class; - $args = array( + $args = array( is_string($class) ? new String_($class) : $class, is_string($node->name) ? new String_($node->name) : $node->name, ); @@ -79,8 +79,8 @@ return $this->prepareCall(self::STATIC_PROPERTY_FETCH, $args); } elseif ($node instanceof Assign && $node->var instanceof StaticPropertyFetch) { $target = $node->var; - $class = $target->class instanceof Name ? (string) $target->class : $target->class; - $args = array( + $class = $target->class instanceof Name ? (string) $target->class : $target->class; + $args = array( is_string($class) ? new String_($class) : $class, is_string($target->name) ? new String_($target->name) : $target->name, $node->expr, @@ -88,7 +88,7 @@ return $this->prepareCall(self::STATIC_PROPERTY_ASSIGN, $args); } elseif ($node instanceof StaticCall) { - $args = $node->args; + $args = $node->args; $class = $node->class instanceof Name ? (string) $node->class : $node->class; array_unshift($args, new Arg(is_string($node->name) ? new String_($node->name) : $node->name)); array_unshift($args, new Arg(is_string($class) ? new String_($class) : $class)); @@ -97,7 +97,7 @@ return new StaticCall(new FullyQualifiedName(self::SUDO_CLASS), self::STATIC_CALL, $args); } elseif ($node instanceof ClassConstFetch) { $class = $node->class instanceof Name ? (string) $node->class : $node->class; - $args = array( + $args = array( is_string($class) ? new String_($class) : $class, is_string($node->name) ? new String_($node->name) : $node->name, ); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/AbstractDefaultParametersMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/AbstractDefaultParametersMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/AbstractDefaultParametersMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -62,7 +62,7 @@ foreach ($value as $key => $item) { $allSequential = $allSequential && is_numeric($key) && $key === count($chunksSequential); - $keyString = $this->valueToShortString($key); + $keyString = $this->valueToShortString($key); $itemString = $this->valueToShortString($item); $chunks[] = "{$keyString} => {$itemString}"; diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassAttributesMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassAttributesMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassAttributesMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -70,7 +70,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassMethodDefaultParametersMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassMethodDefaultParametersMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassMethodDefaultParametersMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,8 +15,8 @@ { public function getMatches(array $tokens, array $info = array()) { - $openBracket = array_pop($tokens); - $functionName = array_pop($tokens); + $openBracket = array_pop($tokens); + $functionName = array_pop($tokens); $methodOperator = array_pop($tokens); $class = $this->getNamespaceAndClass($tokens); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassMethodsMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassMethodsMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassMethodsMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -62,7 +62,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassNamesMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassNamesMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ClassNamesMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -53,7 +53,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); $blacklistedTokens = array( diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ConstantsMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ConstantsMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ConstantsMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,7 +37,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/FunctionsMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/FunctionsMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/FunctionsMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -27,7 +27,7 @@ { $func = $this->getInput($tokens); - $functions = get_defined_functions(); + $functions = get_defined_functions(); $allFunctions = array_merge($functions['user'], $functions['internal']); return array_filter($allFunctions, function ($function) use ($func) { @@ -40,7 +40,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/KeywordsMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/KeywordsMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/KeywordsMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -68,7 +68,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/MongoClientMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/MongoClientMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/MongoClientMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,8 +33,8 @@ array_pop($tokens); } $objectToken = array_pop($tokens); - $objectName = str_replace('$', '', $objectToken[1]); - $object = $this->getVariable($objectName); + $objectName = str_replace('$', '', $objectToken[1]); + $object = $this->getVariable($objectName); if (!$object instanceof \MongoClient) { return array(); @@ -57,7 +57,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/MongoDatabaseMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/MongoDatabaseMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/MongoDatabaseMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,8 +33,8 @@ array_pop($tokens); } $objectToken = array_pop($tokens); - $objectName = str_replace('$', '', $objectToken[1]); - $object = $this->getVariable($objectName); + $objectName = str_replace('$', '', $objectToken[1]); + $object = $this->getVariable($objectName); if (!$object instanceof \MongoDB) { return array(); @@ -53,7 +53,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectAttributesMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectAttributesMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectAttributesMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -64,7 +64,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectMethodDefaultParametersMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectMethodDefaultParametersMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectMethodDefaultParametersMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,8 +15,8 @@ { public function getMatches(array $tokens, array $info = array()) { - $openBracket = array_pop($tokens); - $functionName = array_pop($tokens); + $openBracket = array_pop($tokens); + $functionName = array_pop($tokens); $methodOperator = array_pop($tokens); $objectToken = array_pop($tokens); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectMethodsMatcher.php --- a/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectMethodsMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/TabCompletion/Matcher/ObjectMethodsMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -66,7 +66,7 @@ */ public function hasMatched(array $tokens) { - $token = array_pop($tokens); + $token = array_pop($tokens); $prevToken = array_pop($tokens); switch (true) { diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/VarDumper/Dumper.php --- a/vendor/psy/psysh/src/Psy/VarDumper/Dumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/VarDumper/Dumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,8 +24,8 @@ private $forceArrayIndexes; protected static $onlyControlCharsRx = '/^[\x00-\x1F\x7F]+$/'; - protected static $controlCharsRx = '/([\x00-\x1F\x7F]+)/'; - protected static $controlCharsMap = array( + protected static $controlCharsRx = '/([\x00-\x1F\x7F]+)/'; + protected static $controlCharsMap = array( "\0" => '\0', "\t" => '\t', "\n" => '\n', diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/VersionUpdater/Checker.php --- a/vendor/psy/psysh/src/Psy/VersionUpdater/Checker.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/VersionUpdater/Checker.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,11 +13,11 @@ interface Checker { - const ALWAYS = 'always'; - const DAILY = 'daily'; - const WEEKLY = 'weekly'; + const ALWAYS = 'always'; + const DAILY = 'daily'; + const WEEKLY = 'weekly'; const MONTHLY = 'monthly'; - const NEVER = 'never'; + const NEVER = 'never'; /** * @return bool diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/src/Psy/VersionUpdater/IntervalChecker.php --- a/vendor/psy/psysh/src/Psy/VersionUpdater/IntervalChecker.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/src/Psy/VersionUpdater/IntervalChecker.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,7 +21,7 @@ public function __construct($cacheFile, $interval) { $this->cacheFile = $cacheFile; - $this->interval = $interval; + $this->interval = $interval; } public function fetchLatestRelease() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/AbstractClassPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/AbstractClassPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/AbstractClassPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,6 +49,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/AssignThisVariablePassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/AssignThisVariablePassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/AssignThisVariablePassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -48,6 +48,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/CallTimePassByReferencePassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/CallTimePassByReferencePassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/CallTimePassByReferencePassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,6 +54,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/CalledClassPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/CalledClassPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/CalledClassPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,6 +54,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() @@ -84,6 +87,9 @@ $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validTraitStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/FinalClassPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/FinalClassPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/FinalClassPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -56,6 +56,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/FunctionContextPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/FunctionContextPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/FunctionContextPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,6 +30,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/ImplicitReturnPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ImplicitReturnPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ImplicitReturnPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,7 +37,7 @@ ); $from = 'if (true) { 1; } elseif (true) { 2; } else { 3; }'; - $to = <<<'EOS' + $to = <<<'EOS' if (true) { return 1; } elseif (true) { @@ -50,7 +50,7 @@ $values[] = array($from, $to); $from = 'class A {}'; - $to = <<<'EOS' + $to = <<<'EOS' class A { } diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/InstanceOfPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/InstanceOfPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/InstanceOfPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,6 +54,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/LeavePsyshAlonePassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/LeavePsyshAlonePassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/LeavePsyshAlonePassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,6 +24,9 @@ { $inline = $this->parse('not php at all!', ''); $this->traverse($inline); + + // @todo a better thing to assert here? + $this->assertTrue(true); } /** @@ -33,6 +36,9 @@ { $stmts = $this->parse($code); $this->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/LegacyEmptyPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/LegacyEmptyPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/LegacyEmptyPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -55,6 +55,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/LoopContextPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/LoopContextPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/LoopContextPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -106,6 +106,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/PassableByReferencePassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/PassableByReferencePassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/PassableByReferencePassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,6 +49,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() @@ -69,6 +72,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validArrayMultisort() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/StaticConstructorPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/StaticConstructorPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/StaticConstructorPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -73,6 +73,9 @@ { $stmts = $this->parse($code); $this->traverser->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function validStatements() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidClassNamePassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidClassNamePassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidClassNamePassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -129,6 +129,9 @@ { $stmts = $this->parse($code); $this->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function getValid() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidConstantPassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidConstantPassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidConstantPassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -48,6 +48,9 @@ { $stmts = $this->parse($code); $this->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function getValidReferences() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidFunctionNamePassTest.php --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidFunctionNamePassTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ValidFunctionNamePassTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -69,6 +69,9 @@ { $stmts = $this->parse($code); $this->traverse($stmts); + + // @todo a better thing to assert here? + $this->assertTrue(true); } public function getValidFunctions() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/ConfigurationTest.php --- a/vendor/psy/psysh/test/Psy/Test/ConfigurationTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/ConfigurationTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -238,21 +238,19 @@ $this->assertEquals($colorMode, $config->colorMode()); } + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage invalid color mode: some invalid mode + */ public function testSetColorModeInvalid() { $config = $this->getConfig(); - $colorMode = 'some invalid mode'; - - $this->setExpectedException( - '\InvalidArgumentException', - 'invalid color mode: some invalid mode' - ); - $config->setColorMode($colorMode); + $config->setColorMode('some invalid mode'); } public function testSetCheckerValid() { - $config = $this->getConfig(); + $config = $this->getConfig(); $checker = new GitHubChecker(); $config->setChecker($checker); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/ConsoleColorFactoryTest.php --- a/vendor/psy/psysh/test/Psy/Test/ConsoleColorFactoryTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/ConsoleColorFactoryTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -19,9 +19,9 @@ public function testGetConsoleColorAuto() { $colorMode = Configuration::COLOR_MODE_AUTO; - $factory = new ConsoleColorFactory($colorMode); - $colors = $factory->getConsoleColor(); - $themes = $colors->getThemes(); + $factory = new ConsoleColorFactory($colorMode); + $colors = $factory->getConsoleColor(); + $themes = $colors->getThemes(); $this->assertFalse($colors->isStyleForced()); $this->assertEquals(array('blue'), $themes['line_number']); @@ -30,9 +30,9 @@ public function testGetConsoleColorForced() { $colorMode = Configuration::COLOR_MODE_FORCED; - $factory = new ConsoleColorFactory($colorMode); - $colors = $factory->getConsoleColor(); - $themes = $colors->getThemes(); + $factory = new ConsoleColorFactory($colorMode); + $colors = $factory->getConsoleColor(); + $themes = $colors->getThemes(); $this->assertTrue($colors->isStyleForced()); $this->assertEquals(array('blue'), $themes['line_number']); @@ -41,9 +41,9 @@ public function testGetConsoleColorDisabled() { $colorMode = Configuration::COLOR_MODE_DISABLED; - $factory = new ConsoleColorFactory($colorMode); - $colors = $factory->getConsoleColor(); - $themes = $colors->getThemes(); + $factory = new ConsoleColorFactory($colorMode); + $colors = $factory->getConsoleColor(); + $themes = $colors->getThemes(); $this->assertFalse($colors->isStyleForced()); $this->assertEquals(array('none'), $themes['line_number']); diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/Formatter/SignatureFormatterTest.php --- a/vendor/psy/psysh/test/Psy/Test/Formatter/SignatureFormatterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/Formatter/SignatureFormatterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,13 +35,6 @@ { return array( array( - new \ReflectionClass($this), - "class Psy\Test\Formatter\SignatureFormatterTest " - . 'extends PHPUnit\Framework\TestCase implements ' - . 'Countable, PHPUnit_Framework_SelfDescribing, ' - . 'PHPUnit_Framework_Test', - ), - array( new \ReflectionFunction('implode'), defined('HHVM_VERSION') ? 'function implode($arg1, $arg2 = null)' : 'function implode($glue, $pieces)', ), diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/ShellTest.php --- a/vendor/psy/psysh/test/Psy/Test/ShellTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/ShellTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -241,7 +241,7 @@ $shell->flushCode(); $code = '$test()'; $shell->addCode($code); - $shell->flushCode(); + $this->assertEquals($shell->flushCode(), 'return $test();'); } public function testWriteStdout() diff -r bfffd8d7479a -r 7a779792577d vendor/psy/psysh/test/Psy/Test/Util/StrTest.php --- a/vendor/psy/psysh/test/Psy/Test/Util/StrTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/psy/psysh/test/Psy/Test/Util/StrTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,14 +16,14 @@ class StrTest extends \PHPUnit\Framework\TestCase { /** - * @dataProvider testUnvisProvider + * @dataProvider unvisProvider */ public function testUnvis($input, $expected) { $this->assertEquals($expected, Str::unvis($input)); } - public function testUnvisProvider() + public function unvisProvider() { //return require_once(__DIR__.'/../../../fixtures/unvis_fixtures.php'); return json_decode(file_get_contents(__DIR__ . '/../../../fixtures/unvis_fixtures.json')); diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/.gitignore --- a/vendor/sebastian/diff/.gitignore Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/.gitignore Fri Feb 23 15:52:07 2018 +0000 @@ -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 -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/.php_cs --- a/vendor/sebastian/diff/.php_cs Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/.php_cs Fri Feb 23 15:52:07 2018 +0000 @@ -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' - ) +(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, + ] ) - ->finder($finder); - + ->setFinder( + PhpCsFixer\Finder::create() + ->files() + ->in(__DIR__ . '/src') + ->in(__DIR__ . '/tests') + ->name('*.php') + ); diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/.travis.yml --- a/vendor/sebastian/diff/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -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 -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/LICENSE --- a/vendor/sebastian/diff/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -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 -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/README.md --- a/vendor/sebastian/diff/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -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 -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/build.xml --- a/vendor/sebastian/diff/build.xml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/build.xml Fri Feb 23 15:52:07 2018 +0000 @@ -1,26 +1,22 @@ - - - - - + + - - - - - - - - - - + + + + - + + + + + + + + + + + + - - - - - - diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/composer.json --- a/vendor/sebastian/diff/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -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 -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/phpunit.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/sebastian/diff/phpunit.xml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,19 @@ + + + + tests + + + + + src + + + diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/phpunit.xml.dist --- a/vendor/sebastian/diff/phpunit.xml.dist Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - - tests - - - - - src - - - - diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/src/Chunk.php --- a/vendor/sebastian/diff/src/Chunk.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/src/Chunk.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,6 @@ * @@ -10,8 +10,6 @@ namespace SebastianBergmann\Diff; -/** - */ class Chunk { /** @@ -28,6 +26,7 @@ * @var int */ private $end; + /** * @var int */ diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/src/Diff.php --- a/vendor/sebastian/diff/src/Diff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/src/Diff.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,6 @@ * @@ -10,8 +10,6 @@ namespace SebastianBergmann\Diff; -/** - */ class Diff { /** diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/src/Differ.php --- a/vendor/sebastian/diff/src/Differ.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/src/Differ.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,6 @@ * @@ -31,6 +31,7 @@ /** * @param string $header + * @param bool $showNonDiffLines */ public function __construct($header = "--- Original\n+++ New\n", $showNonDiffLines = true) { @@ -49,23 +50,52 @@ */ 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,35 +110,34 @@ ++$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; + + if (!isset($old[$start])) { + $buffer = $this->getDiffBufferElementNew($diff, $buffer, $start); + ++$start; } - $newChunk = true; - for ($i = $start; $i < $end; $i++) { if (isset($old[$i])) { - $buffer .= "\n"; - $newChunk = true; - $i = $old[$i]; - } - - if ($newChunk) { - if ($this->showNonDiffLines === true) { - $buffer .= "@@ @@\n"; - } - $newChunk = false; - } - - 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"; + $i = $old[$i]; + $buffer = $this->getDiffBufferElementNew($diff, $buffer, $i); + } else { + $buffer = $this->getDiffBufferElement($diff, $buffer, $i); } } @@ -116,10 +145,50 @@ } /** + * 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 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 @@ $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 */); } @@ -224,6 +275,32 @@ } /** + * 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 @@ * @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); + 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 array($from, $to, $start, $end); } } diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/src/LCS/LongestCommonSubsequence.php --- a/vendor/sebastian/diff/src/LCS/LongestCommonSubsequence.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/src/LCS/LongestCommonSubsequence.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,6 @@ * diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php --- a/vendor/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,6 @@ * @@ -25,43 +25,45 @@ */ 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]; - - if ($m >= $max) { - $max = $m; - $jMax = $j; - } } - $toStart = array_slice($to, 0, $jMax); - $toEnd = array_slice($to, $jMax); + return array(); + } - return array_merge( - $this->calculate($fromStart, $toStart), - $this->calculate($fromEnd, $toEnd) - ); + $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; + + for ($j = 0; $j <= $cTo; $j++) { + $m = $llB[$j] + $llE[$cTo - $j]; + + 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 @@ */ 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 -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php --- a/vendor/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,6 @@ * @@ -26,8 +26,8 @@ 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 @@ 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 @@ $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 @@ } } - return array_reverse($common); + return \array_reverse($common); } } diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/src/Line.php --- a/vendor/sebastian/diff/src/Line.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/src/Line.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,6 @@ * @@ -10,8 +10,6 @@ namespace SebastianBergmann\Diff; -/** - */ class Line { const ADDED = 1; diff -r bfffd8d7479a -r 7a779792577d vendor/sebastian/diff/src/Parser.php --- a/vendor/sebastian/diff/src/Parser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/sebastian/diff/src/Parser.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,6 @@ * @@ -22,33 +22,42 @@ */ 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 @@ 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 -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer.php Fri Feb 23 15:52:07 2018 +0000 @@ -73,7 +73,7 @@ * * @var string */ - const VERSION = '2.8.1'; + const VERSION = '2.9.1'; /** * Package stability; either stable, beta or alpha. @@ -1801,7 +1801,7 @@ $this ); - $phpcsFile->addError($error, null); + $phpcsFile->addError($error, null, 'Internal.Exception'); }//end try $cliValues = $this->cli->getCommandLineValues(); diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/File.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/File.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/File.php Fri Feb 23 15:52:07 2018 +0000 @@ -1539,7 +1539,7 @@ $numTabs = strlen($tokens[$i]['content']); $newContent = ''; - $firstTabSize = ($tabWidth - ($currColumn % $tabWidth) + 1); + $firstTabSize = ($tabWidth - (($currColumn - 1) % $tabWidth)); $length = ($firstTabSize + ($tabWidth * ($numTabs - 1))); $currColumn += $length; $newContent = str_repeat(' ', $length); @@ -2258,7 +2258,7 @@ // current scope opener, so it must be a string offset. if (PHP_CODESNIFFER_VERBOSITY > 1) { echo str_repeat("\t", $depth); - echo '* ignoring curly brace *'.PHP_EOL; + echo '* ignoring curly brace inside condition *'.PHP_EOL; } $ignore++; @@ -2269,15 +2269,21 @@ if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$tokens[$x]['code']]) === true) { continue; } else { - // If the first non-whitespace/comment token is a - // variable or object operator then this is an opener - // for a string offset and not a scope. - if ($tokens[$x]['code'] === T_VARIABLE - || $tokens[$x]['code'] === T_OBJECT_OPERATOR - ) { + // If the first non-whitespace/comment token looks like this + // brace is a string offset, or this brace is mid-way through + // a new statement, it isn't a scope opener. + $disallowed = PHP_CodeSniffer_Tokens::$assignmentTokens; + $disallowed += array( + T_VARIABLE => true, + T_OBJECT_OPERATOR => true, + T_COMMA => true, + T_OPEN_PARENTHESIS => true, + ); + + if (isset($disallowed[$tokens[$x]['code']]) === true) { if (PHP_CODESNIFFER_VERBOSITY > 1) { echo str_repeat("\t", $depth); - echo '* ignoring curly brace *'.PHP_EOL; + echo '* ignoring curly brace after condition *'.PHP_EOL; } $ignore++; @@ -2653,13 +2659,13 @@ * Returns the declaration names for classes, interfaces, and functions. * * @param int $stackPtr The position of the declaration token which - * declared the class, interface or function. + * declared the class, interface, trait or function. * * @return string|null The name of the class, interface or function. * or NULL if the function or class is anonymous. * @throws PHP_CodeSniffer_Exception If the specified token is not of type * T_FUNCTION, T_CLASS, T_ANON_CLASS, - * or T_INTERFACE. + * T_TRAIT or T_INTERFACE. */ public function getDeclarationName($stackPtr) { @@ -2669,9 +2675,7 @@ return null; } - if ($tokenCode === T_FUNCTION - && $this->isAnonymousFunction($stackPtr) === true - ) { + if ($tokenCode === T_CLOSURE) { return null; } @@ -2752,6 +2756,7 @@ * 'name' => '$var', // The variable name. * 'content' => string, // The full content of the variable definition. * 'pass_by_reference' => boolean, // Is the variable passed by reference? + * 'variable_length' => boolean, // Is the param of variable length through use of `...` ? * 'type_hint' => string, // The type hint for the variable. * 'nullable_type' => boolean, // Is the variable using a nullable type? * ) diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/AbstractPatternSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/AbstractPatternSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/AbstractPatternSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -251,7 +251,7 @@ } foreach ($allErrors as $stackPtr => $error) { - $phpcsFile->addError($error, $stackPtr); + $phpcsFile->addError($error, $stackPtr, 'Found'); } }//end process() diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -74,7 +74,7 @@ $openingBrace = $tokens[$stackPtr]['scope_opener']; // Is the brace on the same line as the class/interface/trait declaration ? - $lastClassLineToken = $phpcsFile->findPrevious(T_STRING, ($openingBrace - 1), $stackPtr); + $lastClassLineToken = $phpcsFile->findPrevious(T_WHITESPACE, ($openingBrace - 1), $stackPtr, true); $lastClassLine = $tokens[$lastClassLineToken]['line']; $braceLine = $tokens[$openingBrace]['line']; $lineDifference = ($braceLine - $lastClassLine); diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/ESLintSniff.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/ESLintSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,121 @@ + + * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * Generic_Sniffs_Debug_ESLintSniff. + * + * Runs eslint on the file. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Ryan McCue + * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHP_CodeSniffer + */ +class Generic_Sniffs_Debug_ESLintSniff implements PHP_CodeSniffer_Sniff +{ + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = array('JS'); + + + /** + * ESLint configuration file path. + * + * @var string|null Path to eslintrc. Null to autodetect. + */ + public $configFile = null; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return int[] + */ + public function register() + { + return array(T_OPEN_TAG); + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param PHP_CodeSniffer_File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $filename = $phpcsFile->getFilename(); + $eslintPath = PHP_CodeSniffer::getConfigData('eslint_path'); + if ($eslintPath === null) { + return; + } + + $configFile = $this->configFile; + if (empty($configFile) === true) { + // Attempt to autodetect. + $candidates = glob('.eslintrc{.js,.yaml,.yml,.json}', GLOB_BRACE); + if (empty($candidates) === false) { + $configFile = $candidates[0]; + } + } + + $eslintOptions = array('--format json'); + if (empty($configFile) === false) { + $eslintOptions[] = '--config '.escapeshellarg($configFile); + } + + $cmd = escapeshellcmd(escapeshellarg($eslintPath).' '.implode(' ', $eslintOptions).' '.escapeshellarg($filename)); + + // Execute! + exec($cmd, $stdout, $code); + + if ($code <= 0) { + // No errors, continue. + return ($phpcsFile->numTokens + 1); + } + + $data = json_decode(implode("\n", $stdout)); + if (json_last_error() !== JSON_ERROR_NONE) { + // Ignore any errors. + return ($phpcsFile->numTokens + 1); + } + + // Data is a list of files, but we only pass a single one. + $messages = $data[0]->messages; + foreach ($messages as $error) { + if (empty($error->fatal) === false || $error->severity === 2) { + $phpcsFile->addErrorOnLine($error->message, $error->line, $error->ruleId); + } else { + $phpcsFile->addWarningOnLine($error->message, $error->line, $error->ruleId); + } + } + + // Ignore the rest of the file. + return ($phpcsFile->numTokens + 1); + + }//end process() + + +}//end class diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,8 +20,8 @@ /** * Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff. * - * Ensures method names are correct depending on whether they are public - * or private, and that functions are named correctly. + * Ensures method names and function names are in CamelCaps and + * that only magic methods/functions start with a double underscore. * * @category PHP * @package PHP_CodeSniffer diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -160,13 +160,13 @@ if ($openTag['code'] === T_INLINE_HTML && $this->_aspTags === false) { if (strpos($content, '<%=') !== false) { - $error = 'Possible use of ASP style short opening tags detected. Needs manual inspection. Found: %s'; + $error = 'Possible use of ASP style short opening tags detected; found: %s'; $snippet = $this->getSnippet($content, '<%='); $data = array('<%='.$snippet); $phpcsFile->addWarning($error, $stackPtr, 'MaybeASPShortOpenTagFound', $data); } else if (strpos($content, '<%') !== false) { - $error = 'Possible use of ASP style opening tags detected. Needs manual inspection. Found: %s'; + $error = 'Possible use of ASP style opening tags detected; found: %s'; $snippet = $this->getSnippet($content, '<%'); $data = array('<%'.$snippet); @@ -180,25 +180,25 @@ /** * Get a snippet from a HTML token. * - * @param string $content The content of the HTML token. - * @param string $start_at Partial string to use as a starting point for the snippet. - * @param int $length The target length of the snippet to get. Defaults to 40. + * @param string $content The content of the HTML token. + * @param string $start Partial string to use as a starting point for the snippet. + * @param int $length The target length of the snippet to get. Defaults to 40. * * @return string */ - protected function getSnippet($content, $start_at = '', $length = 40) + protected function getSnippet($content, $start='', $length=40) { - $start_pos = 0; + $startPos = 0; - if ($start_at !== '') { - $start_pos = strpos($content, $start_at); - if ($start_pos !== false) { - $start_pos += strlen($start_at); + if ($start !== '') { + $startPos = strpos($content, $start); + if ($startPos !== false) { + $startPos += strlen($start); } } - $snippet = substr($content, $start_pos, $length); - if ((strlen($content) - $start_pos) > $length) { + $snippet = substr($content, $startPos, $length); + if ((strlen($content) - $startPos) > $length) { $snippet .= '...'; } diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,10 +38,17 @@ */ public function register() { - return array( - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ); + $targets = array( + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ); + + $shortOpenTags = (boolean) ini_get('short_open_tag'); + if ($shortOpenTags === false) { + $targets[] = T_INLINE_HTML; + } + + return $targets; }//end register() @@ -57,15 +64,21 @@ */ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); - $openTag = $tokens[$stackPtr]; + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$stackPtr]; - if ($openTag['content'] === 'addFixableError($error, $stackPtr, 'Found', $data); if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'fixer->replaceToken($stackPtr, $correctOpening); } $phpcsFile->recordMetric($stackPtr, 'PHP short open tag used', 'yes'); @@ -73,12 +86,12 @@ $phpcsFile->recordMetric($stackPtr, 'PHP short open tag used', 'no'); } - if ($openTag['code'] === T_OPEN_TAG_WITH_ECHO) { + if ($token['code'] === T_OPEN_TAG_WITH_ECHO) { $nextVar = $tokens[$phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true)]; $error = 'Short PHP opening tag used with echo; expected "addFixableError($error, $stackPtr, 'EchoFound', $data); @@ -91,7 +104,79 @@ } } + if ($token['code'] === T_INLINE_HTML) { + $content = $token['content']; + $openerFound = strpos($content, 'numTokens; $i++) { + if ($tokens[$i]['code'] !== T_INLINE_HTML) { + break; + } + + $closerFound = strrpos($tokens[$i]['content'], '?>'); + if ($closerFound !== false) { + if ($i !== $stackPtr) { + break; + } else if ($closerFound > $openerFound) { + break; + } else { + $closerFound = false; + } + } + } + + if ($closerFound !== false) { + $error = 'Possible use of short open tags detected; found: %s'; + $snippet = $this->getSnippet($content, 'addWarning($error, $stackPtr, 'PossibleFound', $data); + + // Skip forward to the token containing the closer. + if (($i - 1) > $stackPtr) { + return $i; + } + } + }//end if + }//end process() + /** + * Get a snippet from a HTML token. + * + * @param string $content The content of the HTML token. + * @param string $start Partial string to use as a starting point for the snippet. + * @param int $length The target length of the snippet to get. Defaults to 40. + * + * @return string + */ + protected function getSnippet($content, $start='', $length=40) + { + $startPos = 0; + + if ($start !== '') { + $startPos = strpos($content, $start); + if ($startPos !== false) { + $startPos += strlen($start); + } + } + + $snippet = substr($content, $startPos, $length); + if ((strlen($content) - $startPos) > $length) { + $snippet .= '...'; + } + + return $snippet; + + }//end getSnippet() + + }//end class diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,7 +15,7 @@ /** * Generic_Sniffs_WhiteSpace_DisallowSpaceIndentSniff. * - * Throws errors if spaces are used for indentation. + * Throws errors if spaces are used for indentation other than precision indentation. * * @category PHP * @package PHP_CodeSniffer @@ -94,42 +94,85 @@ continue; } - // If tabs are being converted to spaces, the original content - // should be used instead of the converted content. + // If tabs are being converted to spaces by the tokeniser, the + // original content should be checked instead of the converted content. if (isset($tokens[$i]['orig_content']) === true) { $content = $tokens[$i]['orig_content']; } else { $content = $tokens[$i]['content']; } - if ($content[0] === ' ') { - if ($tokens[$i]['code'] === T_DOC_COMMENT_WHITESPACE && $content === ' ') { - // Ignore file/class-level DocBlock. + // If this is an inline HTML token, split the content into + // indentation whitespace and the actual HTML/text. + $nonWhitespace = ''; + if ($tokens[$i]['code'] === T_INLINE_HTML && preg_match('`^(\s*)(\S.*)`s', $content, $matches) > 0) { + if (isset($matches[1]) === true) { + $content = $matches[1]; + } + + if (isset($matches[2]) === true) { + $nonWhitespace = $matches[2]; + } + } + + $hasSpaces = strpos($content, ' '); + $hasTabs = strpos($content, "\t"); + + if ($hasSpaces === false && $hasTabs === false) { + // Empty line. + continue; + } + + if ($hasSpaces === false && $hasTabs !== false) { + // All ok, nothing to do. + $phpcsFile->recordMetric($i, 'Line indent', 'tabs'); + continue; + } + + if ($tokens[$i]['code'] === T_DOC_COMMENT_WHITESPACE && $content === ' ') { + // Ignore file/class-level DocBlock, especially for recording metrics. + continue; + } + + // OK, by now we know there will be spaces. + // We just don't know yet whether they need to be replaced or + // are precision indentation, nor whether they are correctly + // placed at the end of the whitespace. + $trimmed = str_replace(' ', '', $content); + $numSpaces = (strlen($content) - strlen($trimmed)); + $numTabs = (int) floor($numSpaces / $this->_tabWidth); + $tabAfterSpaces = strpos($content, "\t", $hasSpaces); + + if ($hasTabs === false) { + $phpcsFile->recordMetric($i, 'Line indent', 'spaces'); + + if ($numTabs === 0) { + // Ignore: precision indentation. continue; } + } else { + if ($numTabs === 0) { + // Precision indentation. + $phpcsFile->recordMetric($i, 'Line indent', 'tabs'); - // Space are considered ok if they are proceeded by tabs and not followed - // by tabs, as is the case with standard docblock comments. - $phpcsFile->recordMetric($i, 'Line indent', 'spaces'); - $error = 'Tabs must be used to indent lines; spaces are not allowed'; - $fix = $phpcsFile->addFixableError($error, $i, 'SpacesUsed'); - if ($fix === true) { - $trimmed = ltrim($content, ' '); - $numSpaces = (strlen($content) - strlen($trimmed)); - if ($numSpaces < $this->_tabWidth) { - $numTabs = 1; - $padding = "\t"; - } else { - $numTabs = floor($numSpaces / $this->_tabWidth); - $remaining = ($numSpaces - ($numTabs * $this->_tabWidth)); - $padding = str_repeat("\t", $numTabs).$padding = str_repeat(' ', $remaining); + if ($tabAfterSpaces === false) { + // Ignore: precision indentation is already at the + // end of the whitespace. + continue; } + } else { + $phpcsFile->recordMetric($i, 'Line indent', 'mixed'); + } + }//end if - $phpcsFile->fixer->replaceToken($i, $padding.$trimmed); - } - } else if ($content[0] === "\t") { - $phpcsFile->recordMetric($i, 'Line indent', 'tabs'); - }//end if + $error = 'Tabs must be used to indent lines; spaces are not allowed'; + $fix = $phpcsFile->addFixableError($error, $i, 'SpacesUsed'); + if ($fix === true) { + $remaining = ($numSpaces % $this->_tabWidth); + $padding = str_repeat("\t", $numTabs); + $padding .= str_repeat(' ', $remaining); + $phpcsFile->fixer->replaceToken($i, $trimmed.$padding.$nonWhitespace); + } }//end for // Ignore the rest of the file. diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -81,7 +81,7 @@ continue; } - // If tabs are being converted to spaces by PHPCS, the + // If tabs are being converted to spaces by the tokeniser, the // original content should be checked instead of the converted content. if (isset($tokens[$i]['orig_content']) === true) { $content = $tokens[$i]['orig_content']; diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -472,6 +472,8 @@ $type = $tokens[$first]['type']; echo "\t* amended first token is $first ($type) on line $line *".PHP_EOL; } + } else if ($tokens[$first]['code'] === T_WHITESPACE) { + $first = $phpcsFile->findNext(T_WHITESPACE, ($first + 1), null, true); } if (isset($tokens[$first]['scope_closer']) === true diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,6 +39,7 @@ return array( T_CLASS, T_INTERFACE, + T_TRAIT, ); }//end register() diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -166,7 +166,7 @@ $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'BreakIndent', $data); } } else { - $expectedIndent = ($startColumn - 1); + $expectedIndent = max(0, ($startColumn - 1)); if ($braceIndent !== $expectedIndent) { $error = 'Closing brace indented incorrectly; expected %s spaces, found %s'; $data = array( diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -305,7 +305,7 @@ $content = trim($tokens[$commentLines[$lastIndex]]['content']); if ($content !== '*/' && $content !== '**/') { $error = 'Comment closer must be on a new line'; - $phpcsFile->addError($error, $commentLines[$lastIndex]); + $phpcsFile->addError($error, $commentLines[$lastIndex], 'CloserSameLine'); } else { $content = $tokens[$commentLines[$lastIndex]]['content']; $commentText = ltrim($content); diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,10 +18,9 @@ * Verifies that : *
      *
    • A class doc comment exists.
    • - *
    • There is exactly one blank line before the class comment.
    • + *
    • The comment uses the correct docblock style.
    • *
    • There are no blank lines after the class comment.
    • - *
    • Short and long descriptions end with a full stop and start with capital letter.
    • - *
    • There is a blank line between descriptions.
    • + *
    • No tags are used in the docblock.
    • *
    * * @category PHP diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -107,12 +107,12 @@ return; } - $error = 'Expected '.$comment; + $data = array($comment); if (isset($tokens[($closingBracket + 1)]) === false || $tokens[($closingBracket + 1)]['code'] !== T_COMMENT) { $next = $phpcsFile->findNext(T_WHITESPACE, ($closingBracket + 1), null, true); if (rtrim($tokens[$next]['content']) === $comment) { // The comment isn't really missing; it is just in the wrong place. - $fix = $phpcsFile->addFixableError($error.' directly after closing brace', $closingBracket, 'Misplaced'); + $fix = $phpcsFile->addFixableError('Expected %s directly after closing brace', $closingBracket, 'Misplaced', $data); if ($fix === true) { $phpcsFile->fixer->beginChangeset(); for ($i = ($closingBracket + 1); $i < $next; $i++) { @@ -125,7 +125,7 @@ $phpcsFile->fixer->endChangeset(); } } else { - $fix = $phpcsFile->addFixableError($error, $closingBracket, 'Missing'); + $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Missing', $data); if ($fix === true) { $phpcsFile->fixer->replaceToken($closingBracket, '}'.$comment.$phpcsFile->eolChar); } @@ -135,7 +135,7 @@ }//end if if (rtrim($tokens[($closingBracket + 1)]['content']) !== $comment) { - $fix = $phpcsFile->addFixableError($error, $closingBracket, 'Incorrect'); + $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Incorrect', $data); if ($fix === true) { $phpcsFile->fixer->replaceToken(($closingBracket + 1), $comment.$phpcsFile->eolChar); } diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -133,6 +133,7 @@ if ($tokens[$returnToken]['code'] === T_RETURN || $tokens[$returnToken]['code'] === T_YIELD + || $tokens[$returnToken]['code'] === T_YIELD_FROM ) { break; } @@ -153,7 +154,7 @@ // somewhere in the function that returns something. if (isset($tokens[$stackPtr]['scope_closer']) === true) { $endToken = $tokens[$stackPtr]['scope_closer']; - $returnToken = $phpcsFile->findNext(array(T_RETURN, T_YIELD), $stackPtr, $endToken); + $returnToken = $phpcsFile->findNext(array(T_RETURN, T_YIELD, T_YIELD_FROM), $stackPtr, $endToken); if ($returnToken === false) { $error = 'Function return type is not void, but function has no return statement'; $phpcsFile->addError($error, $return, 'InvalidNoReturn'); @@ -393,16 +394,18 @@ $suggestedTypeHint = 'callable'; } else if (strpos($suggestedName, 'callback') !== false) { $suggestedTypeHint = 'callable'; - } else if (in_array($typeName, PHP_CodeSniffer::$allowedTypes) === false) { + } else if (in_array($suggestedName, PHP_CodeSniffer::$allowedTypes) === false) { $suggestedTypeHint = $suggestedName; - } else if ($this->_phpVersion >= 70000) { - if ($typeName === 'string') { + } + + if ($this->_phpVersion >= 70000) { + if ($suggestedName === 'string') { $suggestedTypeHint = 'string'; - } else if ($typeName === 'int' || $typeName === 'integer') { + } else if ($suggestedName === 'int' || $suggestedName === 'integer') { $suggestedTypeHint = 'int'; - } else if ($typeName === 'float') { + } else if ($suggestedName === 'float') { $suggestedTypeHint = 'float'; - } else if ($typeName === 'bool' || $typeName === 'boolean') { + } else if ($suggestedName === 'bool' || $suggestedName === 'boolean') { $suggestedTypeHint = 'bool'; } } diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -96,8 +96,15 @@ /* If we can't find a NEW, we are probably throwing - a variable, so we ignore it, but they still need to - provide at least one @throws tag, even through we + a variable. + + If we're throwing the same variable as the exception container + from the nearest 'catch' block, we take that exception, as it is + likely to be a re-throw. + + If we can't find a matching catch block, or the variable name + is different, it's probably a different variable, so we ignore it, + but they still need to provide at least one @throws tag, even through we don't know the exception class. */ @@ -134,6 +141,60 @@ $throwTokens[] = $phpcsFile->getTokensAsString($currException, ($endException - $currException)); } }//end if + } else if ($tokens[$nextToken]['code'] === T_VARIABLE) { + // Find where the nearest 'catch' block in this scope. + $catch = $phpcsFile->findPrevious( + T_CATCH, + $currPos, + $tokens[$currScope]['scope_opener'], + false, + null, + false + ); + + if ($catch !== false) { + // Get the start of the 'catch' exception. + $currException = $phpcsFile->findNext( + array( + T_NS_SEPARATOR, + T_STRING, + ), + $tokens[$catch]['parenthesis_opener'], + $tokens[$catch]['parenthesis_closer'], + false, + null, + true + ); + + if ($currException !== false) { + // Find the next whitespace (which should be the end of the exception). + $endException = $phpcsFile->findNext( + T_WHITESPACE, + ($currException + 1), + $tokens[$catch]['parenthesis_closer'], + false, + null, + true + ); + + if ($endException !== false) { + // Find the variable that we're catching into. + $thrownVar = $phpcsFile->findNext( + T_VARIABLE, + ($endException + 1), + $tokens[$catch]["parenthesis_closer"], + false, + null, + true + ); + + // Sanity check that the variable that the exception is caught into is the one that's thrown. + if ($tokens[$thrownVar]['content'] === $tokens[$nextToken]['content']) { + $throwTokens[] = $phpcsFile->getTokensAsString($currException, ($endException - $currException)); + }//end if + }//end if + }//end if + }//end if }//end if }//end if diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -232,13 +232,21 @@ || $tokens[$stackPtr]['code'] === T_ELSEIF || $tokens[$stackPtr]['code'] === T_CATCH ) { + if (isset($tokens[$stackPtr]['scope_opener']) === true + && $tokens[$tokens[$stackPtr]['scope_opener']]['code'] === T_COLON + ) { + // Special case for alternate syntax, where this token is actually + // the closer for the previous block, so there is no spacing to check. + return; + } + $closer = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 1), null, true); if ($closer === false || $tokens[$closer]['code'] !== T_CLOSE_CURLY_BRACKET) { return; } } else { return; - } + }//end if // Single space after closing brace. $found = 1; diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -230,7 +230,7 @@ } $error .= " operators should be used where possible; found \"$found\" but expected \"$expected\""; - $phpcsFile->addError($error, $stackPtr); + $phpcsFile->addError($error, $stackPtr, 'Found'); }//end if }//end processAssignment() diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -124,7 +124,9 @@ // Ignore member var definitions. $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($varToken - 1), null, true); - if (isset(PHP_CodeSniffer_Tokens::$scopeModifiers[$tokens[$prev]['code']]) === true) { + if (isset(PHP_CodeSniffer_Tokens::$scopeModifiers[$tokens[$prev]['code']]) === true + || $tokens[$prev]['code'] === T_VAR + ) { return; } diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -153,6 +153,12 @@ $currentLine = $tokens[$stackPtr]['line']; $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, $prevLineToken, null, true); + if ($tokens[$prevContent]['code'] === T_COMMENT) { + // Ignore comments as they can have different spacing rules, and this + // isn't a proper function comment anyway. + return; + } + if ($tokens[$prevContent]['code'] === T_DOC_COMMENT_CLOSE_TAG && $tokens[$prevContent]['line'] === ($currentLine - 1) ) { diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -84,6 +84,7 @@ $tokens = $phpcsFile->getTokens(); // Skip default values in function declarations. + // Skip declare statements. if ($tokens[$stackPtr]['code'] === T_EQUAL || $tokens[$stackPtr]['code'] === T_MINUS ) { @@ -94,6 +95,7 @@ $function = $tokens[$bracket]['parenthesis_owner']; if ($tokens[$function]['code'] === T_FUNCTION || $tokens[$function]['code'] === T_CLOSURE + || $tokens[$function]['code'] === T_DECLARE ) { return; } diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php Fri Feb 23 15:52:07 2018 +0000 @@ -66,7 +66,7 @@ // as if this is a method with tokens before it (public, static etc) // or an if with an else before it, then we need to start the scope // checking from there, rather than the current token. - $lineStart = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); + $lineStart = $phpcsFile->findFirstOnLine(array(T_WHITESPACE, T_INLINE_HTML), $stackPtr, true); $startColumn = $tokens[$lineStart]['column']; $scopeStart = $tokens[$stackPtr]['scope_opener']; @@ -85,7 +85,7 @@ } // Check now that the closing brace is lined up correctly. - $lineStart = $phpcsFile->findFirstOnLine(T_WHITESPACE, $scopeEnd, true); + $lineStart = $phpcsFile->findFirstOnLine(array(T_WHITESPACE, T_INLINE_HTML), $scopeEnd, true); $braceIndent = $tokens[$lineStart]['column']; if ($tokens[$stackPtr]['code'] !== T_DEFAULT && $tokens[$stackPtr]['code'] !== T_CASE @@ -101,9 +101,9 @@ if ($fix === true) { $diff = ($startColumn - $braceIndent); if ($diff > 0) { - $phpcsFile->fixer->addContentBefore($scopeEnd, str_repeat(' ', $diff)); + $phpcsFile->fixer->addContentBefore($lineStart, str_repeat(' ', $diff)); } else { - $phpcsFile->fixer->substrToken(($scopeEnd - 1), 0, $diff); + $phpcsFile->fixer->substrToken(($lineStart - 1), 0, $diff); } } }//end if diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/PHP.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/PHP.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/PHP.php Fri Feb 23 15:52:07 2018 +0000 @@ -722,6 +722,7 @@ $newToken = array(); $newToken['content'] = '?'; + $prevNonEmpty = null; for ($i = ($stackPtr - 1); $i >= 0; $i--) { if (is_array($tokens[$i]) === true) { $tokenType = $tokens[$i][0]; @@ -729,18 +730,31 @@ $tokenType = $tokens[$i]; } + if ($prevNonEmpty === null + && isset(PHP_CodeSniffer_Tokens::$emptyTokens[$tokenType]) === false + ) { + // Found the previous non-empty token. + if ($tokenType === ':' || $tokenType === ',') { + $newToken['code'] = T_NULLABLE; + $newToken['type'] = 'T_NULLABLE'; + break; + } + + $prevNonEmpty = $tokenType; + } + if ($tokenType === T_FUNCTION) { $newToken['code'] = T_NULLABLE; $newToken['type'] = 'T_NULLABLE'; break; - } else if (in_array($tokenType, array(T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, '{', ';')) === true) { + } else if (in_array($tokenType, array(T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, '=', '{', ';')) === true) { $newToken['code'] = T_INLINE_THEN; $newToken['type'] = 'T_INLINE_THEN'; $insideInlineIf[] = $stackPtr; break; } - } + }//end for $finalTokens[$newStackPtr] = $newToken; $newStackPtr++; @@ -1277,11 +1291,13 @@ // it is the start of an array being defined using the short syntax. $isShortArray = false; $allowed = array( - T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET, - T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, - T_VARIABLE => T_VARIABLE, - T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, - T_STRING => T_STRING, + T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET, + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, + T_VARIABLE => T_VARIABLE, + T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, + T_STRING => T_STRING, + T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, ); for ($x = ($i - 1); $x > 0; $x--) { @@ -1293,13 +1309,6 @@ break; } - if (isset($tokens[$x]['bracket_opener']) === true - && $x > $tokens[$x]['bracket_opener'] - ) { - $x = $tokens[$x]['bracket_opener']; - continue; - } - if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$tokens[$x]['code']]) === false) { if (isset($allowed[$tokens[$x]['code']]) === false) { $isShortArray = true; @@ -1307,7 +1316,7 @@ break; } - }//end for + } if ($isShortArray === true) { $tokens[$i]['code'] = T_OPEN_SHORT_ARRAY; diff -r bfffd8d7479a -r 7a779792577d vendor/squizlabs/php_codesniffer/CodeSniffer/Tokens.php --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokens.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokens.php Fri Feb 23 15:52:07 2018 +0000 @@ -152,6 +152,10 @@ define('T_COALESCE_EQUAL', 'PHPCS_T_COALESCE_EQUAL'); } +if (defined('T_YIELD_FROM') === false) { + define('T_YIELD_FROM', 'PHPCS_T_YIELD_FROM'); +} + // Tokens used for parsing doc blocks. define('T_DOC_COMMENT_STAR', 'PHPCS_T_DOC_COMMENT_STAR'); define('T_DOC_COMMENT_WHITESPACE', 'PHPCS_T_DOC_COMMENT_WHITESPACE'); @@ -418,20 +422,21 @@ * @var array(int) */ public static $assignmentTokens = array( - T_EQUAL => T_EQUAL, - T_AND_EQUAL => T_AND_EQUAL, - T_OR_EQUAL => T_OR_EQUAL, - T_CONCAT_EQUAL => T_CONCAT_EQUAL, - T_DIV_EQUAL => T_DIV_EQUAL, - T_MINUS_EQUAL => T_MINUS_EQUAL, - T_POW_EQUAL => T_POW_EQUAL, - T_MOD_EQUAL => T_MOD_EQUAL, - T_MUL_EQUAL => T_MUL_EQUAL, - T_PLUS_EQUAL => T_PLUS_EQUAL, - T_XOR_EQUAL => T_XOR_EQUAL, - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - T_SL_EQUAL => T_SL_EQUAL, - T_SR_EQUAL => T_SR_EQUAL, + T_EQUAL => T_EQUAL, + T_AND_EQUAL => T_AND_EQUAL, + T_OR_EQUAL => T_OR_EQUAL, + T_CONCAT_EQUAL => T_CONCAT_EQUAL, + T_DIV_EQUAL => T_DIV_EQUAL, + T_MINUS_EQUAL => T_MINUS_EQUAL, + T_POW_EQUAL => T_POW_EQUAL, + T_MOD_EQUAL => T_MOD_EQUAL, + T_MUL_EQUAL => T_MUL_EQUAL, + T_PLUS_EQUAL => T_PLUS_EQUAL, + T_XOR_EQUAL => T_XOR_EQUAL, + T_DOUBLE_ARROW => T_DOUBLE_ARROW, + T_SL_EQUAL => T_SL_EQUAL, + T_SR_EQUAL => T_SR_EQUAL, + T_COALESCE_EQUAL => T_COALESCE_EQUAL, ); /** @@ -462,6 +467,8 @@ T_GREATER_THAN => T_GREATER_THAN, T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL, T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL, + T_SPACESHIP => T_SPACESHIP, + T_COALESCE => T_COALESCE, ); /** @@ -475,6 +482,7 @@ T_MULTIPLY => T_MULTIPLY, T_DIVIDE => T_DIVIDE, T_MODULUS => T_MODULUS, + T_POW => T_POW, ); /** @@ -575,20 +583,19 @@ * @var array(int) */ public static $operators = array( - T_MINUS => T_MINUS, - T_PLUS => T_PLUS, - T_MULTIPLY => T_MULTIPLY, - T_DIVIDE => T_DIVIDE, - T_MODULUS => T_MODULUS, - T_POW => T_POW, - T_SPACESHIP => T_SPACESHIP, - T_COALESCE => T_COALESCE, - T_COALESCE_EQUAL => T_COALESCE_EQUAL, - T_BITWISE_AND => T_BITWISE_AND, - T_BITWISE_OR => T_BITWISE_OR, - T_BITWISE_XOR => T_BITWISE_XOR, - T_SL => T_SL, - T_SR => T_SR, + T_MINUS => T_MINUS, + T_PLUS => T_PLUS, + T_MULTIPLY => T_MULTIPLY, + T_DIVIDE => T_DIVIDE, + T_MODULUS => T_MODULUS, + T_POW => T_POW, + T_SPACESHIP => T_SPACESHIP, + T_COALESCE => T_COALESCE, + T_BITWISE_AND => T_BITWISE_AND, + T_BITWISE_OR => T_BITWISE_OR, + T_BITWISE_XOR => T_BITWISE_XOR, + T_SL => T_SL, + T_SR => T_SR, ); /** @@ -662,6 +669,19 @@ ); /** + * Tokens that represent text strings. + * + * @var array(int) + */ + public static $textStringTokens = array( + T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, + T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, + T_INLINE_HTML => T_INLINE_HTML, + T_HEREDOC => T_HEREDOC, + T_NOWDOC => T_NOWDOC, + ); + + /** * Tokens that represent brackets and parenthesis. * * @var array(int) @@ -704,7 +724,7 @@ /** * Tokens that represent the names of called functions. * - * Mostly, these are just strings. But PHP tokeizes some language + * Mostly, these are just strings. But PHP tokenizes some language * constructs and functions using their own tokens. * * @var array(int) diff -r bfffd8d7479a -r 7a779792577d vendor/stack/builder/.travis.yml --- a/vendor/stack/builder/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/stack/builder/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -6,10 +6,10 @@ - 5.4 - 5.5 - 5.6 + - 7.0 - hhvm before_script: - - composer self-update - composer install --no-interaction --prefer-source script: phpunit --coverage-text diff -r bfffd8d7479a -r 7a779792577d vendor/stack/builder/CHANGELOG.md --- a/vendor/stack/builder/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/stack/builder/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,10 @@ CHANGELOG ========= +* 1.0.5 (2017-11-18) + + * Add compability with Symfony 4. + * 1.0.4 (2016-06-02) * Add compability with Symfony 3. diff -r bfffd8d7479a -r 7a779792577d vendor/stack/builder/composer.json --- a/vendor/stack/builder/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/stack/builder/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -11,8 +11,8 @@ ], "require": { "php": ">=5.3.0", - "symfony/http-foundation": "~2.1|~3.0", - "symfony/http-kernel": "~2.1|~3.0" + "symfony/http-foundation": "~2.1|~3.0|~4.0", + "symfony/http-kernel": "~2.1|~3.0|~4.0" }, "require-dev": { "silex/silex": "~1.0" diff -r bfffd8d7479a -r 7a779792577d vendor/stack/builder/composer.lock --- a/vendor/stack/builder/composer.lock Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/stack/builder/composer.lock Fri Feb 23 15:52:07 2018 +0000 @@ -4,27 +4,34 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "9ef86990728be223eb145600985d3efb", - "content-hash": "140955ca962f7fc65891ab903b51c9a9", + "content-hash": "01b70e8acfcec52232420838dc8ba788", "packages": [ { "name": "psr/log", - "version": "1.0.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -38,42 +45,42 @@ } ], "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2012-12-21 11:40:51" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "symfony/debug", - "version": "v3.1.0", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "c9ed5a44dbc783a352f06b20440863c7463de907" + "reference": "74557880e2846b5c84029faa96b834da37e29810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/c9ed5a44dbc783a352f06b20440863c7463de907", - "reference": "c9ed5a44dbc783a352f06b20440863c7463de907", + "url": "https://api.github.com/repos/symfony/debug/zipball/74557880e2846b5c84029faa96b834da37e29810", + "reference": "74557880e2846b5c84029faa96b834da37e29810", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -100,20 +107,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-05-24 10:06:56" + "time": "2017-11-10T16:38:39+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.0.6", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "807dde98589f9b2b00624dca326740380d78dbbc" + "reference": "54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/807dde98589f9b2b00624dca326740380d78dbbc", - "reference": "807dde98589f9b2b00624dca326740380d78dbbc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00", + "reference": "54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00", "shasum": "" }, "require": { @@ -160,20 +167,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-05-05 06:56:13" + "time": "2016-07-19T10:44:15+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.0.6", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "18b24bc32d2495ae79d76e777368786a6536fe31" + "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/18b24bc32d2495ae79d76e777368786a6536fe31", - "reference": "18b24bc32d2495ae79d76e777368786a6536fe31", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82", + "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82", "shasum": "" }, "require": { @@ -213,20 +220,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-04-12 18:09:53" + "time": "2016-07-17T13:54:30+00:00" }, { "name": "symfony/http-kernel", - "version": "v3.0.6", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "6a5010978edf0a9646342232531e53bfc7abbcd3" + "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6a5010978edf0a9646342232531e53bfc7abbcd3", - "reference": "6a5010978edf0a9646342232531e53bfc7abbcd3", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3", + "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3", "shasum": "" }, "require": { @@ -234,7 +241,7 @@ "psr/log": "~1.0", "symfony/debug": "~2.8|~3.0", "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0" + "symfony/http-foundation": "~2.8.8|~3.0.8|~3.1.2|~3.2" }, "conflict": { "symfony/config": "<2.8" @@ -295,20 +302,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-05-09 22:13:13" + "time": "2016-07-30T09:10:37+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -320,7 +327,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -354,7 +361,7 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2017-10-11T12:05:26+00:00" } ], "packages-dev": [ @@ -402,20 +409,20 @@ "container", "dependency injection" ], - "time": "2013-11-22 08:30:29" + "time": "2013-11-22T08:30:29+00:00" }, { "name": "silex/silex", - "version": "v1.3.5", + "version": "v1.3.6", "source": { "type": "git", "url": "https://github.com/silexphp/Silex.git", - "reference": "374c7e04040a6f781c90f7d746726a5daa78e783" + "reference": "ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Silex/zipball/374c7e04040a6f781c90f7d746726a5daa78e783", - "reference": "374c7e04040a6f781c90f7d746726a5daa78e783", + "url": "https://api.github.com/repos/silexphp/Silex/zipball/ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136", + "reference": "ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136", "shasum": "" }, "require": { @@ -437,7 +444,7 @@ "symfony/dom-crawler": "~2.3|3.0.*", "symfony/finder": "~2.3|3.0.*", "symfony/form": "~2.3|3.0.*", - "symfony/locale": "~2.3|3.0.*", + "symfony/intl": "~2.3|3.0.*", "symfony/monolog-bridge": "~2.3|3.0.*", "symfony/options-resolver": "~2.3|3.0.*", "symfony/phpunit-bridge": "~2.7", @@ -447,7 +454,7 @@ "symfony/translation": "~2.3|3.0.*", "symfony/twig-bridge": "~2.3|3.0.*", "symfony/validator": "~2.3|3.0.*", - "twig/twig": "~1.8|~2.0" + "twig/twig": "~1.28|~2.0" }, "type": "library", "extra": { @@ -479,20 +486,20 @@ "keywords": [ "microframework" ], - "time": "2016-01-06 14:59:35" + "time": "2017-04-30T16:26:54+00:00" }, { "name": "symfony/routing", - "version": "v3.0.6", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "a6cd168310066176599442aa21f5da86c3f8e0b3" + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/a6cd168310066176599442aa21f5da86c3f8e0b3", - "reference": "a6cd168310066176599442aa21f5da86c3f8e0b3", + "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b", "shasum": "" }, "require": { @@ -554,7 +561,7 @@ "uri", "url" ], - "time": "2016-05-03 12:23:49" + "time": "2016-06-29T05:40:00+00:00" } ], "aliases": [], diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/CHANGELOG.md --- a/vendor/symfony/browser-kit/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,18 @@ CHANGELOG ========= +3.4.0 +----- + + * [BC BREAK] Client will skip redirects during history navigation + (back and forward calls) according to W3C Browsers recommendation + +3.3.0 +----- + + * [BC BREAK] The request method is dropped from POST to GET when the response + status code is 301. + 3.2.0 ----- @@ -10,7 +22,7 @@ ----- * [BC BREAK] `Client::followRedirect()` won't redirect responses with - a non-3xx Status Code and `Location` header anymore, as per + a non-3xx Status Code and `Location` header anymore, as per http://tools.ietf.org/html/rfc2616#section-14.30 * added `Client::getInternalRequest()` and `Client::getInternalResponse()` to diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/Client.php --- a/vendor/symfony/browser-kit/Client.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/Client.php Fri Feb 23 15:52:07 2018 +0000 @@ -42,11 +42,10 @@ private $maxRedirects = -1; private $redirectCount = 0; + private $redirects = array(); private $isMainRequest = true; /** - * Constructor. - * * @param array $server The server parameters (equivalent of $_SERVER) * @param History $history A History instance to store the browser history * @param CookieJar $cookieJar A CookieJar instance to store the cookies @@ -234,8 +233,6 @@ /** * Clicks on a given link. * - * @param Link $link A Link instance - * * @return Crawler */ public function click(Link $link) @@ -328,6 +325,8 @@ } if ($this->followRedirects && $this->redirect) { + $this->redirects[serialize($this->history->current())] = true; + return $this->crawler = $this->followRedirect(); } @@ -345,9 +344,24 @@ */ protected function doRequestInProcess($request) { + $deprecationsFile = tempnam(sys_get_temp_dir(), 'deprec'); + putenv('SYMFONY_DEPRECATIONS_SERIALIZE='.$deprecationsFile); + $_ENV['SYMFONY_DEPRECATIONS_SERIALIZE'] = $deprecationsFile; $process = new PhpProcess($this->getScript($request), null, null); $process->run(); + if (file_exists($deprecationsFile)) { + $deprecations = file_get_contents($deprecationsFile); + unlink($deprecationsFile); + foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) { + if ($deprecation[0]) { + trigger_error($deprecation[1], E_USER_DEPRECATED); + } else { + @trigger_error($deprecation[1], E_USER_DEPRECATED); + } + } + } + if (!$process->isSuccessful() || !preg_match('/^O\:\d+\:/', $process->getOutput())) { throw new \RuntimeException(sprintf('OUTPUT: %s ERROR OUTPUT: %s', $process->getOutput(), $process->getErrorOutput())); } @@ -430,7 +444,11 @@ */ public function back() { - return $this->requestFromRequest($this->history->back(), false); + do { + $request = $this->history->back(); + } while (array_key_exists(serialize($request), $this->redirects)); + + return $this->requestFromRequest($request, false); } /** @@ -440,7 +458,11 @@ */ public function forward() { - return $this->requestFromRequest($this->history->forward(), false); + do { + $request = $this->history->forward(); + } while (array_key_exists(serialize($request), $this->redirects)); + + return $this->requestFromRequest($request, false); } /** @@ -468,13 +490,14 @@ if (-1 !== $this->maxRedirects) { if ($this->redirectCount > $this->maxRedirects) { + $this->redirectCount = 0; throw new \LogicException(sprintf('The maximum number (%d) of redirections was reached.', $this->maxRedirects)); } } $request = $this->internalRequest; - if (in_array($this->internalResponse->getStatus(), array(302, 303))) { + if (in_array($this->internalResponse->getStatus(), array(301, 302, 303))) { $method = 'GET'; $files = array(); $content = null; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/Cookie.php --- a/vendor/symfony/browser-kit/Cookie.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/Cookie.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,8 +21,6 @@ /** * Handles dates as defined by RFC 2616 section 3.3.1, and also some other * non-standard, but common formats. - * - * @var array */ private static $dateFormats = array( 'D, d M Y H:i:s T', @@ -62,7 +60,7 @@ $this->rawValue = $value; } else { $this->value = $value; - $this->rawValue = urlencode($value); + $this->rawValue = rawurlencode($value); } $this->name = $name; $this->path = empty($path) ? '/' : $path; @@ -82,10 +80,6 @@ /** * Returns the HTTP representation of the Cookie. - * - * @return string The HTTP representation of the Cookie - * - * @throws \UnexpectedValueException */ public function __toString() { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/CookieJar.php --- a/vendor/symfony/browser-kit/CookieJar.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/CookieJar.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,11 +20,6 @@ { protected $cookieJar = array(); - /** - * Sets a cookie. - * - * @param Cookie $cookie A Cookie instance - */ public function set(Cookie $cookie) { $this->cookieJar[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/History.php --- a/vendor/symfony/browser-kit/History.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/History.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,8 +32,6 @@ /** * Adds a Request to the history. - * - * @param Request $request A Request instance */ public function add(Request $request) { @@ -49,7 +47,7 @@ */ public function isEmpty() { - return count($this->stack) == 0; + return 0 == count($this->stack); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/LICENSE --- a/vendor/symfony/browser-kit/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2004-2017 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 -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/Request.php --- a/vendor/symfony/browser-kit/Request.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/Request.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,8 +12,6 @@ namespace Symfony\Component\BrowserKit; /** - * Request object. - * * @author Fabien Potencier */ class Request @@ -27,8 +25,6 @@ protected $content; /** - * Constructor. - * * @param string $uri The request URI * @param string $method The HTTP method request * @param array $parameters The request parameters diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/Response.php --- a/vendor/symfony/browser-kit/Response.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/Response.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,8 +12,6 @@ namespace Symfony\Component\BrowserKit; /** - * Response object. - * * @author Fabien Potencier */ class Response @@ -23,8 +21,6 @@ protected $headers; /** - * Constructor. - * * The headers array is a set of key/value pairs. If a header is present multiple times * then the value is an array of all the values. * diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/browser-kit/composer.json --- a/vendor/symfony/browser-kit/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/browser-kit/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -16,12 +16,12 @@ } ], "require": { - "php": ">=5.5.9", - "symfony/dom-crawler": "~2.8|~3.0" + "php": "^5.5.9|>=7.0.8", + "symfony/dom-crawler": "~2.8|~3.0|~4.0" }, "require-dev": { - "symfony/process": "~2.8|~3.0", - "symfony/css-selector": "~2.8|~3.0" + "symfony/process": "~2.8|~3.0|~4.0", + "symfony/css-selector": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/process": "" @@ -35,7 +35,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/class-loader/ClassCollectionLoader.php --- a/vendor/symfony/class-loader/ClassCollectionLoader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/class-loader/ClassCollectionLoader.php Fri Feb 23 15:52:07 2018 +0000 @@ -256,7 +256,7 @@ $output .= self::compressCode($rawChunk); - if (PHP_VERSION_ID >= 70000) { + if (\PHP_VERSION_ID >= 70000) { // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098 unset($tokens, $rawChunk); gc_mem_caches(); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/class-loader/ClassMapGenerator.php --- a/vendor/symfony/class-loader/ClassMapGenerator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/class-loader/ClassMapGenerator.php Fri Feb 23 15:52:07 2018 +0000 @@ -64,7 +64,7 @@ $classes = self::findClasses($path); - if (PHP_VERSION_ID >= 70000) { + if (\PHP_VERSION_ID >= 70000) { // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098 gc_mem_caches(); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/console/Application.php --- a/vendor/symfony/console/Application.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/console/Application.php Fri Feb 23 15:52:07 2018 +0000 @@ -14,6 +14,7 @@ use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Helper\DebugFormatterHelper; +use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; @@ -129,7 +130,7 @@ } if (null !== $e) { - if (!$this->catchExceptions) { + if (!$this->catchExceptions || !$x instanceof \Exception) { throw $x; } @@ -189,7 +190,12 @@ if (!$name) { $name = $this->defaultCommand; - $input = new ArrayInput(array('command' => $this->defaultCommand)); + $this->definition->setArguments(array_merge( + $this->definition->getArguments(), + array( + 'command' => new InputArgument('command', InputArgument::OPTIONAL, $this->definition->getArgument('command')->getDescription(), $name), + ) + )); } $this->runningCommand = null; @@ -638,7 +644,7 @@ $output->isVerbose() && 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : '' ); - $len = $this->stringWidth($title); + $len = Helper::strlen($title); $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX; // HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327 @@ -649,7 +655,7 @@ foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) { foreach ($this->splitStringByWidth($line, $width - 4) as $line) { // pre-format lines to get the right string length - $lineLength = $this->stringWidth($line) + 4; + $lineLength = Helper::strlen($line) + 4; $lines[] = array($line, $lineLength); $len = max($lineLength, $len); @@ -658,7 +664,7 @@ $messages = array(); $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title)))); + $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::strlen($title)))); foreach ($lines as $line) { $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); } @@ -1038,15 +1044,6 @@ return $this; } - private function stringWidth($string) - { - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return strlen($string); - } - - return mb_strwidth($string, $encoding); - } - private function splitStringByWidth($string, $width) { // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/console/Command/Command.php --- a/vendor/symfony/console/Command/Command.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/console/Command/Command.php Fri Feb 23 15:52:07 2018 +0000 @@ -286,7 +286,7 @@ if ($code instanceof \Closure) { $r = new \ReflectionFunction($code); if (null === $r->getClosureThis()) { - if (PHP_VERSION_ID < 70000) { + if (\PHP_VERSION_ID < 70000) { // Bug in PHP5: https://bugs.php.net/bug.php?id=64761 // This means that we cannot bind static closures and therefore we must // ignore any errors here. There is no way to test if the closure is diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/console/Descriptor/JsonDescriptor.php --- a/vendor/symfony/console/Descriptor/JsonDescriptor.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/console/Descriptor/JsonDescriptor.php Fri Feb 23 15:52:07 2018 +0000 @@ -103,7 +103,7 @@ 'is_required' => $argument->isRequired(), 'is_array' => $argument->isArray(), 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), - 'default' => $argument->getDefault(), + 'default' => INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), ); } @@ -121,7 +121,7 @@ 'is_value_required' => $option->isValueRequired(), 'is_multiple' => $option->isArray(), 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), - 'default' => $option->getDefault(), + 'default' => INF === $option->getDefault() ? 'INF' : $option->getDefault(), ); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/console/Descriptor/TextDescriptor.php --- a/vendor/symfony/console/Descriptor/TextDescriptor.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/console/Descriptor/TextDescriptor.php Fri Feb 23 15:52:07 2018 +0000 @@ -262,6 +262,10 @@ */ private function formatDefaultValue($default) { + if (INF === $default) { + return 'INF'; + } + if (is_string($default)) { $default = OutputFormatter::escape($default); } elseif (is_array($default)) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/console/Helper/QuestionHelper.php --- a/vendor/symfony/console/Helper/QuestionHelper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/console/Helper/QuestionHelper.php Fri Feb 23 15:52:07 2018 +0000 @@ -124,8 +124,7 @@ * * @return bool|mixed|null|string * - * @throws \Exception - * @throws \RuntimeException + * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden */ private function doAsk(OutputInterface $output, Question $question) { @@ -139,7 +138,7 @@ if ($question->isHidden()) { try { $ret = trim($this->getHiddenResponse($output, $inputStream)); - } catch (\RuntimeException $e) { + } catch (RuntimeException $e) { if (!$question->isHiddenFallback()) { throw $e; } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/console/Helper/Table.php --- a/vendor/symfony/console/Helper/Table.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/console/Helper/Table.php Fri Feb 23 15:52:07 2018 +0000 @@ -156,7 +156,7 @@ */ public function setColumnStyle($columnIndex, $name) { - $columnIndex = intval($columnIndex); + $columnIndex = (int) $columnIndex; $this->columnStyles[$columnIndex] = $this->resolveStyle($name); @@ -191,7 +191,7 @@ */ public function setColumnWidth($columnIndex, $width) { - $this->columnWidths[intval($columnIndex)] = intval($width); + $this->columnWidths[(int) $columnIndex] = (int) $width; return $this; } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/console/Question/ChoiceQuestion.php --- a/vendor/symfony/console/Question/ChoiceQuestion.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/console/Question/ChoiceQuestion.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,6 +34,10 @@ */ public function __construct($question, array $choices, $default = null) { + if (!$choices) { + throw new \LogicException('Choice question must have at least 1 choice available.'); + } + parent::__construct($question, $default); $this->choices = $choices; @@ -137,7 +141,7 @@ if ($multiselect) { // Check for a separated comma values - if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) { + if (!preg_match('/^[^,]+(?:,[^,]+)*$/', $selectedChoices, $matches)) { throw new InvalidArgumentException(sprintf($errorMessage, $selected)); } $selectedChoices = explode(',', $selectedChoices); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/CHANGELOG.md --- a/vendor/symfony/debug/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,16 @@ CHANGELOG ========= +3.4.0 +----- + +* deprecated `ErrorHandler::stackErrors()` and `ErrorHandler::unstackErrors()` + +3.3.0 +----- + +* deprecated the `ContextErrorException` class: use \ErrorException directly now + 3.2.0 ----- diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/DebugClassLoader.php --- a/vendor/symfony/debug/DebugClassLoader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/DebugClassLoader.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,16 +26,17 @@ { private $classLoader; private $isFinder; + private $loaded = array(); private static $caseCheck; + private static $checkedClasses = array(); + private static $final = array(); + private static $finalMethods = array(); private static $deprecated = array(); - private static $php7Reserved = array('int', 'float', 'bool', 'string', 'true', 'false', 'null'); + private static $internal = array(); + private static $internalMethods = array(); + private static $php7Reserved = array('int' => 1, 'float' => 1, 'bool' => 1, 'string' => 1, 'true' => 1, 'false' => 1, 'null' => 1); private static $darwinCache = array('/' => array('/', array())); - /** - * Constructor. - * - * @param callable $classLoader A class loader - */ public function __construct(callable $classLoader) { $this->classLoader = $classLoader; @@ -134,83 +135,152 @@ */ public function loadClass($class) { - ErrorHandler::stackErrors(); + $e = error_reporting(error_reporting() | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR); try { - if ($this->isFinder) { - if ($file = $this->classLoader[0]->findFile($class)) { - require_once $file; + if ($this->isFinder && !isset($this->loaded[$class])) { + $this->loaded[$class] = true; + if ($file = $this->classLoader[0]->findFile($class) ?: false) { + $wasCached = \function_exists('opcache_is_script_cached') && opcache_is_script_cached($file); + + require $file; + + if ($wasCached) { + return; + } } } else { call_user_func($this->classLoader, $class); $file = false; } } finally { - ErrorHandler::unstackErrors(); + error_reporting($e); } - $exists = class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false); + $this->checkClass($class, $file); + } - if ($class && '\\' === $class[0]) { + private function checkClass($class, $file = null) + { + $exists = null === $file || \class_exists($class, false) || \interface_exists($class, false) || \trait_exists($class, false); + + if (null !== $file && $class && '\\' === $class[0]) { $class = substr($class, 1); } if ($exists) { + if (isset(self::$checkedClasses[$class])) { + return; + } + self::$checkedClasses[$class] = true; + $refl = new \ReflectionClass($class); + if (null === $file && $refl->isInternal()) { + return; + } $name = $refl->getName(); - if ($name !== $class && 0 === strcasecmp($name, $class)) { - throw new \RuntimeException(sprintf('Case mismatch between loaded and declared class names: %s vs %s', $class, $name)); + if ($name !== $class && 0 === \strcasecmp($name, $class)) { + throw new \RuntimeException(sprintf('Case mismatch between loaded and declared class names: "%s" vs "%s".', $class, $name)); } - if (in_array(strtolower($refl->getShortName()), self::$php7Reserved)) { - @trigger_error(sprintf('%s uses a reserved class name (%s) that will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED); - } elseif (preg_match('#\n \* @deprecated (.*?)\r?\n \*(?: @|/$)#s', $refl->getDocComment(), $notice)) { - self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]); + // Don't trigger deprecations for classes in the same vendor + if (2 > $len = 1 + (\strpos($name, '\\') ?: \strpos($name, '_'))) { + $len = 0; + $ns = ''; } else { - if (2 > $len = 1 + (strpos($name, '\\', 1 + strpos($name, '\\')) ?: strpos($name, '_'))) { - $len = 0; - $ns = ''; - } else { - switch ($ns = substr($name, 0, $len)) { - case 'Symfony\Bridge\\': - case 'Symfony\Bundle\\': - case 'Symfony\Component\\': - $ns = 'Symfony\\'; - $len = strlen($ns); - break; + $ns = \substr($name, 0, $len); + } + + // Detect annotations on the class + if (false !== $doc = $refl->getDocComment()) { + foreach (array('final', 'deprecated', 'internal') as $annotation) { + if (false !== \strpos($doc, $annotation) && preg_match('#\n \* @'.$annotation.'(?:( .+?)\.?)?\r?\n \*(?: @|/$)#s', $doc, $notice)) { + self::${$annotation}[$name] = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : ''; } } - $parent = get_parent_class($class); + } - if (!$parent || strncmp($ns, $parent, $len)) { - if ($parent && isset(self::$deprecated[$parent]) && strncmp($ns, $parent, $len)) { - @trigger_error(sprintf('The %s class extends %s that is deprecated %s', $name, $parent, self::$deprecated[$parent]), E_USER_DEPRECATED); + $parentAndTraits = \class_uses($name, false); + if ($parent = \get_parent_class($class)) { + $parentAndTraits[] = $parent; + + if (!isset(self::$checkedClasses[$parent])) { + $this->checkClass($parent); + } + + if (isset(self::$final[$parent])) { + @trigger_error(sprintf('The "%s" class is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $parent, self::$final[$parent], $name), E_USER_DEPRECATED); + } + } + + // Detect if the parent is annotated + foreach ($parentAndTraits + $this->getOwnInterfaces($name, $parent) as $use) { + if (!isset(self::$checkedClasses[$use])) { + $this->checkClass($use); + } + if (isset(self::$deprecated[$use]) && \strncmp($ns, $use, $len)) { + $type = class_exists($name, false) ? 'class' : (interface_exists($name, false) ? 'interface' : 'trait'); + $verb = class_exists($use, false) || interface_exists($name, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses'); + + @trigger_error(sprintf('The "%s" %s %s "%s" that is deprecated%s.', $name, $type, $verb, $use, self::$deprecated[$use]), E_USER_DEPRECATED); + } + if (isset(self::$internal[$use]) && \strncmp($ns, $use, $len)) { + @trigger_error(sprintf('The "%s" %s is considered internal%s. It may change without further notice. You should not use it from "%s".', $use, class_exists($use, false) ? 'class' : (interface_exists($use, false) ? 'interface' : 'trait'), self::$internal[$use], $name), E_USER_DEPRECATED); + } + } + + // Inherit @final and @internal annotations for methods + self::$finalMethods[$name] = array(); + self::$internalMethods[$name] = array(); + foreach ($parentAndTraits as $use) { + foreach (array('finalMethods', 'internalMethods') as $property) { + if (isset(self::${$property}[$use])) { + self::${$property}[$name] = self::${$property}[$name] ? self::${$property}[$use] + self::${$property}[$name] : self::${$property}[$use]; } + } + } - $parentInterfaces = array(); - $deprecatedInterfaces = array(); - if ($parent) { - foreach (class_implements($parent) as $interface) { - $parentInterfaces[$interface] = 1; - } - } + $isClass = \class_exists($name, false); + foreach ($refl->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $method) { + if ($method->class !== $name) { + continue; + } - foreach ($refl->getInterfaceNames() as $interface) { - if (isset(self::$deprecated[$interface]) && strncmp($ns, $interface, $len)) { - $deprecatedInterfaces[] = $interface; - } - foreach (class_implements($interface) as $interface) { - $parentInterfaces[$interface] = 1; - } - } + // Method from a trait + if ($method->getFilename() !== $refl->getFileName()) { + continue; + } - foreach ($deprecatedInterfaces as $interface) { - if (!isset($parentInterfaces[$interface])) { - @trigger_error(sprintf('The %s %s %s that is deprecated %s', $name, $refl->isInterface() ? 'interface extends' : 'class implements', $interface, self::$deprecated[$interface]), E_USER_DEPRECATED); + if ($isClass && $parent && isset(self::$finalMethods[$parent][$method->name])) { + list($declaringClass, $message) = self::$finalMethods[$parent][$method->name]; + @trigger_error(sprintf('The "%s::%s()" method is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $declaringClass, $method->name, $message, $name), E_USER_DEPRECATED); + } + + foreach ($parentAndTraits as $use) { + if (isset(self::$internalMethods[$use][$method->name])) { + list($declaringClass, $message) = self::$internalMethods[$use][$method->name]; + if (\strncmp($ns, $declaringClass, $len)) { + @trigger_error(sprintf('The "%s::%s()" method is considered internal%s. It may change without further notice. You should not extend it from "%s".', $declaringClass, $method->name, $message, $name), E_USER_DEPRECATED); } } } + + // Detect method annotations + if (false === $doc = $method->getDocComment()) { + continue; + } + + foreach (array('final', 'internal') as $annotation) { + if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) { + $message = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : ''; + self::${$annotation.'Methods'}[$name][$method->name] = array($name, $message); + } + } + } + + if (isset(self::$php7Reserved[\strtolower($refl->getShortName())])) { + @trigger_error(sprintf('The "%s" class uses the reserved name "%s", it will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED); } } @@ -304,11 +374,36 @@ if (0 === substr_compare($real, $tail, -$tailLen, $tailLen, true) && 0 !== substr_compare($real, $tail, -$tailLen, $tailLen, false) ) { - throw new \RuntimeException(sprintf('Case mismatch between class and real file names: %s vs %s in %s', substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1))); + throw new \RuntimeException(sprintf('Case mismatch between class and real file names: "%s" vs "%s" in "%s".', substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1))); } } - - return true; } } + + /** + * `class_implements` includes interfaces from the parents so we have to manually exclude them. + * + * @param string $class + * @param string|false $parent + * + * @return string[] + */ + private function getOwnInterfaces($class, $parent) + { + $ownInterfaces = class_implements($class, false); + + if ($parent) { + foreach (class_implements($parent, false) as $interface) { + unset($ownInterfaces[$interface]); + } + } + + foreach ($ownInterfaces as $interface) { + foreach (class_implements($interface) as $interface) { + unset($ownInterfaces[$interface]); + } + } + + return $ownInterfaces; + } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/ErrorHandler.php --- a/vendor/symfony/debug/ErrorHandler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/ErrorHandler.php Fri Feb 23 15:52:07 2018 +0000 @@ -100,6 +100,8 @@ private static $stackedErrors = array(); private static $stackedErrorLevels = array(); private static $toStringException = null; + private static $silencedErrorCache = array(); + private static $silencedErrorCount = 0; private static $exitCode = 0; /** @@ -132,10 +134,13 @@ $handler = $prev[0]; $replace = false; } - if ($replace || !$prev) { - $handler->setExceptionHandler(set_exception_handler(array($handler, 'handleException'))); + if (!$replace && $prev) { + restore_error_handler(); + } + if (is_array($prev = set_exception_handler(array($handler, 'handleException'))) && $prev[0] === $handler) { + restore_exception_handler(); } else { - restore_error_handler(); + $handler->setExceptionHandler($prev); } $handler->throwAt(E_ALL & $handler->thrownErrors, true); @@ -407,7 +412,28 @@ $errorAsException = self::$toStringException; self::$toStringException = null; } elseif (!$throw && !($type & $level)) { - $errorAsException = new SilencedErrorContext($type, $file, $line); + if (!isset(self::$silencedErrorCache[$id = $file.':'.$line])) { + $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3), $type, $file, $line, false) : array(); + $errorAsException = new SilencedErrorContext($type, $file, $line, $lightTrace); + } elseif (isset(self::$silencedErrorCache[$id][$message])) { + $lightTrace = null; + $errorAsException = self::$silencedErrorCache[$id][$message]; + ++$errorAsException->count; + } else { + $lightTrace = array(); + $errorAsException = null; + } + + if (100 < ++self::$silencedErrorCount) { + self::$silencedErrorCache = $lightTrace = array(); + self::$silencedErrorCount = 1; + } + if ($errorAsException) { + self::$silencedErrorCache[$id][$message] = $errorAsException; + } + if (null === $lightTrace) { + return; + } } else { if ($scope) { $errorAsException = new ContextErrorException($logMessage, 0, $type, $file, $line, $context); @@ -418,19 +444,7 @@ // Clean the trace by removing function arguments and the first frames added by the error handler itself. if ($throw || $this->tracedErrors & $type) { $backtrace = $backtrace ?: $errorAsException->getTrace(); - $lightTrace = $backtrace; - - for ($i = 0; isset($backtrace[$i]); ++$i) { - if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) { - $lightTrace = array_slice($lightTrace, 1 + $i); - break; - } - } - if (!($throw || $this->scopedErrors & $type)) { - for ($i = 0; isset($lightTrace[$i]); ++$i) { - unset($lightTrace[$i]['args']); - } - } + $lightTrace = $this->cleanTrace($backtrace, $type, $file, $line, $throw); $this->traceReflector->setValue($errorAsException, $lightTrace); } else { $this->traceReflector->setValue($errorAsException, array()); @@ -487,13 +501,13 @@ $this->loggers[$type][0], ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG, $logMessage, - array('exception' => $errorAsException), + $errorAsException ? array('exception' => $errorAsException) : array(), ); } else { try { $this->isRecursive = true; $level = ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG; - $this->loggers[$type][0]->log($level, $logMessage, array('exception' => $errorAsException)); + $this->loggers[$type][0]->log($level, $logMessage, $errorAsException ? array('exception' => $errorAsException) : array()); } finally { $this->isRecursive = false; } @@ -519,6 +533,7 @@ $exception = new FatalThrowableError($exception); } $type = $exception instanceof FatalErrorException ? $exception->getSeverity() : E_ERROR; + $handlerException = null; if (($this->loggedErrors & $type) || $exception instanceof FatalThrowableError) { if ($exception instanceof FatalErrorException) { @@ -534,9 +549,6 @@ } } elseif ($exception instanceof \ErrorException) { $message = 'Uncaught '.$exception->getMessage(); - if ($exception instanceof ContextErrorException) { - $e['context'] = $exception->getContext(); - } } else { $message = 'Uncaught Exception: '.$exception->getMessage(); } @@ -556,18 +568,20 @@ } } } - if (empty($this->exceptionHandler)) { - throw $exception; // Give back $exception to the native handler - } try { - call_user_func($this->exceptionHandler, $exception); + if (null !== $this->exceptionHandler) { + return \call_user_func($this->exceptionHandler, $exception); + } + $handlerException = $handlerException ?: $exception; } catch (\Exception $handlerException) { } catch (\Throwable $handlerException) { } - if (isset($handlerException)) { - $this->exceptionHandler = null; - $this->handleException($handlerException); + $this->exceptionHandler = null; + if ($exception === $handlerException) { + self::$reservedMemory = null; // Disable the fatal error handler + throw $exception; // Give back $exception to the native handler } + $this->handleException($handlerException); } /** @@ -583,15 +597,39 @@ return; } - self::$reservedMemory = null; + $handler = self::$reservedMemory = null; + $handlers = array(); + $previousHandler = null; + $sameHandlerLimit = 10; - $handler = set_error_handler('var_dump'); - $handler = is_array($handler) ? $handler[0] : null; - restore_error_handler(); + while (!is_array($handler) || !$handler[0] instanceof self) { + $handler = set_exception_handler('var_dump'); + restore_exception_handler(); - if (!$handler instanceof self) { + if (!$handler) { + break; + } + restore_exception_handler(); + + if ($handler !== $previousHandler) { + array_unshift($handlers, $handler); + $previousHandler = $handler; + } elseif (0 === --$sameHandlerLimit) { + $handler = null; + break; + } + } + foreach ($handlers as $h) { + set_exception_handler($h); + } + if (!$handler) { return; } + if ($handler !== $h) { + $handler[0]->setExceptionHandler($h); + } + $handler = $handler[0]; + $handlers = array(); if ($exit = null === $error) { $error = error_get_last(); @@ -644,17 +682,25 @@ * * The most important feature of this is to prevent * autoloading until unstackErrors() is called. + * + * @deprecated since version 3.4, to be removed in 4.0. */ public static function stackErrors() { + @trigger_error('Support for stacking errors is deprecated since Symfony 3.4 and will be removed in 4.0.', E_USER_DEPRECATED); + self::$stackedErrorLevels[] = error_reporting(error_reporting() | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR); } /** * Unstacks stacked errors and forwards to the logger. + * + * @deprecated since version 3.4, to be removed in 4.0. */ public static function unstackErrors() { + @trigger_error('Support for unstacking errors is deprecated since Symfony 3.4 and will be removed in 4.0.', E_USER_DEPRECATED); + $level = array_pop(self::$stackedErrorLevels); if (null !== $level) { @@ -690,4 +736,23 @@ new ClassNotFoundFatalErrorHandler(), ); } + + private function cleanTrace($backtrace, $type, $file, $line, $throw) + { + $lightTrace = $backtrace; + + for ($i = 0; isset($backtrace[$i]); ++$i) { + if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) { + $lightTrace = array_slice($lightTrace, 1 + $i); + break; + } + } + if (!($throw || $this->scopedErrors & $type)) { + for ($i = 0; isset($lightTrace[$i]); ++$i) { + unset($lightTrace[$i]['args'], $lightTrace[$i]['object']); + } + } + + return $lightTrace; + } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/Exception/ContextErrorException.php --- a/vendor/symfony/debug/Exception/ContextErrorException.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/Exception/ContextErrorException.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,6 +15,8 @@ * Error Exception with Variable Context. * * @author Christian Sciberras + * + * @deprecated since version 3.3. Instead, \ErrorException will be used directly in 4.0. */ class ContextErrorException extends \ErrorException { @@ -31,6 +33,8 @@ */ public function getContext() { + @trigger_error(sprintf('The %s class is deprecated since Symfony 3.3 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED); + return $this->context; } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/Exception/FlattenException.php --- a/vendor/symfony/debug/Exception/FlattenException.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/Exception/FlattenException.php Fri Feb 23 15:52:07 2018 +0000 @@ -11,6 +11,7 @@ namespace Symfony\Component\Debug\Exception; +use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; /** @@ -41,6 +42,8 @@ if ($exception instanceof HttpExceptionInterface) { $statusCode = $exception->getStatusCode(); $headers = array_merge($headers, $exception->getHeaders()); + } elseif ($exception instanceof RequestExceptionInterface) { + $statusCode = 400; } if (null === $statusCode) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/Exception/SilencedErrorContext.php --- a/vendor/symfony/debug/Exception/SilencedErrorContext.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/Exception/SilencedErrorContext.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,15 +18,20 @@ */ class SilencedErrorContext implements \JsonSerializable { + public $count = 1; + private $severity; private $file; private $line; + private $trace; - public function __construct($severity, $file, $line) + public function __construct($severity, $file, $line, array $trace = array(), $count = 1) { $this->severity = $severity; $this->file = $file; $this->line = $line; + $this->trace = $trace; + $this->count = $count; } public function getSeverity() @@ -44,12 +49,19 @@ return $this->line; } + public function getTrace() + { + return $this->trace; + } + public function JsonSerialize() { return array( 'severity' => $this->severity, 'file' => $this->file, 'line' => $this->line, + 'trace' => $this->trace, + 'count' => $this->count, ); } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/ExceptionHandler.php --- a/vendor/symfony/debug/ExceptionHandler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/ExceptionHandler.php Fri Feb 23 15:52:07 2018 +0000 @@ -196,8 +196,6 @@ /** * Gets the HTML content associated with the given exception. * - * @param FlattenException $exception A FlattenException instance - * * @return string The content as a string */ public function getContent(FlattenException $exception) @@ -220,28 +218,30 @@ $class = $this->formatClass($e['class']); $message = nl2br($this->escapeHtml($e['message'])); $content .= sprintf(<<<'EOF' -

    - %d/%d - %s%s: - %s -

    -
    -
      - +
      + + + EOF - , $ind, $total, $class, $this->formatPath($e['trace'][0]['file'], $e['trace'][0]['line']), $message); + , $ind, $total, $class, $message); foreach ($e['trace'] as $trace) { - $content .= '
    1. '; + $content .= '
    2. \n"; } - $content .= " \n\n"; + $content .= "\n
      +

      + (%d/%d) + %s +

      +

      %s

      +
      '; if ($trace['function']) { - $content .= sprintf('at %s%s%s(%s)', $this->formatClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); + $content .= sprintf('at %s%s%s(%s)', $this->formatClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); } if (isset($trace['file']) && isset($trace['line'])) { $content .= $this->formatPath($trace['file'], $trace['line']); } - $content .= "\n"; + $content .= "
      \n
      \n"; } } catch (\Exception $e) { // something nasty happened and we cannot throw an exception anymore @@ -253,9 +253,19 @@ } } + $symfonyGhostImageContents = $this->getSymfonyGhostAsSvg(); + return << -

      $title

      +
      +
      +
      +

      $title

      +
      $symfonyGhostImageContents
      +
      +
      +
      + +
      $content
      EOF; @@ -264,55 +274,56 @@ /** * Gets the stylesheet associated with the given exception. * - * @param FlattenException $exception A FlattenException instance - * * @return string The stylesheet as a string */ public function getStylesheet(FlattenException $exception) { return <<<'EOF' - .sf-reset { font: 11px Verdana, Arial, sans-serif; color: #333 } - .sf-reset .clear { clear:both; height:0; font-size:0; line-height:0; } - .sf-reset .clear_fix:after { display:block; height:0; clear:both; visibility:hidden; } - .sf-reset .clear_fix { display:inline-block; } - .sf-reset * html .clear_fix { height:1%; } - .sf-reset .clear_fix { display:block; } - .sf-reset, .sf-reset .block { margin: auto } - .sf-reset abbr { border-bottom: 1px dotted #000; cursor: help; } - .sf-reset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px } - .sf-reset strong { font-weight:bold; } - .sf-reset a { color:#6c6159; cursor: default; } - .sf-reset a img { border:none; } - .sf-reset a:hover { text-decoration:underline; } - .sf-reset em { font-style:italic; } - .sf-reset h1, .sf-reset h2 { font: 20px Georgia, "Times New Roman", Times, serif } - .sf-reset .exception_counter { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; float: left; display: block; } - .sf-reset .exception_title { margin-left: 3em; margin-bottom: 0.7em; display: block; } - .sf-reset .exception_message { margin-left: 3em; display: block; } - .sf-reset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; } - .sf-reset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px; - border-bottom-right-radius: 16px; - border-bottom-left-radius: 16px; - border-bottom:1px solid #ccc; - border-right:1px solid #ccc; - border-left:1px solid #ccc; - word-wrap: break-word; - } - .sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px; - border-top-left-radius: 16px; - border-top-right-radius: 16px; - border-top:1px solid #ccc; - border-right:1px solid #ccc; - border-left:1px solid #ccc; - overflow: hidden; - word-wrap: break-word; - } - .sf-reset a { background:none; color:#868686; text-decoration:none; } - .sf-reset a:hover { background:none; color:#313131; text-decoration:underline; } - .sf-reset ol { padding: 10px 0; } - .sf-reset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px; - border-radius: 10px; - border: 1px solid #ccc; + body { background-color: #F9F9F9; color: #222; font: 14px/1.4 Helvetica, Arial, sans-serif; margin: 0; padding-bottom: 45px; } + + a { cursor: pointer; text-decoration: none; } + a:hover { text-decoration: underline; } + abbr[title] { border-bottom: none; cursor: help; text-decoration: none; } + + code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; } + + table, tr, th, td { background: #FFF; border-collapse: collapse; vertical-align: top; } + table { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; } + table th, table td { border: solid #E0E0E0; border-width: 1px 0; padding: 8px 10px; } + table th { background-color: #E0E0E0; font-weight: bold; text-align: left; } + + .hidden-xs-down { display: none; } + .block { display: block; } + .break-long-words { -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; } + .text-muted { color: #999; } + + .container { max-width: 1024px; margin: 0 auto; padding: 0 15px; } + .container::after { content: ""; display: table; clear: both; } + + .exception-summary { background: #B0413E; border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 30px; } + + .exception-message-wrapper { display: flex; align-items: center; min-height: 70px; } + .exception-message { flex-grow: 1; padding: 30px 0; } + .exception-message, .exception-message a { color: #FFF; font-size: 21px; font-weight: 400; margin: 0; } + .exception-message.long { font-size: 18px; } + .exception-message a { border-bottom: 1px solid rgba(255, 255, 255, 0.5); font-size: inherit; text-decoration: none; } + .exception-message a:hover { border-bottom-color: #ffffff; } + + .exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; } + + .trace + .trace { margin-top: 30px; } + .trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; } + + .trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; } + + .trace-file-path, .trace-file-path a { color: #222; margin-top: 3px; font-size: 13px; } + .trace-class { color: #B0413E; } + .trace-type { padding: 0 2px; } + .trace-method { color: #B0413E; font-weight: bold; } + .trace-arguments { color: #777; font-weight: normal; padding-left: 2px; } + + @media (min-width: 575px) { + .hidden-xs-down { display: initial; } } EOF; } @@ -325,17 +336,9 @@ - + - + $content @@ -355,10 +358,10 @@ $fmt = $this->fileLinkFormat; if ($fmt && $link = is_string($fmt) ? strtr($fmt, array('%f' => $path, '%l' => $line)) : $fmt->format($path, $line)) { - return sprintf(' in %s line %d', $this->escapeHtml($link), $file, $line); + return sprintf('in %s (line %d)', $this->escapeHtml($link), $file, $line); } - return sprintf(' in %s line %d', $this->escapeHtml($path), $file, $line); + return sprintf('in %s (line %d)', $this->escapeHtml($path), $file, $line); } /** @@ -386,7 +389,7 @@ $formattedValue = str_replace("\n", '', $this->escapeHtml(var_export($item[1], true))); } - $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); + $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $this->escapeHtml($key), $formattedValue); } return implode(', ', $result); @@ -399,4 +402,9 @@ { return htmlspecialchars($str, ENT_COMPAT | ENT_SUBSTITUTE, $this->charset); } + + private function getSymfonyGhostAsSvg() + { + return ''; + } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/LICENSE --- a/vendor/symfony/debug/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2004-2017 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 -r bfffd8d7479a -r 7a779792577d vendor/symfony/debug/Resources/ext/tests/001.phpt --- a/vendor/symfony/debug/Resources/ext/tests/001.phpt Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/debug/Resources/ext/tests/001.phpt Fri Feb 23 15:52:07 2018 +0000 @@ -1,7 +1,9 @@ --TEST-- Test symfony_zval_info API --SKIPIF-- - + --FILE-- + --FILE-- + --FILE-- + --FILE-- =5.5.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" + "symfony/http-kernel": "~2.8|~3.0|~4.0" }, "autoload": { "psr-4": { "Symfony\\Component\\Debug\\": "" }, @@ -35,7 +34,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/CHANGELOG.md --- a/vendor/symfony/dependency-injection/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -9,6 +9,7 @@ * deprecated the ability to set or unset a private service with the `Container::set()` method * deprecated the ability to check for the existence of a private service with the `Container::has()` method * deprecated the ability to request a private service with the `Container::get()` method + * deprecated support for generating a dumped `Container` without populating the method map 3.0.0 ----- diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php --- a/vendor/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,8 +12,10 @@ namespace Symfony\Component\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\ExpressionLanguage; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\ExpressionLanguage\Expression; /** * Run this pass before passes that need to know more about the relation of @@ -32,6 +34,7 @@ private $currentDefinition; private $repeatedPass; private $onlyConstructorArguments; + private $expressionLanguage; /** * @param bool $onlyConstructorArguments Sets this Service Reference pass to ignore method calls @@ -97,6 +100,8 @@ foreach ($arguments as $argument) { if (is_array($argument)) { $this->processArguments($argument); + } elseif ($argument instanceof Expression) { + $this->getExpressionLanguage()->compile((string) $argument, array('this' => 'container')); } elseif ($argument instanceof Reference) { $this->graph->connect( $this->currentId, @@ -143,4 +148,27 @@ return $id; } + + private function getExpressionLanguage() + { + if (null === $this->expressionLanguage) { + $providers = $this->container->getExpressionLanguageProviders(); + $this->expressionLanguage = new ExpressionLanguage(null, $providers, function ($arg) { + if ('""' === substr_replace($arg, '', 1, -1)) { + $id = stripcslashes(substr($arg, 1, -1)); + + $this->graph->connect( + $this->currentId, + $this->currentDefinition, + $this->getDefinitionId($id), + $this->getDefinition($id) + ); + } + + return sprintf('$this->get(%s)', $arg); + }); + } + + return $this->expressionLanguage; + } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/Compiler/InlineServiceDefinitionsPass.php --- a/vendor/symfony/dependency-injection/Compiler/InlineServiceDefinitionsPass.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/Compiler/InlineServiceDefinitionsPass.php Fri Feb 23 15:52:07 2018 +0000 @@ -111,7 +111,7 @@ return true; } - if ($definition->isPublic() || $definition->isLazy()) { + if ($definition->isDeprecated() || $definition->isPublic() || $definition->isLazy()) { return false; } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/Compiler/PriorityTaggedServiceTrait.php --- a/vendor/symfony/dependency-injection/Compiler/PriorityTaggedServiceTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/Compiler/PriorityTaggedServiceTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,7 +26,7 @@ * * The order of additions must be respected for services having the same priority, * and knowing that the \SplPriorityQueue class does not respect the FIFO method, - * we should not use this class. + * we should not use that class. * * @see https://bugs.php.net/bug.php?id=53710 * @see https://bugs.php.net/bug.php?id=60926 diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/Container.php --- a/vendor/symfony/dependency-injection/Container.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/Container.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,16 +28,6 @@ * * Parameter and service keys are case insensitive. * - * A service id can contain lowercased letters, digits, underscores, and dots. - * Underscores are used to separate words, and dots to group services - * under namespaces: - * - *
        - *
      • request
      • - *
      • mysql_session_storage
      • - *
      • symfony.mysql_session_storage
      • - *
      - * * A service can also be defined by creating a method named * getXXXService(), where XXX is the camelized version of the id: * @@ -66,10 +56,14 @@ protected $services = array(); protected $methodMap = array(); - protected $privates = array(); protected $aliases = array(); protected $loading = array(); + /** + * @internal + */ + protected $privates = array(); + private $underscoreMap = array('_' => '', '.' => '_', '\\' => '_'); private $envCache = array(); @@ -200,6 +194,10 @@ public function has($id) { for ($i = 2;;) { + if (isset($this->privates[$id])) { + @trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED); + } + if ('service_container' === $id || isset($this->aliases[$id]) || isset($this->services[$id]) @@ -207,10 +205,6 @@ return true; } - if (isset($this->privates[$id])) { - @trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED); - } - if (isset($this->methodMap[$id])) { return true; } @@ -256,16 +250,20 @@ // this method can be called thousands of times during a request, avoid // calling strtolower() unless necessary. for ($i = 2;;) { - if ('service_container' === $id) { - return $this; + if (isset($this->privates[$id])) { + @trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED); } if (isset($this->aliases[$id])) { $id = $this->aliases[$id]; } + // Re-use shared service instance if it exists. if (isset($this->services[$id])) { return $this->services[$id]; } + if ('service_container' === $id) { + return $this; + } if (isset($this->loading[$id])) { throw new ServiceCircularReferenceException($id, array_keys($this->loading)); @@ -300,9 +298,6 @@ return; } - if (isset($this->privates[$id])) { - @trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED); - } $this->loading[$id] = true; @@ -331,14 +326,14 @@ { $id = strtolower($id); + if (isset($this->aliases[$id])) { + $id = $this->aliases[$id]; + } + if ('service_container' === $id) { return false; } - if (isset($this->aliases[$id])) { - $id = $this->aliases[$id]; - } - return isset($this->services[$id]); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/ContainerBuilder.php --- a/vendor/symfony/dependency-injection/ContainerBuilder.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/ContainerBuilder.php Fri Feb 23 15:52:07 2018 +0000 @@ -573,9 +573,6 @@ $compiler->compile($this); foreach ($this->definitions as $id => $definition) { - if (!$definition->isPublic()) { - $this->privates[$id] = true; - } if ($this->trackResources && $definition->isLazy() && ($class = $definition->getClass()) && class_exists($class)) { $this->addClassResource(new \ReflectionClass($class)); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/Definition.php --- a/vendor/symfony/dependency-injection/Definition.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/Definition.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,7 +26,7 @@ private $factory; private $shared = true; private $deprecated = false; - private $deprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.'; + private $deprecationTemplate; private $properties = array(); private $calls = array(); private $configurator; @@ -39,6 +39,8 @@ private $autowired = false; private $autowiringTypes = array(); + private static $defaultDeprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.'; + protected $arguments; /** @@ -610,7 +612,7 @@ */ public function getDeprecationMessage($id) { - return str_replace('%service_id%', $id, $this->deprecationTemplate); + return str_replace('%service_id%', $id, $this->deprecationTemplate ?: self::$defaultDeprecationTemplate); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/Dumper/PhpDumper.php --- a/vendor/symfony/dependency-injection/Dumper/PhpDumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/Dumper/PhpDumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -166,7 +166,7 @@ } } if ($unusedEnvs) { - throw new EnvParameterException($unusedEnvs); + throw new EnvParameterException($unusedEnvs, null, 'Environment variables "%s" are never used. Please, check your container\'s configuration.'); } return $code; @@ -267,12 +267,11 @@ /** * Generates the require_once statement for service includes. * - * @param string $id The service id * @param Definition $definition * * @return string */ - private function addServiceInclude($id, $definition) + private function addServiceInclude($definition) { $template = " require_once %s;\n"; $code = ''; @@ -347,9 +346,9 @@ $code .= $this->addNewInstance($sDefinition, '$'.$name, ' = ', $id); if (!$this->hasReference($id, $sDefinition->getMethodCalls(), true) && !$this->hasReference($id, $sDefinition->getProperties(), true)) { - $code .= $this->addServiceProperties(null, $sDefinition, $name); - $code .= $this->addServiceMethodCalls(null, $sDefinition, $name); - $code .= $this->addServiceConfigurator(null, $sDefinition, $name); + $code .= $this->addServiceProperties($sDefinition, $name); + $code .= $this->addServiceMethodCalls($sDefinition, $name); + $code .= $this->addServiceConfigurator($sDefinition, $name); } $code .= "\n"; @@ -389,15 +388,9 @@ */ private function addServiceInstance($id, Definition $definition) { - $class = $definition->getClass(); + $class = $this->dumpValue($definition->getClass()); - if ('\\' === substr($class, 0, 1)) { - $class = substr($class, 1); - } - - $class = $this->dumpValue($class); - - if (0 === strpos($class, "'") && false === strpos($class, '$') && !preg_match('/^\'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) { + if (0 === strpos($class, "'") && false === strpos($class, '$') && !preg_match('/^\'(?:\\\{2})?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) { throw new InvalidArgumentException(sprintf('"%s" is not a valid class name for the "%s" service.', $class, $id)); } @@ -453,13 +446,12 @@ /** * Adds method calls to a service definition. * - * @param string $id * @param Definition $definition * @param string $variableName * * @return string */ - private function addServiceMethodCalls($id, Definition $definition, $variableName = 'instance') + private function addServiceMethodCalls(Definition $definition, $variableName = 'instance') { $calls = ''; foreach ($definition->getMethodCalls() as $call) { @@ -474,7 +466,7 @@ return $calls; } - private function addServiceProperties($id, Definition $definition, $variableName = 'instance') + private function addServiceProperties(Definition $definition, $variableName = 'instance') { $code = ''; foreach ($definition->getProperties() as $name => $value) { @@ -517,9 +509,9 @@ } $name = (string) $this->definitionVariables->offsetGet($iDefinition); - $code .= $this->addServiceProperties(null, $iDefinition, $name); - $code .= $this->addServiceMethodCalls(null, $iDefinition, $name); - $code .= $this->addServiceConfigurator(null, $iDefinition, $name); + $code .= $this->addServiceProperties($iDefinition, $name); + $code .= $this->addServiceMethodCalls($iDefinition, $name); + $code .= $this->addServiceConfigurator($iDefinition, $name); } if ('' !== $code) { @@ -532,13 +524,12 @@ /** * Adds configurator definition. * - * @param string $id * @param Definition $definition * @param string $variableName * * @return string */ - private function addServiceConfigurator($id, Definition $definition, $variableName = 'instance') + private function addServiceConfigurator(Definition $definition, $variableName = 'instance') { if (!$callable = $definition->getConfigurator()) { return ''; @@ -586,7 +577,7 @@ $return[] = '@throws RuntimeException always since this service is expected to be injected dynamically'; } elseif ($class = $definition->getClass()) { $class = $this->container->resolveEnvPlaceholders($class); - $return[] = sprintf('@return %s A %s instance', 0 === strpos($class, '%') ? 'object' : '\\'.ltrim($class, '\\'), ltrim($class, '\\')); + $return[] = sprintf(0 === strpos($class, '%') ? '@return object A %1$s instance' : '@return \%s', ltrim($class, '\\')); } elseif ($definition->getFactory()) { $factory = $definition->getFactory(); if (is_string($factory)) { @@ -611,40 +602,14 @@ $return = str_replace("\n * \n", "\n *\n", implode("\n * ", $return)); $return = $this->container->resolveEnvPlaceholders($return); - $doc = ''; - if ($definition->isShared()) { - $doc .= <<<'EOF' - - * - * This service is shared. - * This method always returns the same instance of the service. -EOF; - } - - if (!$definition->isPublic()) { - $doc .= <<<'EOF' - - * - * This service is private. - * If you want to be able to request this service from the container directly, - * make it public, otherwise you might end up with broken code. -EOF; - } - - if ($definition->isAutowired()) { - $doc .= <<isShared() ? ' shared' : ''; + $public = $definition->isPublic() ? 'public' : 'private'; + $autowired = $definition->isAutowired() ? ' autowired' : ''; if ($definition->isLazy()) { $lazyInitialization = '$lazyLoad = true'; - $lazyInitializationDoc = "\n * @param bool \$lazyLoad whether to try lazy-loading the service with a proxy\n *"; } else { $lazyInitialization = ''; - $lazyInitializationDoc = ''; } // with proxies, for 5.3.3 compatibility, the getter must be public to be accessible to the initializer @@ -654,8 +619,8 @@ $code = <<docStar} - * Gets the '$id' service.$doc - *$lazyInitializationDoc + * Gets the $public '$id'$shared$autowired service. + * * $return */ {$visibility} function {$methodName}($lazyInitialization) @@ -673,14 +638,14 @@ } $code .= - $this->addServiceInclude($id, $definition). + $this->addServiceInclude($definition). $this->addServiceLocalTempVariables($id, $definition). $this->addServiceInlinedDefinitions($id, $definition). $this->addServiceInstance($id, $definition). $this->addServiceInlinedDefinitionsSetup($id, $definition). - $this->addServiceProperties($id, $definition). - $this->addServiceMethodCalls($id, $definition). - $this->addServiceConfigurator($id, $definition). + $this->addServiceProperties($definition). + $this->addServiceMethodCalls($definition). + $this->addServiceConfigurator($definition). $this->addServiceReturn($id, $definition) ; } @@ -772,7 +737,7 @@ private function startClass($class, $baseClass, $namespace) { $bagClass = $this->container->isFrozen() ? 'use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;' : 'use Symfony\Component\DependencyInjection\ParameterBag\\ParameterBag;'; - $namespaceLine = $namespace ? "namespace $namespace;\n" : ''; + $namespaceLine = $namespace ? "\nnamespace $namespace;\n" : ''; return <<container->hasDefinition($service) && !$this->container->getDefinition($service)->isPublic()) { + continue; + } + $conditions[] = sprintf("\$this->has('%s')", $service); } + if (!$conditions) { + return $code; + } + // re-indent the wrapped code $code = implode("\n", array_map(function ($line) { return $line ? ' '.$line : $line; }, explode("\n", $code))); @@ -1445,11 +1418,13 @@ if (false !== strpos($class, '$')) { return sprintf('${($_ = %s) && false ?: "_"}', $class); } - if (0 !== strpos($class, "'") || !preg_match('/^\'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) { + if (0 !== strpos($class, "'") || !preg_match('/^\'(?:\\\{2})?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) { throw new RuntimeException(sprintf('Cannot dump definition because of invalid class name (%s)', $class ?: 'n/a')); } - return '\\'.substr(str_replace('\\\\', '\\', $class), 1, -1); + $class = substr(str_replace('\\\\', '\\', $class), 1, -1); + + return 0 === strpos($class, '\\') ? $class : '\\'.$class; } /** @@ -1478,6 +1453,10 @@ */ private function getServiceCall($id, Reference $reference = null) { + while ($this->container->hasAlias($id)) { + $id = (string) $this->container->getAlias($id); + } + if ('service_container' === $id) { return '$this'; } @@ -1491,10 +1470,6 @@ return sprintf('$this->get(\'%s\', ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id); } - if ($this->container->hasAlias($id)) { - $id = (string) $this->container->getAlias($id); - } - return sprintf('$this->get(\'%s\')', $id); } @@ -1593,7 +1568,15 @@ throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); } $providers = $this->container->getExpressionLanguageProviders(); - $this->expressionLanguage = new ExpressionLanguage(null, $providers); + $this->expressionLanguage = new ExpressionLanguage(null, $providers, function ($arg) { + $id = '""' === substr_replace($arg, '', 1, -1) ? stripcslashes(substr($arg, 1, -1)) : null; + + if (null !== $id && ($this->container->hasAlias($id) || $this->container->hasDefinition($id))) { + return $this->getServiceCall($id); + } + + return sprintf('$this->get(%s)', $arg); + }); if ($this->container->isTrackingResources()) { foreach ($providers as $provider) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/Dumper/XmlDumper.php --- a/vendor/symfony/dependency-injection/Dumper/XmlDumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/Dumper/XmlDumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -200,6 +200,10 @@ $service->appendChild($autowiringType); } + if ($definition->isAbstract()) { + $service->setAttribute('abstract', 'true'); + } + if ($callable = $definition->getConfigurator()) { $configurator = $this->document->createElement('configurator'); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/Exception/EnvParameterException.php --- a/vendor/symfony/dependency-injection/Exception/EnvParameterException.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/Exception/EnvParameterException.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,8 +18,8 @@ */ class EnvParameterException extends InvalidArgumentException { - public function __construct(array $usedEnvs, \Exception $previous = null) + public function __construct(array $envs, \Exception $previous = null, $message = 'Incompatible use of dynamic environment variables "%s" found in parameters.') { - parent::__construct(sprintf('Incompatible use of dynamic environment variables "%s" found in parameters.', implode('", "', $usedEnvs)), 0, $previous); + parent::__construct(sprintf($message, implode('", "', $envs)), 0, $previous); } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/ExpressionLanguage.php --- a/vendor/symfony/dependency-injection/ExpressionLanguage.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/ExpressionLanguage.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,7 +12,6 @@ namespace Symfony\Component\DependencyInjection; use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage; -use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface; /** * Adds some function to the default ExpressionLanguage. @@ -23,10 +22,13 @@ */ class ExpressionLanguage extends BaseExpressionLanguage { - public function __construct(ParserCacheInterface $cache = null, array $providers = array()) + /** + * {@inheritdoc} + */ + public function __construct($cache = null, array $providers = array(), callable $serviceCompiler = null) { // prepend the default provider to let users override it easily - array_unshift($providers, new ExpressionLanguageProvider()); + array_unshift($providers, new ExpressionLanguageProvider($serviceCompiler)); parent::__construct($cache, $providers); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dependency-injection/ExpressionLanguageProvider.php --- a/vendor/symfony/dependency-injection/ExpressionLanguageProvider.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dependency-injection/ExpressionLanguageProvider.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,10 +24,17 @@ */ class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface { + private $serviceCompiler; + + public function __construct(callable $serviceCompiler = null) + { + $this->serviceCompiler = $serviceCompiler; + } + public function getFunctions() { return array( - new ExpressionFunction('service', function ($arg) { + new ExpressionFunction('service', $this->serviceCompiler ?: function ($arg) { return sprintf('$this->get(%s)', $arg); }, function (array $variables, $value) { return $variables['container']->get($value); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dom-crawler/Crawler.php --- a/vendor/symfony/dom-crawler/Crawler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dom-crawler/Crawler.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,9 +20,6 @@ */ class Crawler implements \Countable, \IteratorAggregate { - /** - * @var string The current URI - */ protected $uri; /** @@ -58,14 +55,14 @@ private $isHtml = true; /** - * @param mixed $node A Node to use as the base for the crawling - * @param string $currentUri The current URI - * @param string $baseHref The base href value + * @param mixed $node A Node to use as the base for the crawling + * @param string $uri The current URI + * @param string $baseHref The base href value */ - public function __construct($node = null, $currentUri = null, $baseHref = null) + public function __construct($node = null, $uri = null, $baseHref = null) { - $this->uri = $currentUri; - $this->baseHref = $baseHref ?: $currentUri; + $this->uri = $uri; + $this->baseHref = $baseHref ?: $uri; $this->add($node); } @@ -107,7 +104,7 @@ * * @param \DOMNodeList|\DOMNode|array|string|null $node A node * - * @throws \InvalidArgumentException When node is not the expected type. + * @throws \InvalidArgumentException when node is not the expected type */ public function add($node) { @@ -127,8 +124,8 @@ /** * Adds HTML/XML content. * - * If the charset is not set via the content type, it is assumed - * to be ISO-8859-1, which is the default charset defined by the + * If the charset is not set via the content type, it is assumed to be UTF-8, + * or ISO-8859-1 as a fallback, which is the default charset defined by the * HTTP 1.1 specification. * * @param string $content A string to parse as HTML/XML @@ -161,7 +158,7 @@ } if (null === $charset) { - $charset = 'ISO-8859-1'; + $charset = preg_match('//u', $content) ? 'UTF-8' : 'ISO-8859-1'; } if ('x' === $xmlMatches[1]) { @@ -694,8 +691,8 @@ */ public function filter($selector) { - if (!class_exists('Symfony\\Component\\CssSelector\\CssSelectorConverter')) { - throw new \RuntimeException('Unable to filter with a CSS selector as the Symfony CssSelector 2.8+ is not installed (you can use filterXPath instead).'); + if (!class_exists(CssSelectorConverter::class)) { + throw new \RuntimeException('To filter with a CSS selector, install the CssSelector component ("composer require symfony/css-selector"). Or use filterXpath instead.'); } $converter = new CssSelectorConverter($this->isHtml); @@ -743,7 +740,7 @@ public function selectButton($value) { $translate = 'translate(@type, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")'; - $xpath = sprintf('descendant-or-self::input[((contains(%s, "submit") or contains(%s, "button")) and contains(concat(\' \', normalize-space(string(@value)), \' \'), %s)) ', $translate, $translate, static::xpathLiteral(' '.$value.' ')). + $xpath = sprintf('descendant-or-self::input[((contains(%s, "submit") or contains(%1$s, "button")) and contains(concat(\' \', normalize-space(string(@value)), \' \'), %s)) ', $translate, static::xpathLiteral(' '.$value.' ')). sprintf('or (contains(%s, "image") and contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)) or @id=%s or @name=%s] ', $translate, static::xpathLiteral(' '.$value.' '), static::xpathLiteral($value), static::xpathLiteral($value)). sprintf('| descendant-or-self::button[contains(concat(\' \', normalize-space(string(.)), \' \'), %s) or @id=%s or @name=%s]', static::xpathLiteral(' '.$value.' '), static::xpathLiteral($value), static::xpathLiteral($value)); @@ -1071,7 +1068,7 @@ } /** - * @return \ArrayIterator + * @return \ArrayIterator|\DOMElement[] */ public function getIterator() { @@ -1089,7 +1086,7 @@ $nodes = array(); do { - if ($node !== $this->getNode(0) && $node->nodeType === 1) { + if ($node !== $this->getNode(0) && 1 === $node->nodeType) { $nodes[] = $node; } } while ($node = $node->$siblingDir); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dom-crawler/Field/FileFormField.php --- a/vendor/symfony/dom-crawler/Field/FileFormField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dom-crawler/Field/FileFormField.php Fri Feb 23 15:52:07 2018 +0000 @@ -59,7 +59,7 @@ $name = $info['basename']; // copy to a tmp location - $tmp = sys_get_temp_dir().'/'.sha1(uniqid(mt_rand(), true)); + $tmp = sys_get_temp_dir().'/'.strtr(substr(base64_encode(hash('sha256', uniqid(mt_rand(), true), true)), 0, 7), '/', '_'); if (array_key_exists('extension', $info)) { $tmp .= '.'.$info['extension']; } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dom-crawler/Field/FormField.php --- a/vendor/symfony/dom-crawler/Field/FormField.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dom-crawler/Field/FormField.php Fri Feb 23 15:52:07 2018 +0000 @@ -44,8 +44,6 @@ protected $disabled; /** - * Constructor. - * * @param \DOMElement $node The node associated with this field */ public function __construct(\DOMElement $node) diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dom-crawler/Form.php --- a/vendor/symfony/dom-crawler/Form.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dom-crawler/Form.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,8 +37,6 @@ private $baseHref; /** - * Constructor. - * * @param \DOMElement $node A \DOMElement instance * @param string $currentUri The URI of the page where the form is embedded * @param string $method The method to use for the link (if null, it defaults to the method defined by the form) @@ -172,6 +170,18 @@ if (!empty($qs)) { parse_str($qs, $expandedValue); $varName = substr($name, 0, strlen(key($expandedValue))); + + array_walk_recursive( + $expandedValue, + function (&$value, $key) { + if (ctype_digit($value) && ('size' === $key || 'error' === $key)) { + $value = (int) $value; + } + } + ); + + reset($expandedValue); + $values = array_replace_recursive($values, array($varName => current($expandedValue))); } } @@ -211,6 +221,11 @@ protected function getRawUri() { + // If the form was created from a button rather than the form node, check for HTML5 action overrides + if ($this->button !== $this->node && $this->button->getAttribute('formaction')) { + return $this->button->getAttribute('formaction'); + } + return $this->node->getAttribute('action'); } @@ -227,6 +242,11 @@ return $this->method; } + // If the form was created from a button rather than the form node, check for HTML5 method override + if ($this->button !== $this->node && $this->button->getAttribute('formmethod')) { + return strtoupper($this->button->getAttribute('formmethod')); + } + return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET'; } @@ -268,8 +288,6 @@ /** * Sets a named field. - * - * @param FormField $field The field */ public function set(FormField $field) { @@ -356,8 +374,6 @@ * * Expects a 'submit' button \DOMElement and finds the corresponding form element, or the form element itself. * - * @param \DOMElement $node A \DOMElement instance - * * @throws \LogicException If given node is not a button or input or does not have a form ancestor */ protected function setNode(\DOMElement $node) @@ -427,7 +443,7 @@ // corresponding elements are either descendants or have a matching HTML5 form attribute $formId = Crawler::xpathLiteral($this->node->getAttribute('id')); - $fieldNodes = $xpath->query(sprintf('descendant::input[@form=%s] | descendant::button[@form=%s] | descendant::textarea[@form=%s] | descendant::select[@form=%s] | //form[@id=%s]//input[not(@form)] | //form[@id=%s]//button[not(@form)] | //form[@id=%s]//textarea[not(@form)] | //form[@id=%s]//select[not(@form)]', $formId, $formId, $formId, $formId, $formId, $formId, $formId, $formId)); + $fieldNodes = $xpath->query(sprintf('descendant::input[@form=%s] | descendant::button[@form=%1$s] | descendant::textarea[@form=%1$s] | descendant::select[@form=%1$s] | //form[@id=%1$s]//input[not(@form)] | //form[@id=%1$s]//button[not(@form)] | //form[@id=%1$s]//textarea[not(@form)] | //form[@id=%1$s]//select[not(@form)]', $formId)); foreach ($fieldNodes as $node) { $this->addField($node); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dom-crawler/FormFieldRegistry.php --- a/vendor/symfony/dom-crawler/FormFieldRegistry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dom-crawler/FormFieldRegistry.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,8 +26,6 @@ /** * Adds a field to the registry. - * - * @param FormField $field The field */ public function add(FormField $field) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/dom-crawler/LICENSE --- a/vendor/symfony/dom-crawler/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dom-crawler/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2004-2017 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 -r bfffd8d7479a -r 7a779792577d vendor/symfony/dom-crawler/composer.json --- a/vendor/symfony/dom-crawler/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/dom-crawler/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -16,11 +16,11 @@ } ], "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0" + "symfony/css-selector": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -34,7 +34,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php --- a/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -104,7 +104,7 @@ public function hasListeners($eventName = null) { if (null === $eventName) { - return (bool) count($this->listenerIds) || (bool) count($this->listeners); + return $this->listenerIds || $this->listeners || parent::hasListeners(); } if (isset($this->listenerIds[$eventName])) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php --- a/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -56,6 +56,7 @@ { $this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo')); $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo')); + $this->assertTrue($this->dispatcher->hasListeners()); $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); $this->assertTrue($this->dispatcher->hasListeners(self::postFoo)); $this->assertCount(1, $this->dispatcher->getListeners(self::preFoo)); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php --- a/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,7 +13,6 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher; -use Symfony\Component\EventDispatcher\Debug\WrappedListener; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -105,20 +104,10 @@ $this->assertCount(0, $dispatcher->getListeners('foo')); } - /** - * @dataProvider isWrappedDataProvider - * - * @param bool $isWrapped - */ - public function testGetCalledListeners($isWrapped) + public function testGetCalledListeners() { - $dispatcher = new EventDispatcher(); - $stopWatch = new Stopwatch(); - $tdispatcher = new TraceableEventDispatcher($dispatcher, $stopWatch); - - $listener = function () {}; - - $tdispatcher->addListener('foo', $listener, 5); + $tdispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); + $tdispatcher->addListener('foo', function () {}, 5); $listeners = $tdispatcher->getNotCalledListeners(); $this->assertArrayHasKey('data', $listeners['foo.closure']); @@ -134,14 +123,6 @@ $this->assertEquals(array(), $tdispatcher->getNotCalledListeners()); } - public function isWrappedDataProvider() - { - return array( - array(false), - array(true), - ); - } - public function testGetCalledListenersNested() { $tdispatcher = null; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/finder/CHANGELOG.md --- a/vendor/symfony/finder/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/finder/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,12 @@ CHANGELOG ========= +3.4.0 +----- + + * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` + * added Finder::hasResults() method to check if any results were found + 3.3.0 ----- diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/finder/Finder.php --- a/vendor/symfony/finder/Finder.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/finder/Finder.php Fri Feb 23 15:52:07 2018 +0000 @@ -607,6 +607,20 @@ } /** + * Check if the any results were found. + * + * @return bool + */ + public function hasResults() + { + foreach ($this->getIterator() as $_) { + return true; + } + + return false; + } + + /** * Counts all the results collected by the iterators. * * @return int diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/finder/Iterator/FilterIterator.php --- a/vendor/symfony/finder/Iterator/FilterIterator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/finder/Iterator/FilterIterator.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,6 +18,8 @@ * @see https://bugs.php.net/68557 * * @author Alex Bogomazov + * + * @deprecated since 3.4, to be removed in 4.0. */ abstract class FilterIterator extends \FilterIterator { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/finder/LICENSE --- a/vendor/symfony/finder/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/finder/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2004-2017 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 -r bfffd8d7479a -r 7a779792577d vendor/symfony/finder/Tests/FinderTest.php --- a/vendor/symfony/finder/Tests/FinderTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/finder/Tests/FinderTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -424,6 +424,20 @@ count($finder); } + public function testHasResults() + { + $finder = $this->buildFinder(); + $finder->in(__DIR__); + $this->assertTrue($finder->hasResults()); + } + + public function testNoResults() + { + $finder = $this->buildFinder(); + $finder->in(__DIR__)->name('DoesNotExist'); + $this->assertFalse($finder->hasResults()); + } + /** * @dataProvider getContainsTestData */ diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php --- a/vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,6 +13,8 @@ /** * @author Alex Bogomazov + * + * @group legacy */ class FilterIteratorTest extends RealIteratorTestCase { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/finder/composer.json --- a/vendor/symfony/finder/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/finder/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -27,7 +27,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-foundation/Cookie.php --- a/vendor/symfony/http-foundation/Cookie.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-foundation/Cookie.php Fri Feb 23 15:52:07 2018 +0000 @@ -77,6 +77,10 @@ $this->httpOnly = (bool) $httpOnly; $this->raw = (bool) $raw; + if (null !== $sameSite) { + $sameSite = strtolower($sameSite); + } + if (!in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, null), true)) { throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.'); } @@ -96,7 +100,7 @@ if ('' === (string) $this->getValue()) { $str .= 'deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001); } else { - $str .= $this->isRaw() ? $this->getValue() : urlencode($this->getValue()); + $str .= $this->isRaw() ? $this->getValue() : rawurlencode($this->getValue()); if (0 !== $this->getExpiresTime()) { $str .= '; expires='.gmdate('D, d-M-Y H:i:s T', $this->getExpiresTime()); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-foundation/IpUtils.php --- a/vendor/symfony/http-foundation/IpUtils.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-foundation/IpUtils.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,6 +18,8 @@ */ class IpUtils { + private static $checkedIps = array(); + /** * This class should not be instantiated. */ @@ -61,26 +63,31 @@ */ public static function checkIp4($requestIp, $ip) { + $cacheKey = $requestIp.'-'.$ip; + if (isset(self::$checkedIps[$cacheKey])) { + return self::$checkedIps[$cacheKey]; + } + if (!filter_var($requestIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { - return false; + return self::$checkedIps[$cacheKey] = false; } if (false !== strpos($ip, '/')) { list($address, $netmask) = explode('/', $ip, 2); if ($netmask === '0') { - return filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); + return self::$checkedIps[$cacheKey] = filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); } if ($netmask < 0 || $netmask > 32) { - return false; + return self::$checkedIps[$cacheKey] = false; } } else { $address = $ip; $netmask = 32; } - return 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); + return self::$checkedIps[$cacheKey] = 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); } /** @@ -100,6 +107,11 @@ */ public static function checkIp6($requestIp, $ip) { + $cacheKey = $requestIp.'-'.$ip; + if (isset(self::$checkedIps[$cacheKey])) { + return self::$checkedIps[$cacheKey]; + } + if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) { throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".'); } @@ -108,7 +120,7 @@ list($address, $netmask) = explode('/', $ip, 2); if ($netmask < 1 || $netmask > 128) { - return false; + return self::$checkedIps[$cacheKey] = false; } } else { $address = $ip; @@ -119,7 +131,7 @@ $bytesTest = unpack('n*', @inet_pton($requestIp)); if (!$bytesAddr || !$bytesTest) { - return false; + return self::$checkedIps[$cacheKey] = false; } for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) { @@ -127,10 +139,10 @@ $left = ($left <= 16) ? $left : 16; $mask = ~(0xffff >> $left) & 0xffff; if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { - return false; + return self::$checkedIps[$cacheKey] = false; } } - return true; + return self::$checkedIps[$cacheKey] = true; } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-foundation/RedirectResponse.php --- a/vendor/symfony/http-foundation/RedirectResponse.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-foundation/RedirectResponse.php Fri Feb 23 15:52:07 2018 +0000 @@ -87,7 +87,7 @@ - + Redirecting to %1$s diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-foundation/Request.php --- a/vendor/symfony/http-foundation/Request.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-foundation/Request.php Fri Feb 23 15:52:07 2018 +0000 @@ -1502,7 +1502,7 @@ public function getContent($asResource = false) { $currentContentIsResource = is_resource($this->content); - if (PHP_VERSION_ID < 50600 && false === $this->content) { + if (\PHP_VERSION_ID < 50600 && false === $this->content) { throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.'); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php --- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php Fri Feb 23 15:52:07 2018 +0000 @@ -91,6 +91,10 @@ * upload_progress.freq, "1%" * upload_progress.min-freq, "1" * url_rewriter.tags, "a=href,area=href,frame=src,form=,fieldset=" + * sid_length, "32" + * sid_bits_per_character, "5" + * trans_sid_hosts, $_SERVER['HTTP_HOST'] + * trans_sid_tags, "a=href,area=href,frame=src,form=" * * @param array $options Session configuration options * @param AbstractProxy|NativeSessionHandler|\SessionHandlerInterface|null $handler @@ -316,6 +320,7 @@ 'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled', 'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name', 'upload_progress.freq', 'upload_progress.min-freq', 'url_rewriter.tags', + 'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags', )); foreach ($options as $key => $value) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php --- a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,6 +20,7 @@ use Symfony\Component\VarDumper\Dumper\CliDumper; use Symfony\Component\VarDumper\Dumper\HtmlDumper; use Symfony\Component\VarDumper\Dumper\DataDumperInterface; +use Twig\Template; /** * @author Nicolas Grekas @@ -91,7 +92,7 @@ $line = $trace[$i]['line']; break; - } elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof \Twig_Template) { + } elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof Template) { $template = $trace[$i]['object']; $name = $template->getTemplateName(); $src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php --- a/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,6 +16,9 @@ use Symfony\Component\Templating\EngineInterface; use Symfony\Component\HttpKernel\Controller\ControllerReference; use Symfony\Component\HttpKernel\UriSigner; +use Twig\Environment; +use Twig\Error\LoaderError; +use Twig\Loader\ExistsLoaderInterface; /** * Implements the Hinclude rendering strategy. @@ -32,10 +35,10 @@ /** * Constructor. * - * @param EngineInterface|\Twig_Environment $templating An EngineInterface or a \Twig_Environment instance - * @param UriSigner $signer A UriSigner instance - * @param string $globalDefaultTemplate The global default content (it can be a template name or the content) - * @param string $charset + * @param EngineInterface|Environment $templating An EngineInterface or a Twig instance + * @param UriSigner $signer A UriSigner instance + * @param string $globalDefaultTemplate The global default content (it can be a template name or the content) + * @param string $charset */ public function __construct($templating = null, UriSigner $signer = null, $globalDefaultTemplate = null, $charset = 'utf-8') { @@ -48,14 +51,14 @@ /** * Sets the templating engine to use to render the default content. * - * @param EngineInterface|\Twig_Environment|null $templating An EngineInterface or a \Twig_Environment instance + * @param EngineInterface|Environment|null $templating An EngineInterface or an Environment instance * * @throws \InvalidArgumentException */ public function setTemplating($templating) { - if (null !== $templating && !$templating instanceof EngineInterface && !$templating instanceof \Twig_Environment) { - throw new \InvalidArgumentException('The hinclude rendering strategy needs an instance of \Twig_Environment or Symfony\Component\Templating\EngineInterface'); + if (null !== $templating && !$templating instanceof EngineInterface && !$templating instanceof Environment) { + throw new \InvalidArgumentException('The hinclude rendering strategy needs an instance of Twig\Environment or Symfony\Component\Templating\EngineInterface'); } $this->templating = $templating; @@ -136,7 +139,7 @@ } $loader = $this->templating->getLoader(); - if ($loader instanceof \Twig_ExistsLoaderInterface || method_exists($loader, 'exists')) { + if ($loader instanceof ExistsLoaderInterface || method_exists($loader, 'exists')) { return $loader->exists($template); } @@ -148,7 +151,7 @@ } return true; - } catch (\Twig_Error_Loader $e) { + } catch (LoaderError $e) { } return false; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php --- a/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,7 +39,7 @@ */ public function add(Response $response) { - if ($response->isValidateable()) { + if (!$response->isFresh() || !$response->isCacheable()) { $this->cacheable = false; } else { $maxAge = $response->getMaxAge(); @@ -70,6 +70,9 @@ if ($response->isValidateable()) { $response->setEtag(null); $response->setLastModified(null); + } + + if (!$response->isFresh()) { $this->cacheable = false; } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-kernel/Kernel.php --- a/vendor/symfony/http-kernel/Kernel.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-kernel/Kernel.php Fri Feb 23 15:52:07 2018 +0000 @@ -58,11 +58,11 @@ protected $startTime; protected $loadClassCache; - const VERSION = '3.2.8'; - const VERSION_ID = 30208; + const VERSION = '3.2.13'; + const VERSION_ID = 30213; const MAJOR_VERSION = 3; const MINOR_VERSION = 2; - const RELEASE_VERSION = 8; + const RELEASE_VERSION = 13; const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '07/2017'; @@ -729,7 +729,7 @@ $output .= $rawChunk; - if (PHP_VERSION_ID >= 70000) { + if (\PHP_VERSION_ID >= 70000) { // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098 unset($tokens, $rawChunk); gc_mem_caches(); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/http-kernel/composer.json --- a/vendor/symfony/http-kernel/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/http-kernel/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -40,7 +40,8 @@ "symfony/var-dumper": "~3.2" }, "conflict": { - "symfony/config": "<2.8" + "symfony/config": "<2.8", + "twig/twig": "<1.34|<2.4,>=2" }, "suggest": { "symfony/browser-kit": "", diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/phpunit-bridge/CHANGELOG.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/symfony/phpunit-bridge/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,8 @@ +CHANGELOG +========= + +3.1.0 +----- + + * passing a numerically indexed array to the constructor of the `SymfonyTestsListenerTrait` + is deprecated, pass an array of namespaces indexed by the mocked feature instead diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php --- a/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,7 +67,7 @@ 'legacy' => array(), 'other' => array(), ); - $deprecationHandler = function ($type, $msg, $file, $line, $context) use (&$deprecations, $getMode) { + $deprecationHandler = function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, $getMode) { $mode = $getMode(); if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode) { return \PHPUnit_Util_ErrorHandler::handleError($type, $msg, $file, $line, $context); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/phpunit-bridge/bin/simple-phpunit --- a/vendor/symfony/phpunit-bridge/bin/simple-phpunit Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/phpunit-bridge/bin/simple-phpunit Fri Feb 23 15:52:07 2018 +0000 @@ -16,7 +16,7 @@ error_reporting(-1); // PHPUnit 4.8 does not support PHP 7, while 5.1 requires PHP 5.6+ -$PHPUNIT_VERSION = PHP_VERSION_ID >= 50600 ? getenv('SYMFONY_PHPUNIT_VERSION') ?: '5.4' : '4.8'; +$PHPUNIT_VERSION = \PHP_VERSION_ID >= 50600 ? getenv('SYMFONY_PHPUNIT_VERSION') ?: '5.4' : '4.8'; $oldPwd = getcwd(); $PHPUNIT_DIR = getenv('SYMFONY_PHPUNIT_DIR') ?: (__DIR__.'/.phpunit'); $PHP = defined('PHP_BINARY') ? PHP_BINARY : 'php'; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/polyfill-iconv/Iconv.php --- a/vendor/symfony/polyfill-iconv/Iconv.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/polyfill-iconv/Iconv.php Fri Feb 23 15:52:07 2018 +0000 @@ -127,7 +127,8 @@ public static function iconv($inCharset, $outCharset, $str) { - if ('' === $str .= '') { + $str = (string) $str; + if ('' === $str) { return ''; } @@ -145,22 +146,33 @@ $inCharset = 'iso-8859-1'; } - if ('//translit' === substr($outCharset, -10)) { - $translit = '//TRANSLIT'; - $outCharset = substr($outCharset, 0, -10); - } + do { + $loop = false; - if ('//ignore' === substr($outCharset, -8)) { - $ignore = '//IGNORE'; - $outCharset = substr($outCharset, 0, -8); - } + if ('//translit' === substr($outCharset, -10)) { + $loop = $translit = true; + $outCharset = substr($outCharset, 0, -10); + } - if ('//translit' === substr($inCharset, -10)) { - $inCharset = substr($inCharset, 0, -10); - } - if ('//ignore' === substr($inCharset, -8)) { - $inCharset = substr($inCharset, 0, -8); - } + if ('//ignore' === substr($outCharset, -8)) { + $loop = $ignore = true; + $outCharset = substr($outCharset, 0, -8); + } + } while ($loop); + + do { + $loop = false; + + if ('//translit' === substr($inCharset, -10)) { + $loop = true; + $inCharset = substr($inCharset, 0, -10); + } + + if ('//ignore' === substr($inCharset, -8)) { + $loop = true; + $inCharset = substr($inCharset, 0, -8); + } + } while ($loop); if (isset(self::$alias[ $inCharset])) { $inCharset = self::$alias[ $inCharset]; @@ -521,7 +533,7 @@ return false; } - $s .= ''; + $s = (string) $s; $slen = self::iconv_strlen($s, 'utf-8'); $start = (int) $start; @@ -622,7 +634,7 @@ return substr($u, 0, $j); } - private static function mapToUtf8(&$result, $map, $str, $ignore) + private static function mapToUtf8(&$result, array $map, $str, $ignore) { $len = strlen($str); for ($i = 0; $i < $len; ++$i) { @@ -640,7 +652,7 @@ return true; } - private static function mapFromUtf8(&$result, $map, $str, $ignore, $translit) + private static function mapFromUtf8(&$result, array $map, $str, $ignore, $translit) { $ulenMask = self::$ulenMask; $valid = self::$isValidUtf8; @@ -696,7 +708,7 @@ return true; } - private static function qpByteCallback($m) + private static function qpByteCallback(array $m) { return '='.strtoupper(dechex(ord($m[0]))); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/polyfill-iconv/LICENSE --- a/vendor/symfony/polyfill-iconv/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/polyfill-iconv/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2014-2016 Fabien Potencier +Copyright (c) 2015-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 -r bfffd8d7479a -r 7a779792577d vendor/symfony/polyfill-iconv/composer.json --- a/vendor/symfony/polyfill-iconv/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/polyfill-iconv/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -28,7 +28,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.7-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/polyfill-mbstring/LICENSE --- a/vendor/symfony/polyfill-mbstring/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/polyfill-mbstring/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2014-2016 Fabien Potencier +Copyright (c) 2015-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 -r bfffd8d7479a -r 7a779792577d vendor/symfony/polyfill-mbstring/Mbstring.php --- a/vendor/symfony/polyfill-mbstring/Mbstring.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,7 +20,10 @@ * - mb_convert_variables - Convert character code in variable(s) * - mb_decode_mimeheader - Decode string in MIME header field * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED + * - mb_decode_numericentity - Decode HTML numeric string reference to character + * - mb_encode_numericentity - Encode character to HTML numeric string reference * - mb_convert_case - Perform case folding on a string + * - mb_detect_encoding - Detect character encoding * - mb_get_info - Get internal settings of mbstring * - mb_http_input - Detect HTTP input character encoding * - mb_http_output - Set/Get HTTP output character encoding @@ -47,8 +50,6 @@ * * Not implemented: * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference * - mb_ereg_* - Regular expression with multibyte support * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable * - mb_preferred_mime_name - Get MIME charset string @@ -137,9 +138,24 @@ trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING); } - public static function mb_convert_case($s, $mode, $encoding = null) + public static function mb_decode_numericentity($s, $convmap, $encoding = null) { - if ('' === $s .= '') { + if (null !== $s && !is_scalar($s) && !(is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.gettype($s).' given', E_USER_WARNING); + return null; + } + + if (!is_array($convmap) || !$convmap) { + return false; + } + + if (null !== $encoding && !is_scalar($encoding)) { + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); + return ''; // Instead of null (cf. mb_encode_numericentity). + } + + $s = (string) $s; + if ('' === $s) { return ''; } @@ -147,6 +163,119 @@ if ('UTF-8' === $encoding) { $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $cnt = floor(count($convmap) / 4) * 4; + + for ($i = 0; $i < $cnt; $i += 4) { + // collector_decode_htmlnumericentity ignores $convmap[$i + 3] + $convmap[$i] += $convmap[$i + 2]; + $convmap[$i + 1] += $convmap[$i + 2]; + } + + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { + $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; + for ($i = 0; $i < $cnt; $i += 4) { + if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { + return Mbstring::mb_chr($c - $convmap[$i + 2]); + } + } + return $m[0]; + }, $s); + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) + { + if (null !== $s && !is_scalar($s) && !(is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.gettype($s).' given', E_USER_WARNING); + return null; + } + + if (!is_array($convmap) || !$convmap) { + return false; + } + + if (null !== $encoding && !is_scalar($encoding)) { + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); + return null; // Instead of '' (cf. mb_decode_numericentity). + } + + if (null !== $is_hex && !is_scalar($is_hex)) { + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.gettype($s).' given', E_USER_WARNING); + return null; + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + + $cnt = floor(count($convmap) / 4) * 4; + $i = 0; + $len = strlen($s); + $result = ''; + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + $c = self::mb_ord($uchr); + + for ($j = 0; $j < $cnt; $j += 4) { + if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { + $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + continue 2; + } + } + $result .= $uchr; + } + + if (null === $encoding) { + return $result; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $result); + } + + public static function mb_convert_case($s, $mode, $encoding = null) + { + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } } else { $s = iconv($encoding, 'UTF-8//IGNORE', $s); } @@ -336,10 +465,9 @@ public static function mb_strlen($s, $encoding = null) { - switch ($encoding = self::getEncoding($encoding)) { - case 'ASCII': - case 'CP850': - return strlen($s); + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strlen($s); } return @iconv_strlen($s, $encoding); @@ -348,8 +476,12 @@ public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strpos($haystack, $needle, $offset); + } - if ('' === $needle .= '') { + $needle = (string) $needle; + if ('' === $needle) { trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); return false; @@ -361,6 +493,9 @@ public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrpos($haystack, $needle, $offset); + } if ($offset != (int) $offset) { $offset = 0; @@ -400,6 +535,9 @@ public static function mb_substr($s, $start, $length = null, $encoding = null) { $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return substr($s, $start, null === $length ? 2147483647 : $length); + } if ($start < 0) { $start = iconv_strlen($s, $encoding) + $start; @@ -417,7 +555,7 @@ } } - return iconv_substr($s, $start, $length, $encoding).''; + return (string) iconv_substr($s, $start, $length, $encoding); } public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) @@ -438,6 +576,9 @@ public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) { $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrchr($haystack, $needle, $part); + } $needle = self::mb_substr($needle, 0, 1, $encoding); $pos = iconv_strrpos($haystack, $needle, $encoding); @@ -586,7 +727,7 @@ return self::mb_substr($haystack, $pos, null, $encoding); } - private static function html_encoding_callback($m) + private static function html_encoding_callback(array $m) { $i = 1; $entities = ''; @@ -611,12 +752,12 @@ return $entities; } - private static function title_case_lower($s) + private static function title_case_lower(array $s) { return self::mb_convert_case($s[0], MB_CASE_LOWER, 'UTF-8'); } - private static function title_case_upper($s) + private static function title_case_upper(array $s) { return self::mb_convert_case($s[0], MB_CASE_UPPER, 'UTF-8'); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/polyfill-mbstring/bootstrap.php --- a/vendor/symfony/polyfill-mbstring/bootstrap.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/polyfill-mbstring/bootstrap.php Fri Feb 23 15:52:07 2018 +0000 @@ -19,6 +19,8 @@ function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } + function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } + function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/polyfill-mbstring/composer.json --- a/vendor/symfony/polyfill-mbstring/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/polyfill-mbstring/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -28,7 +28,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.7-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/psr-http-message-bridge/.travis.yml --- a/vendor/symfony/psr-http-message-bridge/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/psr-http-message-bridge/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -5,17 +5,20 @@ cache: directories: - $HOME/.composer/cache/files + - $HOME/symfony-bridge/.phpunit matrix: include: - php: 5.3 + dist: 'precise' - php: 5.4 - php: 5.5 - php: 5.6 - php: 5.3 - env: deps=low + dist: 'precise' + env: COMPOSER_OPTIONS="--prefer-lowest --prefer-stable" SYMFONY_DEPRECATIONS_HELPER=weak - php: 5.6 - env: deps=high + env: COMPOSER_OPTIONS="" SYMFONY_DEPRECATIONS_HELPER=weak - php: 7.0 - php: hhvm allow_failures: @@ -25,7 +28,9 @@ env: global: - deps=no - - SYMFONY_DEPRECATIONS_HELPER=weak + - SYMFONY_DEPRECATIONS_HELPER=strict + - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit" + - COMPOSER_OPTIONS="--prefer-stable" before_install: - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi; @@ -37,10 +42,8 @@ install: - if [ "$TRAVIS_PHP_VERSION" != "5.3" ]; then composer require --no-update zendframework/zend-diactoros; fi; - - if [ "$deps" = "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=strict; fi; - - if [ "$deps" = "no" ]; then composer --prefer-source install; fi; - - if [ "$deps" = "high" ]; then composer --prefer-source update; fi; - - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest --prefer-stable update; fi; + - composer update --prefer-source $COMPOSER_OPTIONS + - vendor/bin/simple-phpunit install script: - - phpunit + - vendor/bin/simple-phpunit diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/psr-http-message-bridge/Factory/DiactorosFactory.php --- a/vendor/symfony/psr-http-message-bridge/Factory/DiactorosFactory.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/psr-http-message-bridge/Factory/DiactorosFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -55,7 +55,7 @@ $request = new ServerRequest( $server, DiactorosRequestFactory::normalizeFiles($this->getFiles($symfonyRequest->files->all())), - $symfonyRequest->getUri(), + $symfonyRequest->getSchemeAndHttpHost().$symfonyRequest->getRequestUri(), $symfonyRequest->getMethod(), $body, $headers @@ -65,6 +65,7 @@ ->withCookieParams($symfonyRequest->cookies->all()) ->withQueryParams($symfonyRequest->query->all()) ->withParsedBody($symfonyRequest->request->all()) + ->withRequestTarget($symfonyRequest->getRequestUri()) ; foreach ($symfonyRequest->attributes->all() as $key => $value) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/psr-http-message-bridge/composer.json --- a/vendor/symfony/psr-http-message-bridge/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/psr-http-message-bridge/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -18,10 +18,10 @@ "require": { "php": ">=5.3.3", "psr/http-message": "~1.0", - "symfony/http-foundation": "~2.3|~3.0" + "symfony/http-foundation": "~2.3|~3.0|~4.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" + "symfony/phpunit-bridge": "~3.2|4.0" }, "suggest": { "psr/http-message-implementation": "To use the HttpFoundation factory", diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/routing/Loader/AnnotationFileLoader.php --- a/vendor/symfony/routing/Loader/AnnotationFileLoader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/routing/Loader/AnnotationFileLoader.php Fri Feb 23 15:52:07 2018 +0000 @@ -64,7 +64,7 @@ $collection->addResource(new FileResource($path)); $collection->addCollection($this->loader->load($class, $type)); } - if (PHP_VERSION_ID >= 70000) { + if (\PHP_VERSION_ID >= 70000) { // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098 gc_mem_caches(); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/routing/Loader/XmlFileLoader.php --- a/vendor/symfony/routing/Loader/XmlFileLoader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/routing/Loader/XmlFileLoader.php Fri Feb 23 15:52:07 2018 +0000 @@ -225,7 +225,7 @@ $condition = trim($n->textContent); break; default: - throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "default", "requirement" or "option".', $n->localName, $path)); + throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "default", "requirement", "option" or "condition".', $n->localName, $path)); } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php --- a/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,7 +49,7 @@ protected function handleRouteRequirements($pathinfo, $name, Route $route) { // expression condition - if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request))) { + if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)))) { return array(self::REQUIREMENT_MISMATCH, null); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/routing/Matcher/TraceableUrlMatcher.php --- a/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -105,7 +105,7 @@ // check condition if ($condition = $route->getCondition()) { - if (!$this->getExpressionLanguage()->evaluate($condition, array('context' => $this->context, 'request' => $this->request))) { + if (!$this->getExpressionLanguage()->evaluate($condition, array('context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)))) { $this->addTrace(sprintf('Condition "%s" does not evaluate to "true"', $condition), self::ROUTE_ALMOST_MATCHES, $name, $route); continue; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/routing/Matcher/UrlMatcher.php --- a/vendor/symfony/routing/Matcher/UrlMatcher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/routing/Matcher/UrlMatcher.php Fri Feb 23 15:52:07 2018 +0000 @@ -207,7 +207,7 @@ protected function handleRouteRequirements($pathinfo, $name, Route $route) { // expression condition - if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request))) { + if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)))) { return array(self::REQUIREMENT_MISMATCH, null); } @@ -248,4 +248,19 @@ return $this->expressionLanguage; } + + /** + * @internal + */ + protected function createRequest($pathinfo) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + return null; + } + + return Request::create($this->context->getScheme().'://'.$this->context->getHost().$this->context->getBaseUrl().$pathinfo, $this->context->getMethod(), $this->context->getParameters(), array(), array(), array( + 'SCRIPT_FILENAME' => $this->context->getBaseUrl(), + 'SCRIPT_NAME' => $this->context->getBaseUrl(), + )); + } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/serializer/Normalizer/AbstractNormalizer.php --- a/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php Fri Feb 23 15:52:07 2018 +0000 @@ -191,7 +191,7 @@ return call_user_func($this->circularReferenceHandler, $object); } - throw new CircularReferenceException(sprintf('A circular reference has been detected (configured limit: %d).', $this->circularReferenceLimit)); + throw new CircularReferenceException(sprintf('A circular reference has been detected when serializing the object of class "%s" (configured limit: %d)', get_class($object), $this->circularReferenceLimit)); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php --- a/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,7 +13,6 @@ use Symfony\Component\PropertyAccess\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Encoder\JsonEncoder; -use Symfony\Component\Serializer\Exception\CircularReferenceException; use Symfony\Component\Serializer\Exception\LogicException; use Symfony\Component\Serializer\Exception\UnexpectedValueException; use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; @@ -52,8 +51,6 @@ /** * {@inheritdoc} - * - * @throws CircularReferenceException */ public function normalize($object, $format = null, array $context = array()) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/serializer/Normalizer/ArrayDenormalizer.php --- a/vendor/symfony/serializer/Normalizer/ArrayDenormalizer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/serializer/Normalizer/ArrayDenormalizer.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,8 +31,6 @@ /** * {@inheritdoc} - * - * @throws UnexpectedValueException */ public function denormalize($data, $class, $format = null, array $context = array()) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/serializer/Normalizer/DataUriNormalizer.php --- a/vendor/symfony/serializer/Normalizer/DataUriNormalizer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/serializer/Normalizer/DataUriNormalizer.php Fri Feb 23 15:52:07 2018 +0000 @@ -79,9 +79,6 @@ * Regex adapted from Brian Grinstead code. * * @see https://gist.github.com/bgrins/6194623 - * - * @throws InvalidArgumentException - * @throws UnexpectedValueException */ public function denormalize($data, $class, $format = null, array $context = array()) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/serializer/Normalizer/DenormalizerInterface.php --- a/vendor/symfony/serializer/Normalizer/DenormalizerInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/serializer/Normalizer/DenormalizerInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -11,6 +11,13 @@ namespace Symfony\Component\Serializer\Normalizer; +use Symfony\Component\Serializer\Exception\BadMethodCallException; +use Symfony\Component\Serializer\Exception\ExtraAttributesException; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; +use Symfony\Component\Serializer\Exception\LogicException; +use Symfony\Component\Serializer\Exception\RuntimeException; +use Symfony\Component\Serializer\Exception\UnexpectedValueException; + /** * Defines the interface of denormalizers. * @@ -27,6 +34,13 @@ * @param array $context options available to the denormalizer * * @return object + * + * @throws BadMethodCallException Occurs when the normalizer is not called in an expected context + * @throws InvalidArgumentException Occurs when the arguments are not coherent or not supported + * @throws UnexpectedValueException Occurs when the item cannot be hydrated with the given data + * @throws ExtraAttributesException Occurs when the item doesn't have attribute to receive given data + * @throws LogicException Occurs when the normalizer is not supposed to denormalize + * @throws RuntimeException Occurs if the class cannot be instantiated */ public function denormalize($data, $class, $format = null, array $context = array()); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/serializer/Normalizer/NormalizerInterface.php --- a/vendor/symfony/serializer/Normalizer/NormalizerInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/serializer/Normalizer/NormalizerInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -11,6 +11,10 @@ namespace Symfony\Component\Serializer\Normalizer; +use Symfony\Component\Serializer\Exception\CircularReferenceException; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; +use Symfony\Component\Serializer\Exception\LogicException; + /** * Defines the interface of normalizers. * @@ -26,6 +30,11 @@ * @param array $context Context options for the normalizer * * @return array|scalar + * + * @throws InvalidArgumentException Occurs when the object given is not an attempted type for the normalizer + * @throws CircularReferenceException Occurs when the normalizer detects a circular reference when no circular + * reference handler can fix it + * @throws LogicException Occurs when the normalizer is not called in an expected context */ public function normalize($object, $format = null, array $context = array()); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/translation/DataCollectorTranslator.php --- a/vendor/symfony/translation/DataCollectorTranslator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/translation/DataCollectorTranslator.php Fri Feb 23 15:52:07 2018 +0000 @@ -97,7 +97,7 @@ */ public function getFallbackLocales() { - if ($this->translator instanceof Translator) { + if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { return $this->translator->getFallbackLocales(); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/translation/Dumper/IcuResFileDumper.php --- a/vendor/symfony/translation/Dumper/IcuResFileDumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/translation/Dumper/IcuResFileDumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,7 +52,7 @@ $resOffset = $this->getPosition($data); - $data .= pack('v', count($messages)) + $data .= pack('v', count($messages->all($domain))) .$indexes .$this->writePadding($data) .$resources @@ -63,11 +63,11 @@ $root = pack('V7', $resOffset + (2 << 28), // Resource Offset + Resource Type 6, // Index length - $keyTop, // Index keys top - $bundleTop, // Index resources top - $bundleTop, // Index bundle top - count($messages), // Index max table length - 0 // Index attributes + $keyTop, // Index keys top + $bundleTop, // Index resources top + $bundleTop, // Index bundle top + count($messages->all($domain)), // Index max table length + 0 // Index attributes ); $header = pack('vC2v4C12@32', diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/translation/Loader/FileLoader.php --- a/vendor/symfony/translation/Loader/FileLoader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/translation/Loader/FileLoader.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,7 +54,7 @@ return $catalogue; } - /* + /** * @param string $resource * * @return array diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/translation/LoggingTranslator.php --- a/vendor/symfony/translation/LoggingTranslator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/translation/LoggingTranslator.php Fri Feb 23 15:52:07 2018 +0000 @@ -96,7 +96,7 @@ */ public function getFallbackLocales() { - if ($this->translator instanceof Translator) { + if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { return $this->translator->getFallbackLocales(); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/validator/Constraints/AbstractComparison.php --- a/vendor/symfony/validator/Constraints/AbstractComparison.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/validator/Constraints/AbstractComparison.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,6 +30,10 @@ */ public function __construct($options = null) { + if (null === $options) { + $options = array(); + } + if (is_array($options) && !isset($options['value'])) { throw new ConstraintDefinitionException(sprintf( 'The %s constraint requires the "value" option to be set.', diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/validator/Constraints/IbanValidator.php --- a/vendor/symfony/validator/Constraints/IbanValidator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/validator/Constraints/IbanValidator.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,7 +33,7 @@ * a BBAN (Basic Bank Account Number) which has a fixed length per country and, * included within it, a bank identifier with a fixed position and a fixed length per country * - * @see http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf + * @see https://www.swift.com/sites/default/files/resources/iban_registry.pdf * * @var array */ @@ -129,7 +129,7 @@ 'TL' => 'TL\d{2}\d{3}\d{14}\d{2}', // Timor-Leste 'TN' => 'TN59\d{2}\d{3}\d{13}\d{2}', // Tunisia 'TR' => 'TR\d{2}\d{5}[\dA-Z]{1}[\dA-Z]{16}', // Turkey - 'UA' => 'UA\d{2}[A-Z]{6}[\dA-Z]{19}', // Ukraine + 'UA' => 'UA\d{2}\d{6}[\dA-Z]{19}', // Ukraine 'VG' => 'VG\d{2}[A-Z]{4}\d{16}', // Virgin Islands, British 'WF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Wallis and Futuna Islands 'XK' => 'XK\d{2}\d{4}\d{10}\d{2}', // Republic of Kosovo diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/validator/Constraints/UrlValidator.php --- a/vendor/symfony/validator/Constraints/UrlValidator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/validator/Constraints/UrlValidator.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,7 +47,7 @@ throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url'); } - if (null === $value) { + if (null === $value || '' === $value) { return; } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/validator/composer.json --- a/vendor/symfony/validator/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/validator/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -43,7 +43,6 @@ "symfony/yaml": "", "symfony/config": "", "egulias/email-validator": "Strict (RFC compliant) email validation", - "symfony/property-access": "For using the Expression validator", "symfony/expression-language": "For using the Expression validator" }, "autoload": { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/CHANGELOG.md --- a/vendor/symfony/var-dumper/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,6 +1,12 @@ CHANGELOG ========= +3.4.0 +----- + + * added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth + * deprecated `MongoCaster` + 2.7.0 ----- diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Caster/Caster.php --- a/vendor/symfony/var-dumper/Caster/Caster.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Caster/Caster.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,7 +49,7 @@ public static function castObject($obj, $class, $hasDebugInfo = false) { if ($class instanceof \ReflectionClass) { - @trigger_error(sprintf('Passing a ReflectionClass to %s() is deprecated since version 3.3 and will be unsupported in 4.0. Pass the class name as string instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a ReflectionClass to %s() is deprecated since Symfony 3.3 and will be unsupported in 4.0. Pass the class name as string instead.', __METHOD__), E_USER_DEPRECATED); $hasDebugInfo = $class->hasMethod('__debugInfo'); $class = $class->name; } @@ -118,8 +118,8 @@ if (null === $v) { $type |= self::EXCLUDE_NULL & $filter; - } - if (empty($v)) { + $type |= self::EXCLUDE_EMPTY & $filter; + } elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || array() === $v) { $type |= self::EXCLUDE_EMPTY & $filter; } if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !in_array($k, $listedProperties, true)) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Caster/DateCaster.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/symfony/var-dumper/Caster/DateCaster.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * Casts DateTimeInterface related classes to array representation. + * + * @author Dany Maillard + */ +class DateCaster +{ + public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, $isNested, $filter) + { + $prefix = Caster::PREFIX_VIRTUAL; + $location = $d->getTimezone()->getLocation(); + $fromNow = (new \DateTime())->diff($d); + + $title = $d->format('l, F j, Y') + ."\n".self::formatInterval($fromNow).' from now' + .($location ? ($d->format('I') ? "\nDST On" : "\nDST Off") : '') + ; + + $a = array(); + $a[$prefix.'date'] = new ConstStub(self::formatDateTime($d, $location ? ' e (P)' : ' P'), $title); + + $stub->class .= $d->format(' @U'); + + return $a; + } + + public static function castInterval(\DateInterval $interval, array $a, Stub $stub, $isNested, $filter) + { + $now = new \DateTimeImmutable(); + $numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp(); + $title = number_format($numberOfSeconds, 0, '.', ' ').'s'; + + $i = array(Caster::PREFIX_VIRTUAL.'interval' => new ConstStub(self::formatInterval($interval), $title)); + + return $filter & Caster::EXCLUDE_VERBOSE ? $i : $i + $a; + } + + private static function formatInterval(\DateInterval $i) + { + $format = '%R '; + + if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) { + $i = date_diff($d = new \DateTime(), date_add(clone $d, $i)); // recalculate carry over points + $format .= 0 < $i->days ? '%ad ' : ''; + } else { + $format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : ''); + } + + if (\PHP_VERSION_ID >= 70100 && isset($i->f)) { + $format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : ''; + } else { + $format .= $i->h || $i->i || $i->s ? '%H:%I:%S' : ''; + } + + $format = '%R ' === $format ? '0s' : $format; + + return $i->format(rtrim($format)); + } + + public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, $isNested, $filter) + { + $location = $timeZone->getLocation(); + $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P'); + $title = $location && extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code'], \Locale::getDefault()) : ''; + + $z = array(Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title)); + + return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a; + } + + public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNested, $filter) + { + if (defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) { // see https://bugs.php.net/bug.php?id=71635 + return $a; + } + + $dates = array(); + if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/bug.php?id=74639 + foreach (clone $p as $i => $d) { + if (3 === $i) { + $now = new \DateTimeImmutable(); + $dates[] = sprintf('%s more', ($end = $p->getEndDate()) + ? ceil(($end->format('U.u') - $d->format('U.u')) / ($now->add($p->getDateInterval())->format('U.u') - $now->format('U.u'))) + : $p->recurrences - $i + ); + break; + } + $dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d)); + } + } + + $period = sprintf( + 'every %s, from %s (%s) %s', + self::formatInterval($p->getDateInterval()), + self::formatDateTime($p->getStartDate()), + $p->include_start_date ? 'included' : 'excluded', + ($end = $p->getEndDate()) ? 'to '.self::formatDateTime($end) : 'recurring '.$p->recurrences.' time/s' + ); + + $p = array(Caster::PREFIX_VIRTUAL.'period' => new ConstStub($period, implode("\n", $dates))); + + return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a; + } + + private static function formatDateTime(\DateTimeInterface $d, $extra = '') + { + return $d->format('Y-m-d H:i:'.self::formatSeconds($d->format('s'), $d->format('u')).$extra); + } + + private static function formatSeconds($s, $us) + { + return sprintf('%02d.%s', $s, 0 === ($len = strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us)); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Caster/ExceptionCaster.php --- a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php Fri Feb 23 15:52:07 2018 +0000 @@ -127,6 +127,7 @@ } $lastCall = isset($frames[$i]['function']) ? (isset($frames[$i]['class']) ? $frames[0]['class'].$frames[$i]['type'] : '').$frames[$i]['function'].'()' : ''; $frames[] = array('function' => ''); + $collapse = false; for ($j += $trace->numberingOffset - $i++; isset($frames[$i]); ++$i, --$j) { $f = $frames[$i]; @@ -145,6 +146,13 @@ $f = self::castFrameStub($frame, array(), $frame, true); if (isset($f[$prefix.'src'])) { foreach ($f[$prefix.'src']->value as $label => $frame) { + if (0 === strpos($label, "\0~collapse=0")) { + if ($collapse) { + $label = substr_replace($label, '1', 11, 1); + } else { + $collapse = true; + } + } $label = substr_replace($label, "title=Stack level $j.&", 2, 0); } $f = $frames[$i - 1]; @@ -162,7 +170,7 @@ } else { $label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$lastCall; } - $a[$label] = $frame; + $a[substr_replace($label, sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame; $lastCall = $call; } @@ -197,9 +205,10 @@ $caller = isset($f['function']) ? sprintf('in %s() on line %d', (isset($f['class']) ? $f['class'].$f['type'] : '').$f['function'], $f['line']) : null; $src = $f['line']; $srcKey = $f['file']; - $ellipsis = (new LinkStub($srcKey, 0))->attr; - $ellipsisTail = isset($ellipsis['ellipsis-tail']) ? $ellipsis['ellipsis-tail'] : 0; - $ellipsis = isset($ellipsis['ellipsis']) ? $ellipsis['ellipsis'] : 0; + $ellipsis = new LinkStub($srcKey, 0); + $srcAttr = 'collapse='.(int) $ellipsis->inVendor; + $ellipsisTail = isset($ellipsis->attr['ellipsis-tail']) ? $ellipsis->attr['ellipsis-tail'] : 0; + $ellipsis = isset($ellipsis->attr['ellipsis']) ? $ellipsis->attr['ellipsis'] : 0; if (file_exists($f['file']) && 0 <= self::$srcContext) { if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) { @@ -225,8 +234,11 @@ $ellipsis += 1 + strlen($f['line']); } } + $srcAttr .= '&separator= '; + } else { + $srcAttr .= '&separator=:'; } - $srcAttr = $ellipsis ? 'ellipsis-type=path&ellipsis='.$ellipsis.'&ellipsis-tail='.$ellipsisTail : ''; + $srcAttr .= $ellipsis ? '&ellipsis-type=path&ellipsis='.$ellipsis.'&ellipsis-tail='.$ellipsisTail : ''; self::$framesCache[$cacheKey] = $a[$prefix.'src'] = new EnumStub(array("\0~$srcAttr\0$srcKey" => $src)); } } @@ -329,7 +341,7 @@ } } $c->attr['lang'] = $lang; - $srcLines[sprintf("\0~%d\0", $i + $line - $srcContext)] = $c; + $srcLines[sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c; } return new EnumStub($srcLines); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Caster/LinkStub.php --- a/vendor/symfony/var-dumper/Caster/LinkStub.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Caster/LinkStub.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,6 +18,8 @@ */ class LinkStub extends ConstStub { + public $inVendor = false; + private static $vendorRoots; private static $composerRoots; @@ -50,10 +52,10 @@ if ($label !== $this->attr['file'] = realpath($href) ?: $href) { return; } - if ($composerRoot = $this->getComposerRoot($href, $inVendor)) { + if ($composerRoot = $this->getComposerRoot($href, $this->inVendor)) { $this->attr['ellipsis'] = strlen($href) - strlen($composerRoot) + 1; $this->attr['ellipsis-type'] = 'path'; - $this->attr['ellipsis-tail'] = 1 + ($inVendor ? 2 + strlen(implode(array_slice(explode(DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0); + $this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + strlen(implode(array_slice(explode(DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0); } elseif (3 < count($ellipsis = explode(DIRECTORY_SEPARATOR, $href))) { $this->attr['ellipsis'] = 2 + strlen(implode(array_slice($ellipsis, -2))); $this->attr['ellipsis-type'] = 'path'; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Caster/MongoCaster.php --- a/vendor/symfony/var-dumper/Caster/MongoCaster.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Caster/MongoCaster.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,10 +13,14 @@ use Symfony\Component\VarDumper\Cloner\Stub; +@trigger_error('The '.__NAMESPACE__.'\MongoCaster class is deprecated since Symfony 3.4 and will be removed in 4.0.', E_USER_DEPRECATED); + /** * Casts classes from the MongoDb extension to array representation. * * @author Nicolas Grekas + * + * @deprecated since version 3.4, to be removed in 4.0. */ class MongoCaster { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Caster/ReflectionCaster.php --- a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php Fri Feb 23 15:52:07 2018 +0000 @@ -122,7 +122,7 @@ $function = new FrameStub($frame, false, true); $function = ExceptionCaster::castFrameStub($function, array(), $function, true); $a[$prefix.'executing'] = new EnumStub(array( - $frame['class'].$frame['type'].$frame['function'].'()' => $function[$prefix.'src'], + "\0~separator= \0".$frame['class'].$frame['type'].$frame['function'].'()' => $function[$prefix.'src'], )); } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Cloner/AbstractCloner.php --- a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php Fri Feb 23 15:52:07 2018 +0000 @@ -109,6 +109,11 @@ 'Redis' => array('Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'), 'RedisArray' => array('Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'), + 'DateTimeInterface' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castDateTime'), + 'DateInterval' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castInterval'), + 'DateTimeZone' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castTimeZone'), + 'DatePeriod' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castPeriod'), + ':curl' => array('Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'), ':dba' => array('Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'), ':dba persistent' => array('Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'), @@ -127,6 +132,7 @@ protected $maxItems = 2500; protected $maxString = -1; + protected $minDepth = 1; protected $useExt; private $casters = array(); @@ -166,7 +172,7 @@ } /** - * Sets the maximum number of items to clone past the first level in nested structures. + * Sets the maximum number of items to clone past the minimum depth in nested structures. * * @param int $maxItems */ @@ -186,6 +192,17 @@ } /** + * Sets the minimum tree depth where we are guaranteed to clone all the items. After this + * depth is reached, only setMaxItems items will be cloned. + * + * @param int $minDepth + */ + public function setMinDepth($minDepth) + { + $this->minDepth = (int) $minDepth; + } + + /** * Clones a PHP variable. * * @param mixed $var Any PHP variable @@ -195,7 +212,7 @@ */ public function cloneVar($var, $filter = 0) { - $this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context) { + $this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) { if (E_RECOVERABLE_ERROR === $type || E_USER_ERROR === $type) { // Cloner never dies throw new \ErrorException($msg, 0, $type, $file, $line); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Cloner/Cursor.php --- a/vendor/symfony/var-dumper/Cloner/Cursor.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Cloner/Cursor.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,4 +39,5 @@ public $hashCut = 0; public $stop = false; public $attr = array(); + public $skipChildren = false; } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Cloner/Data.php --- a/vendor/symfony/var-dumper/Cloner/Data.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Cloner/Data.php Fri Feb 23 15:52:07 2018 +0000 @@ -63,7 +63,7 @@ /** * @param bool $recursive Whether values should be resolved recursively or not * - * @return scalar|array|null|Data[] A native representation of the original value + * @return string|int|float|bool|array|null|Data[] A native representation of the original value */ public function getValue($recursive = false) { @@ -172,7 +172,7 @@ */ public function getRawData() { - @trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__)); + @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__)); return $this->data; } @@ -356,10 +356,16 @@ $withChildren = $children && $cursor->depth !== $this->maxDepth && $this->maxItemsPerDepth; $dumper->enterHash($cursor, $item->type, $item->class, $withChildren); if ($withChildren) { - $cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class); + if ($cursor->skipChildren) { + $withChildren = false; + $cut = -1; + } else { + $cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class); + } } elseif ($children && 0 <= $cut) { $cut += count($children); } + $cursor->skipChildren = false; $dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut); break; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Cloner/DumperInterface.php --- a/vendor/symfony/var-dumper/Cloner/DumperInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Cloner/DumperInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,9 +21,9 @@ /** * Dumps a scalar value. * - * @param Cursor $cursor The Cursor position in the dump - * @param string $type The PHP type of the value being dumped - * @param scalar $value The scalar value being dumped + * @param Cursor $cursor The Cursor position in the dump + * @param string $type The PHP type of the value being dumped + * @param string|int|float|bool $value The scalar value being dumped */ public function dumpScalar(Cursor $cursor, $type, $value); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Cloner/VarCloner.php --- a/vendor/symfony/var-dumper/Cloner/VarCloner.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Cloner/VarCloner.php Fri Feb 23 15:52:07 2018 +0000 @@ -27,7 +27,7 @@ protected function doClone($var) { $len = 1; // Length of $queue - $pos = 0; // Number of cloned items past the first level + $pos = 0; // Number of cloned items past the minimum depth $refsCounter = 0; // Hard references counter $queue = array(array($var)); // This breadth-first queue is the return value $indexedArrays = array(); // Map of queue indexes that hold numerically indexed arrays @@ -37,6 +37,10 @@ $values = array(); // Map of stub objects' hashes to original values $maxItems = $this->maxItems; $maxString = $this->maxString; + $minDepth = $this->minDepth; + $currentDepth = 0; // Current tree depth + $currentDepthFinalIndex = 0; // Final $queue index for current tree depth + $minimumDepthReached = 0 === $minDepth; // Becomes true when minimum tree depth has been reached $cookie = (object) array(); // Unique object used to detect hard references $a = null; // Array cast for nested structures $stub = null; // Stub capturing the main properties of an original item value @@ -54,6 +58,15 @@ $fromObjCast = false; for ($i = 0; $i < $len; ++$i) { + // Detect when we move on to the next tree depth + if ($i > $currentDepthFinalIndex) { + ++$currentDepth; + $currentDepthFinalIndex = $len - 1; + if ($currentDepth >= $minDepth) { + $minimumDepthReached = true; + } + } + $refs = $vals = $queue[$i]; if (\PHP_VERSION_ID < 70200 && empty($indexedArrays[$i])) { // see https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts @@ -94,13 +107,16 @@ // Create $stub when the original value $v can not be used directly // If $v is a nested structure, put that structure in array $a switch (true) { - case empty($v): - case true === $v: + case null === $v: + case \is_bool($v): case \is_int($v): case \is_float($v): continue 2; case \is_string($v): + if ('' === $v) { + continue 2; + } if (!\preg_match('//u', $v)) { $stub = new Stub(); $stub->type = Stub::TYPE_STRING; @@ -124,6 +140,9 @@ break; case \is_array($v): + if (!$v) { + continue 2; + } $stub = $arrayStub; $stub->class = Stub::ARRAY_INDEXED; @@ -174,7 +193,7 @@ $stub->handle = $h; } $stub->value = null; - if (0 <= $maxItems && $maxItems <= $pos) { + if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) { $stub->cut = \count($a); $a = null; } @@ -199,7 +218,7 @@ $stub->handle = $h; $a = $this->castResource($stub, 0 < $i); $stub->value = null; - if (0 <= $maxItems && $maxItems <= $pos) { + if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) { $stub->cut = \count($a); $a = null; } @@ -215,7 +234,7 @@ } if ($a) { - if (!$i || 0 > $maxItems) { + if (!$minimumDepthReached || 0 > $maxItems) { $queue[$len] = $a; $stub->position = $len++; } elseif ($pos < $maxItems) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Dumper/AbstractDumper.php --- a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -101,9 +101,9 @@ /** * Sets the indentation pad string. * - * @param string $pad A string the will be prepended to dumped lines, repeated by nesting level + * @param string $pad A string that will be prepended to dumped lines, repeated by nesting level * - * @return string The indent pad + * @return string The previous indent pad */ public function setIndentPad($pad) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Dumper/CliDumper.php --- a/vendor/symfony/var-dumper/Dumper/CliDumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Dumper/CliDumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,6 +52,9 @@ "\033" => '\e', ); + protected $collapseNextHash = false; + protected $expandNextHash = false; + /** * {@inheritdoc} */ @@ -254,6 +257,11 @@ { $this->dumpKey($cursor); + if ($this->collapseNextHash) { + $cursor->skipChildren = true; + $this->collapseNextHash = $hasChild = false; + } + $class = $this->utf8Encode($class); if (Cursor::HASH_OBJECT === $type) { $prefix = $class && 'stdClass' !== $class ? $this->style('note', $class).' {' : '{'; @@ -370,7 +378,15 @@ break; } - $this->line .= $bin.$this->style($style, $key[1], $attr).': '; + if (isset($attr['collapse'])) { + if ($attr['collapse']) { + $this->collapseNextHash = true; + } else { + $this->expandNextHash = true; + } + } + + $this->line .= $bin.$this->style($style, $key[1], $attr).(isset($attr['separator']) ? $attr['separator'] : ': '); } else { // This case should not happen $this->line .= '-'.$bin.'"'.$this->style('private', $key, array('class' => '')).'": '; @@ -399,6 +415,21 @@ $this->colors = $this->supportsColors(); } + if (isset($attr['ellipsis'], $attr['ellipsis-type'])) { + $prefix = substr($value, 0, -$attr['ellipsis']); + if ('cli' === PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && 0 === strpos($prefix, $_SERVER[$pwd])) { + $prefix = '.'.substr($prefix, strlen($_SERVER[$pwd])); + } + if (!empty($attr['ellipsis-tail'])) { + $prefix .= substr($value, -$attr['ellipsis'], $attr['ellipsis-tail']); + $value = substr($value, -$attr['ellipsis'] + $attr['ellipsis-tail']); + } else { + $value = substr($value, -$attr['ellipsis']); + } + + return $this->style('default', $prefix).$this->style($style, $value); + } + $style = $this->styles[$style]; $map = static::$controlCharsMap; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Dumper/HtmlDumper.php --- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -373,7 +373,6 @@ for (i = 0; i < len; ++i) { elt = t[i]; if ('SAMP' == elt.tagName) { - elt.className = 'sf-dump-expanded'; a = elt.previousSibling || {}; if ('A' != a.tagName) { a = doc.createElement('A'); @@ -391,7 +390,9 @@ x += elt.parentNode.getAttribute('data-depth')/1; } elt.setAttribute('data-depth', x); - if (x > options.maxDepth) { + var className = elt.className; + elt.className = 'sf-dump-expanded'; + if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) { toggle(a); } } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) { @@ -433,7 +434,7 @@ if (this.isEmpty()) { return this.current(); } - this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : this.idx; + this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : 0; return this.current(); }, @@ -441,7 +442,7 @@ if (this.isEmpty()) { return this.current(); } - this.idx = this.idx > 0 ? this.idx - 1 : this.idx; + this.idx = this.idx > 0 ? this.idx - 1 : (this.nodes.length - 1); return this.current(); }, @@ -515,7 +516,7 @@ return; } - var xpathResult = doc.evaluate('//pre[@id="' + root.id + '"]//span[@class="sf-dump-str" or @class="sf-dump-key" or @class="sf-dump-public" or @class="sf-dump-protected" or @class="sf-dump-private"][contains(child::text(), ' + xpathString(searchQuery) + ')]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); + var xpathResult = doc.evaluate('//pre[@id="' + root.id + '"]//span[@class="sf-dump-str" or @class="sf-dump-key" or @class="sf-dump-public" or @class="sf-dump-protected" or @class="sf-dump-private"][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); while (node = xpathResult.iterateNext()) state.nodes.push(node); @@ -735,15 +736,25 @@ { parent::enterHash($cursor, $type, $class, false); + if ($cursor->skipChildren) { + $cursor->skipChildren = false; + $eol = ' class=sf-dump-compact>'; + } elseif ($this->expandNextHash) { + $this->expandNextHash = false; + $eol = ' class=sf-dump-expanded>'; + } else { + $eol = '>'; + } + if ($hasChild) { + $this->line .= 'refIndex) { $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2; $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex; - $this->line .= sprintf('', $this->dumpId, $r); - } else { - $this->line .= ''; + $this->line .= sprintf(' id=%s-ref%s', $this->dumpId, $r); } + $this->line .= $eol; $this->dumpLine($cursor->depth); } } @@ -828,7 +839,8 @@ $attr['href'] = $href; } if (isset($attr['href'])) { - $v = sprintf('%s', esc($this->utf8Encode($attr['href'])), $v); + $target = isset($attr['file']) ? '' : ' target="_blank"'; + $v = sprintf('%s', esc($this->utf8Encode($attr['href'])), $target, $v); } if (isset($attr['lang'])) { $v = sprintf('%s', esc($attr['lang']), $v); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/LICENSE --- a/vendor/symfony/var-dumper/LICENSE Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/LICENSE Fri Feb 23 15:52:07 2018 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2014-2017 Fabien Potencier +Copyright (c) 2014-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 -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Resources/functions/dump.php --- a/vendor/symfony/var-dumper/Resources/functions/dump.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Resources/functions/dump.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,5 +20,11 @@ foreach (func_get_args() as $var) { VarDumper::dump($var); } + + if (1 < func_num_args()) { + return func_get_args(); + } + + return $var; } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Test/VarDumperTestTrait.php --- a/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -19,17 +19,29 @@ */ trait VarDumperTestTrait { - public function assertDumpEquals($dump, $data, $message = '') + public function assertDumpEquals($dump, $data, $filter = 0, $message = '') { - $this->assertSame(rtrim($dump), $this->getDump($data), $message); + if (is_string($filter)) { + @trigger_error(sprintf('The $message argument of the "%s()" method at 3rd position is deprecated since Symfony 3.4 and will be moved at 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED); + $message = $filter; + $filter = 0; + } + + $this->assertSame(rtrim($dump), $this->getDump($data, null, $filter), $message); } - public function assertDumpMatchesFormat($dump, $data, $message = '') + public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '') { - $this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data), $message); + if (is_string($filter)) { + @trigger_error(sprintf('The $message argument of the "%s()" method at 3rd position is deprecated since Symfony 3.4 and will be moved at 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED); + $message = $filter; + $filter = 0; + } + + $this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data, null, $filter), $message); } - protected function getDump($data, $key = null) + protected function getDump($data, $key = null, $filter = 0) { $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; @@ -38,7 +50,7 @@ $cloner->setMaxItems(-1); $dumper = new CliDumper(null, null, $flags); $dumper->setColors(false); - $data = $cloner->cloneVar($data)->withRefHandles(false); + $data = $cloner->cloneVar($data, $filter)->withRefHandles(false); if (null !== $key && null === $data = $data->seek($key)) { return; } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Tests/Caster/DateCasterTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/symfony/var-dumper/Tests/Caster/DateCasterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,426 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Tests\Caster; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\VarDumper\Caster\Caster; +use Symfony\Component\VarDumper\Caster\DateCaster; +use Symfony\Component\VarDumper\Cloner\Stub; +use Symfony\Component\VarDumper\Test\VarDumperTestTrait; + +/** + * @author Dany Maillard + */ +class DateCasterTest extends TestCase +{ + use VarDumperTestTrait; + + /** + * @dataProvider provideDateTimes + */ + public function testDumpDateTime($time, $timezone, $xDate, $xTimestamp) + { + if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && preg_match('/[-+]\d{2}:\d{2}/', $timezone)) { + $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); + } + + $date = new \DateTime($time, new \DateTimeZone($timezone)); + + $xDump = <<assertDumpEquals($xDump, $date); + } + + /** + * @dataProvider provideDateTimes + */ + public function testCastDateTime($time, $timezone, $xDate, $xTimestamp, $xInfos) + { + if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && preg_match('/[-+]\d{2}:\d{2}/', $timezone)) { + $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); + } + + $stub = new Stub(); + $date = new \DateTime($time, new \DateTimeZone($timezone)); + $cast = DateCaster::castDateTime($date, array('foo' => 'bar'), $stub, false, 0); + + $xDump = << $xDate +] +EODUMP; + + $this->assertDumpEquals($xDump, $cast); + + $xDump = <<assertDumpMatchesFormat($xDump, $cast["\0~\0date"]); + } + + public function provideDateTimes() + { + return array( + array('2017-04-30 00:00:00.000000', 'Europe/Zurich', '2017-04-30 00:00:00.0 Europe/Zurich (+02:00)', 1493503200, 'Sunday, April 30, 2017%Afrom now%ADST On'), + array('2017-12-31 00:00:00.000000', 'Europe/Zurich', '2017-12-31 00:00:00.0 Europe/Zurich (+01:00)', 1514674800, 'Sunday, December 31, 2017%Afrom now%ADST Off'), + array('2017-04-30 00:00:00.000000', '+02:00', '2017-04-30 00:00:00.0 +02:00', 1493503200, 'Sunday, April 30, 2017%Afrom now'), + + array('2017-04-30 00:00:00.100000', '+00:00', '2017-04-30 00:00:00.100 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'), + array('2017-04-30 00:00:00.120000', '+00:00', '2017-04-30 00:00:00.120 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'), + array('2017-04-30 00:00:00.123000', '+00:00', '2017-04-30 00:00:00.123 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'), + array('2017-04-30 00:00:00.123400', '+00:00', '2017-04-30 00:00:00.123400 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'), + array('2017-04-30 00:00:00.123450', '+00:00', '2017-04-30 00:00:00.123450 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'), + array('2017-04-30 00:00:00.123456', '+00:00', '2017-04-30 00:00:00.123456 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'), + ); + } + + /** + * @dataProvider provideIntervals + */ + public function testDumpInterval($intervalSpec, $ms, $invert, $expected) + { + if ($ms && PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) { + $this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.'); + } + + $interval = $this->createInterval($intervalSpec, $ms, $invert); + + $xDump = <<assertDumpMatchesFormat($xDump, $interval); + } + + /** + * @dataProvider provideIntervals + */ + public function testDumpIntervalExcludingVerbosity($intervalSpec, $ms, $invert, $expected) + { + if ($ms && PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) { + $this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.'); + } + + $interval = $this->createInterval($intervalSpec, $ms, $invert); + + $xDump = <<assertDumpEquals($xDump, $interval, Caster::EXCLUDE_VERBOSE); + } + + /** + * @dataProvider provideIntervals + */ + public function testCastInterval($intervalSpec, $ms, $invert, $xInterval, $xSeconds) + { + if ($ms && PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) { + $this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.'); + } + + $interval = $this->createInterval($intervalSpec, $ms, $invert); + $stub = new Stub(); + + $cast = DateCaster::castInterval($interval, array('foo' => 'bar'), $stub, false, Caster::EXCLUDE_VERBOSE); + + $xDump = << $xInterval +] +EODUMP; + + $this->assertDumpEquals($xDump, $cast); + + if (null === $xSeconds) { + return; + } + + $xDump = <<assertDumpMatchesFormat($xDump, $cast["\0~\0interval"]); + } + + public function provideIntervals() + { + $i = new \DateInterval('PT0S'); + $ms = ($withMs = \PHP_VERSION_ID >= 70100 && isset($i->f)) ? '.0' : ''; + + return array( + array('PT0S', 0, 0, '0s', '0s'), + array('PT0S', 0.1, 0, $withMs ? '+ 00:00:00.100' : '0s', '%is'), + array('PT1S', 0, 0, '+ 00:00:01'.$ms, '%is'), + array('PT2M', 0, 0, '+ 00:02:00'.$ms, '%is'), + array('PT3H', 0, 0, '+ 03:00:00'.$ms, '%ss'), + array('P4D', 0, 0, '+ 4d', '%ss'), + array('P5M', 0, 0, '+ 5m', null), + array('P6Y', 0, 0, '+ 6y', null), + array('P1Y2M3DT4H5M6S', 0, 0, '+ 1y 2m 3d 04:05:06'.$ms, null), + array('PT1M60S', 0, 0, '+ 00:02:00'.$ms, null), + array('PT1H60M', 0, 0, '+ 02:00:00'.$ms, null), + array('P1DT24H', 0, 0, '+ 2d', null), + array('P1M32D', 0, 0, '+ 1m 32d', null), + + array('PT0S', 0, 1, '0s', '0s'), + array('PT0S', 0.1, 1, $withMs ? '- 00:00:00.100' : '0s', '%is'), + array('PT1S', 0, 1, '- 00:00:01'.$ms, '%is'), + array('PT2M', 0, 1, '- 00:02:00'.$ms, '%is'), + array('PT3H', 0, 1, '- 03:00:00'.$ms, '%ss'), + array('P4D', 0, 1, '- 4d', '%ss'), + array('P5M', 0, 1, '- 5m', null), + array('P6Y', 0, 1, '- 6y', null), + array('P1Y2M3DT4H5M6S', 0, 1, '- 1y 2m 3d 04:05:06'.$ms, null), + array('PT1M60S', 0, 1, '- 00:02:00'.$ms, null), + array('PT1H60M', 0, 1, '- 02:00:00'.$ms, null), + array('P1DT24H', 0, 1, '- 2d', null), + array('P1M32D', 0, 1, '- 1m 32d', null), + ); + } + + /** + * @dataProvider provideTimeZones + */ + public function testDumpTimeZone($timezone, $expected) + { + if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) { + $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); + } + + $timezone = new \DateTimeZone($timezone); + + $xDump = <<assertDumpMatchesFormat($xDump, $timezone); + } + + /** + * @dataProvider provideTimeZones + */ + public function testDumpTimeZoneExcludingVerbosity($timezone, $expected) + { + if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) { + $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); + } + + $timezone = new \DateTimeZone($timezone); + + $xDump = <<assertDumpMatchesFormat($xDump, $timezone, Caster::EXCLUDE_VERBOSE); + } + + /** + * @dataProvider provideTimeZones + */ + public function testCastTimeZone($timezone, $xTimezone, $xRegion) + { + if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) { + $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); + } + + $timezone = new \DateTimeZone($timezone); + $stub = new Stub(); + + $cast = DateCaster::castTimeZone($timezone, array('foo' => 'bar'), $stub, false, Caster::EXCLUDE_VERBOSE); + + $xDump = << $xTimezone +] +EODUMP; + + $this->assertDumpMatchesFormat($xDump, $cast); + + $xDump = <<assertDumpMatchesFormat($xDump, $cast["\0~\0timezone"]); + } + + public function provideTimeZones() + { + $xRegion = extension_loaded('intl') ? '%s' : ''; + + return array( + // type 1 (UTC offset) + array('-12:00', '-12:00', ''), + array('+00:00', '+00:00', ''), + array('+14:00', '+14:00', ''), + + // type 2 (timezone abbreviation) + array('GMT', '+00:00', ''), + array('a', '+01:00', ''), + array('b', '+02:00', ''), + array('z', '+00:00', ''), + + // type 3 (timezone identifier) + array('Africa/Tunis', 'Africa/Tunis (%s:00)', $xRegion), + array('America/Panama', 'America/Panama (%s:00)', $xRegion), + array('Asia/Jerusalem', 'Asia/Jerusalem (%s:00)', $xRegion), + array('Atlantic/Canary', 'Atlantic/Canary (%s:00)', $xRegion), + array('Australia/Perth', 'Australia/Perth (%s:00)', $xRegion), + array('Europe/Zurich', 'Europe/Zurich (%s:00)', $xRegion), + array('Pacific/Tahiti', 'Pacific/Tahiti (%s:00)', $xRegion), + ); + } + + /** + * @dataProvider providePeriods + */ + public function testDumpPeriod($start, $interval, $end, $options, $expected) + { + if (defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) { + $this->markTestSkipped(); + } + + $p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), is_int($end) ? $end : new \DateTime($end), $options); + + $xDump = <<assertDumpMatchesFormat($xDump, $p); + } + + /** + * @dataProvider providePeriods + */ + public function testCastPeriod($start, $interval, $end, $options, $xPeriod, $xDates) + { + if (defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) { + $this->markTestSkipped(); + } + + $p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), is_int($end) ? $end : new \DateTime($end), $options); + $stub = new Stub(); + + $cast = DateCaster::castPeriod($p, array(), $stub, false, 0); + + $xDump = << $xPeriod +] +EODUMP; + + $this->assertDumpEquals($xDump, $cast); + + $xDump = <<assertDumpMatchesFormat($xDump, $cast["\0~\0period"]); + } + + public function providePeriods() + { + $i = new \DateInterval('PT0S'); + $ms = \PHP_VERSION_ID >= 70100 && isset($i->f) ? '.0' : ''; + + $periods = array( + array('2017-01-01', 'P1D', '2017-01-03', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-03 00:00:00.0', '1) 2017-01-01%a2) 2017-01-02'), + array('2017-01-01', 'P1D', 1, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 2 time/s', '1) 2017-01-01%a2) 2017-01-02'), + + array('2017-01-01', 'P1D', '2017-01-04', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-04 00:00:00.0', '1) 2017-01-01%a2) 2017-01-02%a3) 2017-01-03'), + array('2017-01-01', 'P1D', 2, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 3 time/s', '1) 2017-01-01%a2) 2017-01-02%a3) 2017-01-03'), + + array('2017-01-01', 'P1D', '2017-01-05', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-05 00:00:00.0', '1) 2017-01-01%a2) 2017-01-02%a1 more'), + array('2017-01-01', 'P1D', 3, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 4 time/s', '1) 2017-01-01%a2) 2017-01-02%a3) 2017-01-03%a1 more'), + + array('2017-01-01', 'P1D', '2017-01-21', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-21 00:00:00.0', '1) 2017-01-01%a17 more'), + array('2017-01-01', 'P1D', 19, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 20 time/s', '1) 2017-01-01%a17 more'), + + array('2017-01-01 01:00:00', 'P1D', '2017-01-03 01:00:00', 0, 'every + 1d, from 2017-01-01 01:00:00.0 (included) to 2017-01-03 01:00:00.0', '1) 2017-01-01 01:00:00.0%a2) 2017-01-02 01:00:00.0'), + array('2017-01-01 01:00:00', 'P1D', 1, 0, 'every + 1d, from 2017-01-01 01:00:00.0 (included) recurring 2 time/s', '1) 2017-01-01 01:00:00.0%a2) 2017-01-02 01:00:00.0'), + + array('2017-01-01', 'P1DT1H', '2017-01-03', 0, "every + 1d 01:00:00$ms, from 2017-01-01 00:00:00.0 (included) to 2017-01-03 00:00:00.0", '1) 2017-01-01 00:00:00.0%a2) 2017-01-02 01:00:00.0'), + array('2017-01-01', 'P1DT1H', 1, 0, "every + 1d 01:00:00$ms, from 2017-01-01 00:00:00.0 (included) recurring 2 time/s", '1) 2017-01-01 00:00:00.0%a2) 2017-01-02 01:00:00.0'), + + array('2017-01-01', 'P1D', '2017-01-04', \DatePeriod::EXCLUDE_START_DATE, 'every + 1d, from 2017-01-01 00:00:00.0 (excluded) to 2017-01-04 00:00:00.0', '1) 2017-01-02%a2) 2017-01-03'), + array('2017-01-01', 'P1D', 2, \DatePeriod::EXCLUDE_START_DATE, 'every + 1d, from 2017-01-01 00:00:00.0 (excluded) recurring 2 time/s', '1) 2017-01-02%a2) 2017-01-03'), + ); + + if (\PHP_VERSION_ID < 70107) { + array_walk($periods, function (&$i) { $i[5] = ''; }); + } + + return $periods; + } + + private function createInterval($intervalSpec, $ms, $invert) + { + $interval = new \DateInterval($intervalSpec); + if (\PHP_VERSION_ID >= 70100 && isset($interval->f)) { + $interval->f = $ms; + } + $interval->invert = $invert; + + return $interval; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php --- a/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,6 +12,7 @@ namespace Symfony\Component\VarDumper\Tests\Caster; use PHPUnit\Framework\TestCase; +use Symfony\Component\VarDumper\Caster\Caster; use Symfony\Component\VarDumper\Caster\ExceptionCaster; use Symfony\Component\VarDumper\Caster\FrameStub; use Symfony\Component\VarDumper\Cloner\VarCloner; @@ -43,22 +44,15 @@ #message: "foo" #code: 0 #file: "%sExceptionCasterTest.php" - #line: 27 + #line: 28 trace: { - %sExceptionCasterTest.php:27: { - : { - : return new \Exception(''.$msg); - : } + %s%eTests%eCaster%eExceptionCasterTest.php:28 { + › { + › return new \Exception(''.$msg); + › } } - %sExceptionCasterTest.php:%d: { - : $ref = array('foo'); - : $e = $this->getTestException('foo', $ref); - : - arguments: { - $msg: "foo" - &$ref: array:1 [ …1] - } - } + %s%eTests%eCaster%eExceptionCasterTest.php:40 { …} + Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testDefaultSettings() {} %A EODUMP; @@ -72,19 +66,13 @@ $expectedDump = <<<'EODUMP' { - %sExceptionCasterTest.php:27: { - : { - : return new \Exception(''.$msg); - : } + %s%eTests%eCaster%eExceptionCasterTest.php:28 { + › { + › return new \Exception(''.$msg); + › } } - %sExceptionCasterTest.php:%d: { - : { - : $e = $this->getTestException(2); - : - arguments: { - $msg: 2 - } - } + %s%eTests%eCaster%eExceptionCasterTest.php:65 { …} + Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testSeek() {} %A EODUMP; @@ -101,18 +89,15 @@ #message: "1" #code: 0 #file: "%sExceptionCasterTest.php" - #line: 27 + #line: 28 trace: { - %sExceptionCasterTest.php:27: { - : { - : return new \Exception(''.$msg); - : } + %sExceptionCasterTest.php:28 { + › { + › return new \Exception(''.$msg); + › } } - %sExceptionCasterTest.php:%d: { - : { - : $e = $this->getTestException(1); - : ExceptionCaster::$traceArgs = false; - } + %s%eTests%eCaster%eExceptionCasterTest.php:84 { …} + Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testNoArgs() {} %A EODUMP; @@ -129,10 +114,10 @@ #message: "1" #code: 0 #file: "%sExceptionCasterTest.php" - #line: 27 + #line: 28 trace: { - %sExceptionCasterTest.php: 27 - %sExceptionCasterTest.php: %d + %s%eTests%eCaster%eExceptionCasterTest.php:28 + %s%eTests%eCaster%eExceptionCasterTest.php:%d %A EODUMP; @@ -157,10 +142,10 @@ #code: 0 #file: "%s%eVarDumper%eTests%eCaster%eExceptionCasterTest.php" - #line: 27 + #line: 28 trace: { %s%eVarDumper%eTests%eCaster%eExceptionCasterTest.php: 27 +Stack level %d.">%s%eVarDumper%eTests%eCaster%eExceptionCasterTest.php:28 …%d } } @@ -196,10 +181,10 @@ 0 => { class: "__TwigTemplate_VarDumperFixture_u75a09" src: { - %sTwig.php:1: { - : - : foo bar - : twig source + %sTwig.php:1 { + › + › foo bar + › twig source } } } @@ -209,10 +194,10 @@ %A } src: { - %sExceptionCasterTest.php:2: { - : foo bar - : twig source - : + %sExceptionCasterTest.php:2 { + › foo bar + › twig source + › } } } @@ -222,4 +207,20 @@ $this->assertDumpMatchesFormat($expectedDump, $f); } + + public function testExcludeVerbosity() + { + $e = $this->getTestException('foo'); + + $expectedDump = <<<'EODUMP' +Exception { + #message: "foo" + #code: 0 + #file: "%sExceptionCasterTest.php" + #line: 28 } +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $e, Caster::EXCLUDE_VERBOSE); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php --- a/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,6 +12,7 @@ namespace Symfony\Component\VarDumper\Tests\Caster; use PHPUnit\Framework\TestCase; +use Symfony\Component\VarDumper\Caster\Caster; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; use Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo; use Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass; @@ -77,13 +78,27 @@ \$b: & 123 } file: "%sReflectionCasterTest.php" - line: "67 to 67" + line: "68 to 68" } EOTXT , $var ); } + public function testClosureCasterExcludingVerbosity() + { + $var = function () {}; + + $expectedDump = <<assertDumpEquals($expectedDump, $var, Caster::EXCLUDE_VERBOSE); + } + public function testReflectionParameter() { $var = new \ReflectionParameter(__NAMESPACE__.'\reflectionParameterFixture', 0); @@ -159,11 +174,11 @@ Generator { this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …} executing: { - Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz(): { - %sGeneratorDemo.php:14: { - : { - : yield from bar(); - : } + Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz() { + %sGeneratorDemo.php:14 { + › { + › yield from bar(); + › } } } } @@ -182,31 +197,23 @@ 0 => ReflectionGenerator { this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …} trace: { - %sGeneratorDemo.php:9: { - : { - : yield 1; - : } + %s%eTests%eFixtures%eGeneratorDemo.php:9 { + › { + › yield 1; + › } } - %sGeneratorDemo.php:20: { - : { - : yield from GeneratorDemo::foo(); - : } - } - %sGeneratorDemo.php:14: { - : { - : yield from bar(); - : } - } + %s%eTests%eFixtures%eGeneratorDemo.php:20 { …} + %s%eTests%eFixtures%eGeneratorDemo.php:14 { …} } closed: false } 1 => Generator { executing: { - Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo(): { - %sGeneratorDemo.php:10: { - : yield 1; - : } - : + Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo() { + %sGeneratorDemo.php:10 { + › yield 1; + › } + › } } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php --- a/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -100,7 +100,28 @@ $expectedDump = <<<'EODUMP' array:1 [ - 0 => "Symfony\Component\VarDumper\Tests\Caster\StubCasterTest" + 0 => "Symfony\Component\VarDumper\Tests\Caster\StubCasterTest" +] + +EODUMP; + + $this->assertStringMatchesFormat($expectedDump, $dump); + } + + public function testLinkStubWithNoFileLink() + { + $var = array(new LinkStub('example.com', 0, 'http://example.com')); + + $cloner = new VarCloner(); + $dumper = new HtmlDumper(); + $dumper->setDumpHeader(''); + $dumper->setDumpBoundaries('', ''); + $dumper->setDisplayOptions(array('fileLinkFormat' => '%f:%l')); + $dump = $dumper->dump($cloner->cloneVar($var), true); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => "example.com" ] EODUMP; @@ -120,7 +141,7 @@ $expectedDump = <<<'EODUMP' array:1 [ - 0 => "hello" + 0 => "hello" ] EODUMP; @@ -161,7 +182,7 @@ $expectedDump = <<<'EODUMP' array:1 [ - 0 => "hello" + 0 => "hello" ] EODUMP; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php --- a/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -146,6 +146,174 @@ $this->assertStringMatchesFormat($expected, print_r($clone, true)); } + public function testLimits() + { + // Level 0: + $data = array( + // Level 1: + array( + // Level 2: + array( + // Level 3: + 'Level 3 Item 0', + 'Level 3 Item 1', + 'Level 3 Item 2', + 'Level 3 Item 3', + ), + array( + 'Level 3 Item 4', + 'Level 3 Item 5', + 'Level 3 Item 6', + ), + array( + 'Level 3 Item 7', + ), + ), + array( + array( + 'Level 3 Item 8', + ), + 'Level 2 Item 0', + ), + array( + 'Level 2 Item 1', + ), + 'Level 1 Item 0', + array( + // Test setMaxString: + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'SHORT', + ), + ); + + $cloner = new VarCloner(); + $cloner->setMinDepth(2); + $cloner->setMaxItems(5); + $cloner->setMaxString(20); + $clone = $cloner->cloneVar($data); + + $expected = << Array + ( + [0] => Array + ( + [0] => Array + ( + [2] => 1 + ) + + ) + + [1] => Array + ( + [0] => Array + ( + [2] => 2 + ) + + [1] => Array + ( + [2] => 3 + ) + + [2] => Array + ( + [2] => 4 + ) + + [3] => Level 1 Item 0 + [4] => Array + ( + [2] => 5 + ) + + ) + + [2] => Array + ( + [0] => Array + ( + [2] => 6 + ) + + [1] => Array + ( + [0] => 2 + [2] => 7 + ) + + [2] => Array + ( + [0] => 1 + [2] => 0 + ) + + ) + + [3] => Array + ( + [0] => Array + ( + [0] => 1 + [2] => 0 + ) + + [1] => Level 2 Item 0 + ) + + [4] => Array + ( + [0] => Level 2 Item 1 + ) + + [5] => Array + ( + [0] => Symfony\Component\VarDumper\Cloner\Stub Object + ( + [type] => 2 + [class] => 2 + [value] => ABCDEFGHIJKLMNOPQRST + [cut] => 6 + [handle] => 0 + [refCount] => 0 + [position] => 0 + [attr] => Array + ( + ) + + ) + + [1] => SHORT + ) + + [6] => Array + ( + [0] => Level 3 Item 0 + [1] => Level 3 Item 1 + [2] => Level 3 Item 2 + [3] => Level 3 Item 3 + ) + + [7] => Array + ( + [0] => Level 3 Item 4 + ) + + ) + + [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 + [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 + [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 + [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 + [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 +) + +EOTXT; + $this->assertStringMatchesFormat($expected, print_r($clone, true)); + } + public function testJsonCast() { if (2 == ini_get('xdebug.overload_var_dump')) { diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php --- a/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -86,7 +86,7 @@ default: null } } - file: "{$var['file']}" + file: "%s%eTests%eFixtures%edumb-var.php" line: "{$var['line']} to {$var['line']}" } "line" => {$var['line']} @@ -147,10 +147,10 @@ #file: "%ACliDumperTest.php" #line: %d trace: { - %ACliDumperTest.php:%d: { - : - : $ex = new \RuntimeException('foo'); - : + %ACliDumperTest.php:%d { + › + › $ex = new \RuntimeException('foo'); + › } %A } @@ -391,30 +391,16 @@ âš : Symfony\Component\VarDumper\Exception\ThrowingCasterException {{$r} #message: "Unexpected Exception thrown from a caster: Foobar" trace: { - %sTwig.php:2: { - : foo bar - : twig source - : + %sTwig.php:2 { + › foo bar + › twig source + › } - %sTemplate.php:%d: { - : try { - : \$this->doDisplay(\$context, \$blocks); - : } catch (Twig%sError \$e) { - } - %sTemplate.php:%d: { - : { - : \$this->displayWithErrorHandling(\$this->env->mergeGlobals(\$context), array_merge(\$this->blocks, \$blocks)); - : } - } - %sTemplate.php:%d: { - : try { - : \$this->display(\$context); - : } catch (%s \$e) { - } - %sCliDumperTest.php:%d: { -%A - } - } + %s%eTemplate.php:%d { …} + %s%eTemplate.php:%d { …} + %s%eTemplate.php:%d { …} + %s%eTests%eDumper%eCliDumperTest.php:%d { …} +%A } } %Awrapper_type: "PHP" stream_type: "MEMORY" diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/VarDumper.php --- a/vendor/symfony/var-dumper/VarDumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/VarDumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,7 +29,7 @@ { if (null === self::$handler) { $cloner = new VarCloner(); - $dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper(); + $dumper = in_array(PHP_SAPI, array('cli', 'phpdbg')) ? new CliDumper() : new HtmlDumper(); self::$handler = function ($var) use ($cloner, $dumper) { $dumper->dump($cloner->cloneVar($var)); }; diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/var-dumper/composer.json --- a/vendor/symfony/var-dumper/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/var-dumper/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -28,6 +28,7 @@ }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", "ext-symfony_debug": "" }, "autoload": { @@ -40,7 +41,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/yaml/CHANGELOG.md --- a/vendor/symfony/yaml/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/yaml/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -5,8 +5,8 @@ ----- * Mappings with a colon (`:`) that is not followed by a whitespace are deprecated - and will lead to a `ParseException` in Symfony 4.0 (e.g. `foo:bar` must be - `foo: bar`). + when the mapping key is not quoted and will lead to a `ParseException` in + Symfony 4.0 (e.g. `foo:bar` must be `foo: bar`). * Added support for parsing PHP constants: diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/yaml/Dumper.php --- a/vendor/symfony/yaml/Dumper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/yaml/Dumper.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,6 +41,8 @@ * Sets the indentation. * * @param int $num The amount of spaces to use for indentation of nested nodes + * + * @deprecated since version 3.1, to be removed in 4.0. Pass the indentation to the constructor instead. */ public function setIndentation($num) { @@ -81,15 +83,20 @@ $output = ''; $prefix = $indent ? str_repeat(' ', $indent) : ''; + $dumpObjectAsInlineMap = true; - if ($inline <= 0 || !is_array($input) || empty($input)) { + if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($input instanceof \ArrayObject || $input instanceof \stdClass)) { + $dumpObjectAsInlineMap = empty((array) $input); + } + + if ($inline <= 0 || (!is_array($input) && $dumpObjectAsInlineMap) || empty($input)) { $output .= $prefix.Inline::dump($input, $flags); } else { - $isAHash = Inline::isHash($input); + $dumpAsMap = Inline::isHash($input); foreach ($input as $key => $value) { if ($inline >= 1 && Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && is_string($value) && false !== strpos($value, "\n")) { - $output .= sprintf("%s%s%s |\n", $prefix, $isAHash ? Inline::dump($key, $flags).':' : '-', ''); + $output .= sprintf("%s%s%s |\n", $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', ''); foreach (preg_split('/\n|\r\n/', $value) as $row) { $output .= sprintf("%s%s%s\n", $prefix, str_repeat(' ', $this->indentation), $row); @@ -98,11 +105,17 @@ continue; } - $willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value); + $dumpObjectAsInlineMap = true; + + if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) { + $dumpObjectAsInlineMap = empty((array) $value); + } + + $willBeInlined = $inline - 1 <= 0 || !is_array($value) && $dumpObjectAsInlineMap || empty($value); $output .= sprintf('%s%s%s%s', $prefix, - $isAHash ? Inline::dump($key, $flags).':' : '-', + $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $willBeInlined ? ' ' : "\n", $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags) ).($willBeInlined ? "\n" : ''); diff -r bfffd8d7479a -r 7a779792577d vendor/symfony/yaml/Inline.php --- a/vendor/symfony/yaml/Inline.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/symfony/yaml/Inline.php Fri Feb 23 15:52:07 2018 +0000 @@ -164,7 +164,7 @@ } if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) { - return self::dumpArray((array) $value, $flags); + return self::dumpArray($value, $flags); } if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { @@ -224,12 +224,16 @@ * * @internal * - * @param array $value The PHP array to check + * @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check * * @return bool true if value is hash array, false otherwise */ - public static function isHash(array $value) + public static function isHash($value) { + if ($value instanceof \stdClass || $value instanceof \ArrayObject) { + return true; + } + $expectedKey = 0; foreach ($value as $key => $val) { @@ -457,14 +461,15 @@ } // key + $isKeyQuoted = in_array($mapping[$i], array('"', "'"), true); $key = self::parseScalar($mapping, $flags, array(':', ' '), array('"', "'"), $i, false); if (':' !== $key && false === $i = strpos($mapping, ':', $i)) { break; } - if (':' !== $key && (!isset($mapping[$i + 1]) || !in_array($mapping[$i + 1], array(' ', ',', '[', ']', '{', '}'), true))) { - @trigger_error('Using a colon that is not followed by an indication character (i.e. " ", ",", "[", "]", "{", "}" is deprecated since version 3.2 and will throw a ParseException in 4.0.', E_USER_DEPRECATED); + if (':' !== $key && !$isKeyQuoted && (!isset($mapping[$i + 1]) || !in_array($mapping[$i + 1], array(' ', ',', '[', ']', '{', '}'), true))) { + @trigger_error('Using a colon after an unquoted mapping key that is not followed by an indication character (i.e. " ", ",", "[", "]", "{", "}") is deprecated since version 3.2 and will throw a ParseException in 4.0.', E_USER_DEPRECATED); } // value diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/.php_cs.dist --- a/vendor/twig/twig/.php_cs.dist Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/.php_cs.dist Fri Feb 23 15:52:07 2018 +0000 @@ -9,6 +9,7 @@ 'no_unreachable_default_argument_value' => false, 'braces' => array('allow_single_line_closure' => true), 'heredoc_to_nowdoc' => false, + 'dir_constant' => false, )) ->setRiskyAllowed(true) ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/.travis.yml --- a/vendor/twig/twig/.travis.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/.travis.yml Fri Feb 23 15:52:07 2018 +0000 @@ -8,37 +8,42 @@ - $HOME/.composer/cache/files php: - - 5.2 - 5.3 - 5.4 - 5.5 - 5.6 - 7.0 - 7.1 - - hhvm + - nightly env: - TWIG_EXT=no - TWIG_EXT=yes before_install: - - if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi + # turn off XDebug + - phpenv config-rm xdebug.ini || return 0 install: - # Composer is not available on PHP 5.2 - - if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer install; fi + - travis_retry composer install before_script: - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && make install"; fi - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi - - if [ ${TRAVIS_PHP_VERSION:0:3} == "5.2" ]; then sed -i.bak "s|vendor/autoload.php|test/bootstrap.php|" phpunit.xml.dist; fi + +script: | + if [[ $TRAVIS_PHP_VERSION = 7.* || $TRAVIS_PHP_VERSION = nightly ]]; then + SYMFONY_PHPUNIT_VERSION=6.1 ./vendor/bin/simple-phpunit + else + ./vendor/bin/simple-phpunit + fi matrix: fast_finish: true exclude: - - php: hhvm - env: TWIG_EXT=yes - php: 7.0 env: TWIG_EXT=yes - php: 7.1 env: TWIG_EXT=yes + - php: nightly + env: TWIG_EXT=yes diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/CHANGELOG --- a/vendor/twig/twig/CHANGELOG Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/CHANGELOG Fri Feb 23 15:52:07 2018 +0000 @@ -1,3 +1,54 @@ +* 1.35.0 (2017-09-27) + + * added Twig_Profiler_Profile::reset() + * fixed use TokenParser to return an empty Node + * added RuntimeExtensionInterface + * added circular reference detection when loading templates + +* 1.34.4 (2017-07-04) + + * added support for runtime loaders in IntegrationTestCase + * fixed deprecation when using Twig_Profiler_Dumper_Html + +* 1.34.3 (2017-06-07) + + * fixed namespaces introduction + +* 1.34.2 (2017-06-05) + + * fixed namespaces introduction + +* 1.34.1 (2017-06-05) + + * fixed namespaces introduction + +* 1.34.0 (2017-06-05) + + * added support for PHPUnit 6 when testing extensions + * fixed PHP 7.2 compatibility + * fixed template name generation in Twig_Environment::createTemplate() + * removed final tag on Twig_TokenParser_Include + * added namespaced aliases for all (non-deprecated) classes and interfaces + * dropped HHVM support + * dropped PHP 5.2 support + +* 1.33.2 (2017-04-20) + + * fixed edge case in the method cache for Twig attributes + +* 1.33.1 (2017-04-18) + + * fixed the empty() test + +* 1.33.0 (2017-03-22) + + * fixed a race condition handling when writing cache files + * "length" filter now returns string length when applied to an object that does + not implement \Countable but provides __toString() + * "empty" test will now consider the return value of the __toString() method for + objects implement __toString() but not \Countable + * fixed JS escaping for unicode characters with higher code points + * 1.32.0 (2017-02-26) * fixed deprecation notice in Twig_Util_DeprecationCollector @@ -98,7 +149,7 @@ * fixed reserved keywords (forbids true, false, null and none keywords for variables names) * fixed support for PHP7 (Throwable support) - * marked the following methods as being internals on Twig_Environment: + * marked the following methods as being internals on Twig_Environment: getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(), getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(), getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension() @@ -182,7 +233,7 @@ * fixed limited RCEs when in sandbox mode * deprecated Twig_Template::getEnvironment() * deprecated the _self variable for usage outside of the from and import tags - * added Twig_BaseNodeVisitor to ease the compatibility of node visitors + * added Twig_BaseNodeVisitor to ease the compatibility of node visitors between 1.x and 2.x * 1.19.0 (2015-07-31) diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/composer.json --- a/vendor/twig/twig/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -27,21 +27,24 @@ "forum": "https://groups.google.com/forum/#!forum/twig-users" }, "require": { - "php": ">=5.2.7" + "php": ">=5.3.3" }, "require-dev": { - "symfony/phpunit-bridge": "~3.2", + "symfony/phpunit-bridge": "~3.3@dev", "symfony/debug": "~2.7", "psr/container": "^1.0" }, "autoload": { "psr-0" : { "Twig_" : "lib/" + }, + "psr-4" : { + "Twig\\" : "src/" } }, "extra": { "branch-alias": { - "dev-master": "1.32-dev" + "dev-master": "1.35-dev" } } } diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/BaseNodeVisitor.php --- a/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php Fri Feb 23 15:52:07 2018 +0000 @@ -48,3 +48,7 @@ */ abstract protected function doLeaveNode(Twig_Node $node, Twig_Environment $env); } + +class_alias('Twig_BaseNodeVisitor', 'Twig\NodeVisitor\AbstractNodeVisitor', false); +class_exists('Twig_Environment'); +class_exists('Twig_Node'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Cache/Filesystem.php --- a/vendor/twig/twig/lib/Twig/Cache/Filesystem.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Cache/Filesystem.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,8 +49,13 @@ { $dir = dirname($key); if (!is_dir($dir)) { - if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) { - throw new RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir)); + if (false === @mkdir($dir, 0777, true)) { + if (PHP_VERSION_ID >= 50300) { + clearstatcache(true, $dir); + } + if (!is_dir($dir)) { + throw new RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir)); + } } } elseif (!is_writable($dir)) { throw new RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir)); @@ -84,3 +89,5 @@ return (int) @filemtime($key); } } + +class_alias('Twig_Cache_Filesystem', 'Twig\Cache\FilesystemCache', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Cache/Null.php --- a/vendor/twig/twig/lib/Twig/Cache/Null.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Cache/Null.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,3 +36,5 @@ return 0; } } + +class_alias('Twig_Cache_Null', 'Twig\Cache\NullCache', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/CacheInterface.php --- a/vendor/twig/twig/lib/Twig/CacheInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/CacheInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,3 +54,5 @@ */ public function getTimestamp($key); } + +class_alias('Twig_CacheInterface', 'Twig\Cache\CacheInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Compiler.php --- a/vendor/twig/twig/lib/Twig/Compiler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Compiler.php Fri Feb 23 15:52:07 2018 +0000 @@ -169,7 +169,7 @@ public function repr($value) { if (is_int($value) || is_float($value)) { - if (false !== $locale = setlocale(LC_NUMERIC, 0)) { + if (false !== $locale = setlocale(LC_NUMERIC, '0')) { setlocale(LC_NUMERIC, 'C'); } @@ -279,3 +279,6 @@ return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false)); } } + +class_alias('Twig_Compiler', 'Twig\Compiler', false); +class_exists('Twig_Node'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php --- a/vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,3 +35,5 @@ } } } + +class_alias('Twig_ContainerRuntimeLoader', 'Twig\RuntimeLoader\ContainerRuntimeLoader', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Environment.php --- a/vendor/twig/twig/lib/Twig/Environment.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Environment.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,10 +16,10 @@ */ class Twig_Environment { - const VERSION = '1.32.0'; - const VERSION_ID = 13200; + const VERSION = '1.35.0'; + const VERSION_ID = 13500; const MAJOR_VERSION = 1; - const MINOR_VERSION = 32; + const MINOR_VERSION = 35; const RELEASE_VERSION = 0; const EXTRA_VERSION = ''; @@ -58,6 +58,7 @@ private $runtimeLoaders = array(); private $runtimes = array(); private $optionsHash; + private $loading = array(); /** * Constructor. @@ -382,6 +383,10 @@ * * @param string|Twig_TemplateWrapper|Twig_Template $name The template name * + * @throws Twig_Error_Loader When the template cannot be found + * @throws Twig_Error_Runtime When a previously generated cache is corrupted + * @throws Twig_Error_Syntax When an error occurred during compilation + * * @return Twig_TemplateWrapper */ public function load($name) @@ -472,7 +477,22 @@ $this->initRuntime(); } - return $this->loadedTemplates[$cls] = new $cls($this); + if (isset($this->loading[$cls])) { + throw new Twig_Error_Runtime(sprintf('Circular reference detected for Twig template "%s", path: %s.', $name, implode(' -> ', array_merge($this->loading, array($name))))); + } + + $this->loading[$cls] = $name; + + try { + $this->loadedTemplates[$cls] = new $cls($this); + unset($this->loading[$cls]); + } catch (\Exception $e) { + unset($this->loading[$cls]); + + throw $e; + } + + return $this->loadedTemplates[$cls]; } /** @@ -489,7 +509,7 @@ */ public function createTemplate($template) { - $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); + $name = sprintf('__string_template__%s', hash('sha256', $template, false)); $loader = new Twig_Loader_Chain(array( new Twig_Loader_Array(array($name => $template)), @@ -758,7 +778,7 @@ public function setLoader(Twig_LoaderInterface $loader) { - if (!$loader instanceof Twig_SourceContextLoaderInterface && 0 !== strpos(get_class($loader), 'Mock_Twig_LoaderInterface')) { + if (!$loader instanceof Twig_SourceContextLoaderInterface && 0 !== strpos(get_class($loader), 'Mock_')) { @trigger_error(sprintf('Twig loader "%s" should implement Twig_SourceContextLoaderInterface since version 1.27.', get_class($loader)), E_USER_DEPRECATED); } @@ -831,6 +851,12 @@ public function hasExtension($class) { $class = ltrim($class, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new ReflectionClass($class); + $class = $class->name; + } + if (isset($this->extensions[$class])) { if ($class !== get_class($this->extensions[$class])) { @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED); @@ -860,6 +886,11 @@ public function getExtension($class) { $class = ltrim($class, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new ReflectionClass($class); + $class = $class->name; + } if (isset($this->extensions[$class])) { if ($class !== get_class($this->extensions[$class])) { @@ -938,6 +969,12 @@ } $class = ltrim($name, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new ReflectionClass($class); + $class = $class->name; + } + if (isset($this->extensions[$class])) { if ($class !== get_class($this->extensions[$class])) { @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED); @@ -1559,3 +1596,5 @@ $this->optionsHash = implode(':', $hashParts); } } + +class_alias('Twig_Environment', 'Twig\Environment', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Error.php --- a/vendor/twig/twig/lib/Twig/Error.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Error.php Fri Feb 23 15:52:07 2018 +0000 @@ -332,11 +332,6 @@ $r = new ReflectionObject($template); $file = $r->getFileName(); - // hhvm has a bug where eval'ed files comes out as the current directory - if (is_dir($file)) { - $file = ''; - } - $exceptions = array($e = $this); while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) { $exceptions[] = $e; @@ -363,3 +358,6 @@ } } } + +class_alias('Twig_Error', 'Twig\Error\Error', false); +class_exists('Twig_Source'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Error/Loader.php --- a/vendor/twig/twig/lib/Twig/Error/Loader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Error/Loader.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,3 +36,5 @@ $this->setTemplateLine(false); } } + +class_alias('Twig_Error_Loader', 'Twig\Error\LoaderError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Error/Runtime.php --- a/vendor/twig/twig/lib/Twig/Error/Runtime.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Error/Runtime.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,3 +18,5 @@ class Twig_Error_Runtime extends Twig_Error { } + +class_alias('Twig_Error_Runtime', 'Twig\Error\RuntimeError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Error/Syntax.php --- a/vendor/twig/twig/lib/Twig/Error/Syntax.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Error/Syntax.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,3 +51,5 @@ return array_keys($alternatives); } } + +class_alias('Twig_Error_Syntax', 'Twig\Error\SyntaxError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php --- a/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -27,3 +27,5 @@ */ public function exists($name); } + +class_alias('Twig_ExistsLoaderInterface', 'Twig\Loader\ExistsLoaderInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/ExpressionParser.php --- a/vendor/twig/twig/lib/Twig/ExpressionParser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/ExpressionParser.php Fri Feb 23 15:52:07 2018 +0000 @@ -737,3 +737,5 @@ return true; } } + +class_alias('Twig_ExpressionParser', 'Twig\ExpressionParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension.php --- a/vendor/twig/twig/lib/Twig/Extension.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension.php Fri Feb 23 15:52:07 2018 +0000 @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + abstract class Twig_Extension implements Twig_ExtensionInterface { /** @@ -63,3 +64,6 @@ return get_class($this); } } + +class_alias('Twig_Extension', 'Twig\Extension\AbstractExtension', false); +class_exists('Twig_Environment'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/Core.php --- a/vendor/twig/twig/lib/Twig/Extension/Core.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Core.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,8 +1,7 @@ true, 'UTF-8' => true); - } else { - $htmlspecialcharsCharsets = array( - 'ISO-8859-1' => true, 'ISO8859-1' => true, - 'ISO-8859-15' => true, 'ISO8859-15' => true, - 'utf-8' => true, 'UTF-8' => true, - 'CP866' => true, 'IBM866' => true, '866' => true, - 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, - '1251' => true, - 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, - 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, - 'BIG5' => true, '950' => true, - 'GB2312' => true, '936' => true, - 'BIG5-HKSCS' => true, - 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true, - 'EUC-JP' => true, 'EUCJP' => true, - 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true, - ); - } - } + static $htmlspecialcharsCharsets = array( + 'ISO-8859-1' => true, 'ISO8859-1' => true, + 'ISO-8859-15' => true, 'ISO8859-15' => true, + 'utf-8' => true, 'UTF-8' => true, + 'CP866' => true, 'IBM866' => true, '866' => true, + 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, + '1251' => true, + 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, + 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, + 'BIG5' => true, '950' => true, + 'GB2312' => true, '936' => true, + 'BIG5-HKSCS' => true, + 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true, + 'EUC-JP' => true, 'EUCJP' => true, + 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true, + ); if (isset($htmlspecialcharsCharsets[$charset])) { return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); @@ -1168,8 +1159,13 @@ // \uHHHH $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); + $char = strtoupper(bin2hex($char)); - return '\\u'.strtoupper(substr('0000'.bin2hex($char), -4)); + if (4 >= strlen($char)) { + return sprintf('\u%04s', $char); + } + + return sprintf('\u%04s\u%04s', substr($char, 0, -4), substr($char, -4)); } function _twig_escape_css_callback($matches) @@ -1259,7 +1255,23 @@ */ function twig_length_filter(Twig_Environment $env, $thing) { - return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : count($thing); + if (null === $thing) { + return 0; + } + + if (is_scalar($thing)) { + return mb_strlen($thing, $env->getCharset()); + } + + if (is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) { + return mb_strlen((string) $thing, $env->getCharset()); + } + + if ($thing instanceof \Countable || is_array($thing)) { + return count($thing); + } + + return 1; } /** @@ -1342,7 +1354,23 @@ */ function twig_length_filter(Twig_Environment $env, $thing) { - return is_scalar($thing) ? strlen($thing) : count($thing); + if (null === $thing) { + return 0; + } + + if (is_scalar($thing)) { + return strlen($thing); + } + + if (is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) { + return strlen((string) $thing); + } + + if ($thing instanceof \Countable || is_array($thing)) { + return count($thing); + } + + return 1; } /** @@ -1404,6 +1432,10 @@ return 0 == count($value); } + if (is_object($value) && method_exists($value, '__toString')) { + return '' === (string) $value; + } + return '' === $value || false === $value || null === $value || array() === $value; } @@ -1576,3 +1608,5 @@ return $result; } + +class_alias('Twig_Extension_Core', 'Twig\Extension\CoreExtension', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/Debug.php --- a/vendor/twig/twig/lib/Twig/Extension/Debug.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Debug.php Fri Feb 23 15:52:07 2018 +0000 @@ -23,7 +23,7 @@ // false means that it was not set (and the default is on) or it explicitly enabled // xdebug.overload_var_dump produces HTML only when html_errors is also enabled && (false === ini_get('html_errors') || ini_get('html_errors')) - || 'cli' === php_sapi_name() + || 'cli' === PHP_SAPI ; return array( @@ -63,3 +63,5 @@ return ob_get_clean(); } + +class_alias('Twig_Extension_Debug', 'Twig\Extension\DebugExtension', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/Escaper.php --- a/vendor/twig/twig/lib/Twig/Extension/Escaper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Escaper.php Fri Feb 23 15:52:07 2018 +0000 @@ -108,3 +108,5 @@ { return $string; } + +class_alias('Twig_Extension_Escaper', 'Twig\Extension\EscaperExtension', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php --- a/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,3 +20,5 @@ interface Twig_Extension_GlobalsInterface { } + +class_alias('Twig_Extension_GlobalsInterface', 'Twig\Extension\GlobalsInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php --- a/vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,3 +20,5 @@ interface Twig_Extension_InitRuntimeInterface { } + +class_alias('Twig_Extension_InitRuntimeInterface', 'Twig\Extension\InitRuntimeInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/Optimizer.php --- a/vendor/twig/twig/lib/Twig/Extension/Optimizer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Optimizer.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,3 +31,5 @@ return 'optimizer'; } } + +class_alias('Twig_Extension_Optimizer', 'Twig\Extension\OptimizerExtension', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/Profiler.php --- a/vendor/twig/twig/lib/Twig/Extension/Profiler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Profiler.php Fri Feb 23 15:52:07 2018 +0000 @@ -44,3 +44,6 @@ return 'profiler'; } } + +class_alias('Twig_Extension_Profiler', 'Twig\Extension\ProfilerExtension', false); +class_exists('Twig_Profiler_Profile'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/Sandbox.php --- a/vendor/twig/twig/lib/Twig/Extension/Sandbox.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Sandbox.php Fri Feb 23 15:52:07 2018 +0000 @@ -99,3 +99,5 @@ return 'sandbox'; } } + +class_alias('Twig_Extension_Sandbox', 'Twig\Extension\SandboxExtension', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/Staging.php --- a/vendor/twig/twig/lib/Twig/Extension/Staging.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/Staging.php Fri Feb 23 15:52:07 2018 +0000 @@ -108,3 +108,5 @@ return 'staging'; } } + +class_alias('Twig_Extension_Staging', 'Twig\Extension\StagingExtension', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Extension/StringLoader.php --- a/vendor/twig/twig/lib/Twig/Extension/StringLoader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Extension/StringLoader.php Fri Feb 23 15:52:07 2018 +0000 @@ -43,3 +43,5 @@ { return $env->createTemplate((string) $template); } + +class_alias('Twig_Extension_StringLoader', 'Twig\Extension\StringLoaderExtension', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/ExtensionInterface.php --- a/vendor/twig/twig/lib/Twig/ExtensionInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/ExtensionInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -85,3 +85,6 @@ */ public function getName(); } + +class_alias('Twig_ExtensionInterface', 'Twig\Extension\ExtensionInterface', false); +class_exists('Twig_Environment'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php --- a/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,3 +35,5 @@ } } } + +class_alias('Twig_FactoryRuntimeLoader', 'Twig\RuntimeLoader\FactoryRuntimeLoader', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php --- a/vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php Fri Feb 23 15:52:07 2018 +0000 @@ -56,3 +56,5 @@ } } } + +class_alias('Twig_FileExtensionEscapingStrategy', 'Twig\FileExtensionEscapingStrategy', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Lexer.php --- a/vendor/twig/twig/lib/Twig/Lexer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Lexer.php Fri Feb 23 15:52:07 2018 +0000 @@ -420,3 +420,5 @@ $this->state = array_pop($this->states); } } + +class_alias('Twig_Lexer', 'Twig\Lexer', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Loader/Array.php --- a/vendor/twig/twig/lib/Twig/Loader/Array.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Loader/Array.php Fri Feb 23 15:52:07 2018 +0000 @@ -80,7 +80,7 @@ throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); } - return $this->templates[$name]; + return $name.':'.$this->templates[$name]; } public function isFresh($name, $time) @@ -93,3 +93,5 @@ return true; } } + +class_alias('Twig_Loader_Array', 'Twig\Loader\ArrayLoader', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Loader/Chain.php --- a/vendor/twig/twig/lib/Twig/Loader/Chain.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Loader/Chain.php Fri Feb 23 15:52:07 2018 +0000 @@ -147,3 +147,5 @@ throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); } } + +class_alias('Twig_Loader_Chain', 'Twig\Loader\ChainLoader', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Loader/Filesystem.php --- a/vendor/twig/twig/lib/Twig/Loader/Filesystem.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Loader/Filesystem.php Fri Feb 23 15:52:07 2018 +0000 @@ -286,3 +286,5 @@ ; } } + +class_alias('Twig_Loader_Filesystem', 'Twig\Loader\FilesystemLoader', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/LoaderInterface.php --- a/vendor/twig/twig/lib/Twig/LoaderInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/LoaderInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -53,3 +53,5 @@ */ public function isFresh($name, $time); } + +class_alias('Twig_LoaderInterface', 'Twig\Loader\LoaderInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Markup.php --- a/vendor/twig/twig/lib/Twig/Markup.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Markup.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,3 +35,5 @@ return function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : strlen($this->content); } } + +class_alias('Twig_Markup', 'Twig\Markup', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node.php --- a/vendor/twig/twig/lib/Twig/Node.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node.php Fri Feb 23 15:52:07 2018 +0000 @@ -251,3 +251,6 @@ return $this->name; } } + +class_alias('Twig_Node', 'Twig\Node\Node', false); +class_exists('Twig_Compiler'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/AutoEscape.php --- a/vendor/twig/twig/lib/Twig/Node/AutoEscape.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/AutoEscape.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,3 +32,5 @@ $compiler->subcompile($this->getNode('body')); } } + +class_alias('Twig_Node_AutoEscape', 'Twig\Node\AutoEscapeNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Block.php --- a/vendor/twig/twig/lib/Twig/Node/Block.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Block.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,3 +37,5 @@ ; } } + +class_alias('Twig_Node_Block', 'Twig\Node\BlockNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/BlockReference.php --- a/vendor/twig/twig/lib/Twig/Node/BlockReference.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/BlockReference.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,3 +30,5 @@ ; } } + +class_alias('Twig_Node_BlockReference', 'Twig\Node\BlockReferenceNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Body.php --- a/vendor/twig/twig/lib/Twig/Node/Body.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Body.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,3 +17,5 @@ class Twig_Node_Body extends Twig_Node { } + +class_alias('Twig_Node_Body', 'Twig\Node\BodyNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/CheckSecurity.php --- a/vendor/twig/twig/lib/Twig/Node/CheckSecurity.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/CheckSecurity.php Fri Feb 23 15:52:07 2018 +0000 @@ -76,3 +76,5 @@ ; } } + +class_alias('Twig_Node_CheckSecurity', 'Twig\Node\CheckSecurityNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Do.php --- a/vendor/twig/twig/lib/Twig/Node/Do.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Do.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,3 +31,5 @@ ; } } + +class_alias('Twig_Node_Do', 'Twig\Node\DoNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Embed.php --- a/vendor/twig/twig/lib/Twig/Node/Embed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Embed.php Fri Feb 23 15:52:07 2018 +0000 @@ -42,3 +42,5 @@ ; } } + +class_alias('Twig_Node_Embed', 'Twig\Node\EmbedNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression.php --- a/vendor/twig/twig/lib/Twig/Node/Expression.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,3 +18,5 @@ abstract class Twig_Node_Expression extends Twig_Node { } + +class_alias('Twig_Node_Expression', 'Twig\Node\Expression\AbstractExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Array.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Array.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Array.php Fri Feb 23 15:52:07 2018 +0000 @@ -79,3 +79,5 @@ $compiler->raw(')'); } } + +class_alias('Twig_Node_Expression_Array', 'Twig\Node\Expression\ArrayExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,3 +21,5 @@ ; } } + +class_alias('Twig_Node_Expression_AssignName', 'Twig\Node\Expression\AssignNameExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,3 +33,5 @@ abstract public function operator(Twig_Compiler $compiler); } + +class_alias('Twig_Node_Expression_Binary', 'Twig\Node\Expression\Binary\AbstractBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('+'); } } + +class_alias('Twig_Node_Expression_Binary_Add', 'Twig\Node\Expression\Binary\AddBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('&&'); } } + +class_alias('Twig_Node_Expression_Binary_And', 'Twig\Node\Expression\Binary\AndBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('&'); } } + +class_alias('Twig_Node_Expression_Binary_BitwiseAnd', 'Twig\Node\Expression\Binary\BitwiseAndBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('|'); } } + +class_alias('Twig_Node_Expression_Binary_BitwiseOr', 'Twig\Node\Expression\Binary\BitwiseOrBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('^'); } } + +class_alias('Twig_Node_Expression_Binary_BitwiseXor', 'Twig\Node\Expression\Binary\BitwiseXorBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('.'); } } + +class_alias('Twig_Node_Expression_Binary_Concat', 'Twig\Node\Expression\Binary\ConcatBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('/'); } } + +class_alias('Twig_Node_Expression_Binary_Div', 'Twig\Node\Expression\Binary\DivBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,3 +28,5 @@ return $compiler->raw(''); } } + +class_alias('Twig_Node_Expression_Binary_EndsWith', 'Twig\Node\Expression\Binary\EndsWithBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,3 +15,5 @@ return $compiler->raw('=='); } } + +class_alias('Twig_Node_Expression_Binary_Equal', 'Twig\Node\Expression\Binary\EqualBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php Fri Feb 23 15:52:07 2018 +0000 @@ -22,3 +22,5 @@ return $compiler->raw('/'); } } + +class_alias('Twig_Node_Expression_Binary_FloorDiv', 'Twig\Node\Expression\Binary\FloorDivBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,3 +15,5 @@ return $compiler->raw('>'); } } + +class_alias('Twig_Node_Expression_Binary_Greater', 'Twig\Node\Expression\Binary\GreaterBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,3 +15,5 @@ return $compiler->raw('>='); } } + +class_alias('Twig_Node_Expression_Binary_GreaterEqual', 'Twig\Node\Expression\Binary\GreaterEqualBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,3 +26,5 @@ return $compiler->raw('in'); } } + +class_alias('Twig_Node_Expression_Binary_In', 'Twig\Node\Expression\Binary\InBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,3 +15,5 @@ return $compiler->raw('<'); } } + +class_alias('Twig_Node_Expression_Binary_Less', 'Twig\Node\Expression\Binary\LessBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,3 +15,5 @@ return $compiler->raw('<='); } } + +class_alias('Twig_Node_Expression_Binary_LessEqual', 'Twig\Node\Expression\Binary\LessEqualBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,3 +26,5 @@ return $compiler->raw(''); } } + +class_alias('Twig_Node_Expression_Binary_Matches', 'Twig\Node\Expression\Binary\MatchesBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('%'); } } + +class_alias('Twig_Node_Expression_Binary_Mod', 'Twig\Node\Expression\Binary\ModBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('*'); } } + +class_alias('Twig_Node_Expression_Binary_Mul', 'Twig\Node\Expression\Binary\MulBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php Fri Feb 23 15:52:07 2018 +0000 @@ -15,3 +15,5 @@ return $compiler->raw('!='); } } + +class_alias('Twig_Node_Expression_Binary_NotEqual', 'Twig\Node\Expression\Binary\NotEqualBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,3 +26,5 @@ return $compiler->raw('not in'); } } + +class_alias('Twig_Node_Expression_Binary_NotIn', 'Twig\Node\Expression\Binary\NotInBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('||'); } } + +class_alias('Twig_Node_Expression_Binary_Or', 'Twig\Node\Expression\Binary\OrBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,3 +30,5 @@ return $compiler->raw('**'); } } + +class_alias('Twig_Node_Expression_Binary_Power', 'Twig\Node\Expression\Binary\PowerBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php Fri Feb 23 15:52:07 2018 +0000 @@ -26,3 +26,5 @@ return $compiler->raw('..'); } } + +class_alias('Twig_Node_Expression_Binary_Range', 'Twig\Node\Expression\Binary\RangeBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,3 +28,5 @@ return $compiler->raw(''); } } + +class_alias('Twig_Node_Expression_Binary_StartsWith', 'Twig\Node\Expression\Binary\StartsWithBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ return $compiler->raw('-'); } } + +class_alias('Twig_Node_Expression_Binary_Sub', 'Twig\Node\Expression\Binary\SubBinary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php Fri Feb 23 15:52:07 2018 +0000 @@ -89,3 +89,5 @@ return $compiler->raw(')'); } } + +class_alias('Twig_Node_Expression_BlockReference', 'Twig\Node\Expression\BlockReferenceExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Call.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Call.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Call.php Fri Feb 23 15:52:07 2018 +0000 @@ -287,3 +287,5 @@ return $this->reflector = array($r, $callable); } } + +class_alias('Twig_Node_Expression_Call', 'Twig\Node\Expression\CallExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ ; } } + +class_alias('Twig_Node_Expression_Conditional', 'Twig\Node\Expression\ConditionalExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Constant.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php Fri Feb 23 15:52:07 2018 +0000 @@ -21,3 +21,5 @@ $compiler->repr($this->getAttribute('value')); } } + +class_alias('Twig_Node_Expression_Constant', 'Twig\Node\Expression\ConstantExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Filter.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,3 +37,5 @@ $this->compileCallable($compiler); } } + +class_alias('Twig_Node_Expression_Filter', 'Twig\Node\Expression\FilterExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,3 +41,5 @@ $compiler->subcompile($this->getNode('node')); } } + +class_alias('Twig_Node_Expression_Filter_Default', 'Twig\Node\Expression\Filter\DefaultFilter', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Function.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Function.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Function.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,3 +41,5 @@ $this->compileCallable($compiler); } } + +class_alias('Twig_Node_Expression_Function', 'Twig\Node\Expression\FunctionExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php Fri Feb 23 15:52:07 2018 +0000 @@ -70,3 +70,5 @@ $compiler->raw(')'); } } + +class_alias('Twig_Node_Expression_GetAttr', 'Twig\Node\Expression\GetAttrExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,3 +39,5 @@ $compiler->raw(')'); } } + +class_alias('Twig_Node_Expression_MethodCall', 'Twig\Node\Expression\MethodCallExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Name.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Name.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Name.php Fri Feb 23 15:52:07 2018 +0000 @@ -98,3 +98,5 @@ return !$this->isSpecial() && !$this->getAttribute('is_defined_test'); } } + +class_alias('Twig_Node_Expression_Name', 'Twig\Node\Expression\NameExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php Fri Feb 23 15:52:07 2018 +0000 @@ -44,3 +44,5 @@ } } } + +class_alias('Twig_Node_Expression_NullCoalesce', 'Twig\Node\Expression\NullCoalesceExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Parent.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php Fri Feb 23 15:52:07 2018 +0000 @@ -40,3 +40,5 @@ } } } + +class_alias('Twig_Node_Expression_Parent', 'Twig\Node\Expression\ParentExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/TempName.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,3 +24,5 @@ ; } } + +class_alias('Twig_Node_Expression_TempName', 'Twig\Node\Expression\TempNameExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Test.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,3 +38,5 @@ $this->compileCallable($compiler); } } + +class_alias('Twig_Node_Expression_Test', 'Twig\Node\Expression\TestExpression', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php Fri Feb 23 15:52:07 2018 +0000 @@ -44,3 +44,5 @@ ; } } + +class_alias('Twig_Node_Expression_Test_Constant', 'Twig\Node\Expression\Test\ConstantTest', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php Fri Feb 23 15:52:07 2018 +0000 @@ -57,3 +57,5 @@ $compiler->subcompile($this->getNode('node')); } } + +class_alias('Twig_Node_Expression_Test_Defined', 'Twig\Node\Expression\Test\DefinedTest', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,3 +31,5 @@ ; } } + +class_alias('Twig_Node_Expression_Test_Divisibleby', 'Twig\Node\Expression\Test\DivisiblebyTest', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,3 +30,5 @@ ; } } + +class_alias('Twig_Node_Expression_Test_Even', 'Twig\Node\Expression\Test\EvenTest', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ ; } } + +class_alias('Twig_Node_Expression_Test_Null', 'Twig\Node\Expression\Test\NullTest', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,3 +30,5 @@ ; } } + +class_alias('Twig_Node_Expression_Test_Odd', 'Twig\Node\Expression\Test\OddTest', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php Fri Feb 23 15:52:07 2018 +0000 @@ -27,3 +27,5 @@ ; } } + +class_alias('Twig_Node_Expression_Test_Sameas', 'Twig\Node\Expression\Test\SameasTest', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Unary.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php Fri Feb 23 15:52:07 2018 +0000 @@ -25,3 +25,5 @@ abstract public function operator(Twig_Compiler $compiler); } + +class_alias('Twig_Node_Expression_Unary', 'Twig\Node\Expression\Unary\AbstractUnary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ $compiler->raw('-'); } } + +class_alias('Twig_Node_Expression_Unary_Neg', 'Twig\Node\Expression\Unary\NegUnary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ $compiler->raw('!'); } } + +class_alias('Twig_Node_Expression_Unary_Not', 'Twig\Node\Expression\Unary\NotUnary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php Fri Feb 23 15:52:07 2018 +0000 @@ -16,3 +16,5 @@ $compiler->raw('+'); } } + +class_alias('Twig_Node_Expression_Unary_Pos', 'Twig\Node\Expression\Unary\PosUnary', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Flush.php --- a/vendor/twig/twig/lib/Twig/Node/Flush.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Flush.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ ; } } + +class_alias('Twig_Node_Flush', 'Twig\Node\FlushNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/For.php --- a/vendor/twig/twig/lib/Twig/Node/For.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/For.php Fri Feb 23 15:52:07 2018 +0000 @@ -109,3 +109,5 @@ $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n"); } } + +class_alias('Twig_Node_For', 'Twig\Node\ForNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/ForLoop.php --- a/vendor/twig/twig/lib/Twig/Node/ForLoop.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/ForLoop.php Fri Feb 23 15:52:07 2018 +0000 @@ -48,3 +48,5 @@ } } } + +class_alias('Twig_Node_ForLoop', 'Twig\Node\ForLoopNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/If.php --- a/vendor/twig/twig/lib/Twig/Node/If.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/If.php Fri Feb 23 15:52:07 2018 +0000 @@ -64,3 +64,5 @@ ->write("}\n"); } } + +class_alias('Twig_Node_If', 'Twig\Node\IfNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Import.php --- a/vendor/twig/twig/lib/Twig/Node/Import.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Import.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,3 +47,5 @@ $compiler->raw(";\n"); } } + +class_alias('Twig_Node_Import', 'Twig\Node\ImportNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Include.php --- a/vendor/twig/twig/lib/Twig/Node/Include.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Include.php Fri Feb 23 15:52:07 2018 +0000 @@ -86,3 +86,5 @@ } } } + +class_alias('Twig_Node_Include', 'Twig\Node\IncludeNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Macro.php --- a/vendor/twig/twig/lib/Twig/Node/Macro.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Macro.php Fri Feb 23 15:52:07 2018 +0000 @@ -121,3 +121,5 @@ ; } } + +class_alias('Twig_Node_Macro', 'Twig\Node\MacroNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Module.php --- a/vendor/twig/twig/lib/Twig/Node/Module.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Module.php Fri Feb 23 15:52:07 2018 +0000 @@ -457,3 +457,5 @@ } } } + +class_alias('Twig_Node_Module', 'Twig\Node\ModuleNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Print.php --- a/vendor/twig/twig/lib/Twig/Node/Print.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Print.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,3 +32,5 @@ ; } } + +class_alias('Twig_Node_Print', 'Twig\Node\PrintNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Sandbox.php --- a/vendor/twig/twig/lib/Twig/Node/Sandbox.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Sandbox.php Fri Feb 23 15:52:07 2018 +0000 @@ -40,3 +40,5 @@ ; } } + +class_alias('Twig_Node_Sandbox', 'Twig\Node\SandboxNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php --- a/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,3 +47,5 @@ return $node; } } + +class_alias('Twig_Node_SandboxedPrint', 'Twig\Node\SandboxedPrintNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Set.php --- a/vendor/twig/twig/lib/Twig/Node/Set.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Set.php Fri Feb 23 15:52:07 2018 +0000 @@ -94,3 +94,5 @@ $compiler->raw(";\n"); } } + +class_alias('Twig_Node_Set', 'Twig\Node\SetNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/SetTemp.php --- a/vendor/twig/twig/lib/Twig/Node/SetTemp.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/SetTemp.php Fri Feb 23 15:52:07 2018 +0000 @@ -9,6 +9,9 @@ * file that was distributed with this source code. */ +/** + * @internal + */ class Twig_Node_SetTemp extends Twig_Node { public function __construct($name, $lineno) @@ -33,3 +36,5 @@ ; } } + +class_alias('Twig_Node_SetTemp', 'Twig\Node\SetTempNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Spaceless.php --- a/vendor/twig/twig/lib/Twig/Node/Spaceless.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Spaceless.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,3 +33,5 @@ ; } } + +class_alias('Twig_Node_Spaceless', 'Twig\Node\SpacelessNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/Text.php --- a/vendor/twig/twig/lib/Twig/Node/Text.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/Text.php Fri Feb 23 15:52:07 2018 +0000 @@ -32,3 +32,5 @@ ; } } + +class_alias('Twig_Node_Text', 'Twig\Node\TextNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Node/With.php --- a/vendor/twig/twig/lib/Twig/Node/With.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Node/With.php Fri Feb 23 15:52:07 2018 +0000 @@ -60,3 +60,5 @@ ; } } + +class_alias('Twig_Node_With', 'Twig\Node\WithNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/NodeCaptureInterface.php --- a/vendor/twig/twig/lib/Twig/NodeCaptureInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeCaptureInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,3 +17,5 @@ interface Twig_NodeCaptureInterface { } + +class_alias('Twig_NodeCaptureInterface', 'Twig\Node\NodeCaptureInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/NodeOutputInterface.php --- a/vendor/twig/twig/lib/Twig/NodeOutputInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeOutputInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,3 +17,5 @@ interface Twig_NodeOutputInterface { } + +class_alias('Twig_NodeOutputInterface', 'Twig\Node\NodeOutputInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/NodeTraverser.php --- a/vendor/twig/twig/lib/Twig/NodeTraverser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeTraverser.php Fri Feb 23 15:52:07 2018 +0000 @@ -80,3 +80,5 @@ return $visitor->leaveNode($node, $this->env); } } + +class_alias('Twig_NodeTraverser', 'Twig\NodeTraverser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php --- a/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php Fri Feb 23 15:52:07 2018 +0000 @@ -150,3 +150,5 @@ return 0; } } + +class_alias('Twig_NodeVisitor_Escaper', 'Twig\NodeVisitor\EscaperNodeVisitor', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php --- a/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php Fri Feb 23 15:52:07 2018 +0000 @@ -249,3 +249,5 @@ return 255; } } + +class_alias('Twig_NodeVisitor_Optimizer', 'Twig\NodeVisitor\OptimizerNodeVisitor', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php --- a/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php Fri Feb 23 15:52:07 2018 +0000 @@ -146,3 +146,5 @@ return 0; } } + +class_alias('Twig_NodeVisitor_SafeAnalysis', 'Twig\NodeVisitor\SafeAnalysisNodeVisitor', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php --- a/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php Fri Feb 23 15:52:07 2018 +0000 @@ -73,3 +73,5 @@ return 0; } } + +class_alias('Twig_NodeVisitor_Sandbox', 'Twig\NodeVisitor\SandboxNodeVisitor', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/NodeVisitorInterface.php --- a/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,3 +39,7 @@ */ public function getPriority(); } + +class_alias('Twig_NodeVisitorInterface', 'Twig\NodeVisitor\NodeVisitorInterface', false); +class_exists('Twig_Environment'); +class_exists('Twig_Node'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Parser.php --- a/vendor/twig/twig/lib/Twig/Parser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Parser.php Fri Feb 23 15:52:07 2018 +0000 @@ -404,3 +404,7 @@ return $node; } } + +class_alias('Twig_Parser', 'Twig\Parser', false); +class_exists('Twig_Node'); +class_exists('Twig_TokenStream'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,62 @@ + + */ +abstract class Twig_Profiler_Dumper_Base +{ + private $root; + + public function dump(Twig_Profiler_Profile $profile) + { + return $this->dumpProfile($profile); + } + + abstract protected function formatTemplate(Twig_Profiler_Profile $profile, $prefix); + + abstract protected function formatNonTemplate(Twig_Profiler_Profile $profile, $prefix); + + abstract protected function formatTime(Twig_Profiler_Profile $profile, $percent); + + private function dumpProfile(Twig_Profiler_Profile $profile, $prefix = '', $sibling = false) + { + if ($profile->isRoot()) { + $this->root = $profile->getDuration(); + $start = $profile->getName(); + } else { + if ($profile->isTemplate()) { + $start = $this->formatTemplate($profile, $prefix); + } else { + $start = $this->formatNonTemplate($profile, $prefix); + } + $prefix .= $sibling ? '│ ' : ' '; + } + + $percent = $this->root ? $profile->getDuration() / $this->root * 100 : 0; + + if ($profile->getDuration() * 1000 < 1) { + $str = $start."\n"; + } else { + $str = sprintf("%s %s\n", $start, $this->formatTime($profile, $percent)); + } + + $nCount = count($profile->getProfiles()); + foreach ($profile as $i => $p) { + $str .= $this->dumpProfile($p, $prefix, $i + 1 !== $nCount); + } + + return $str; + } +} + +class_alias('Twig_Profiler_Dumper_Base', 'Twig\Profiler\Dumper\BaseDumper', false); +class_exists('Twig_Profiler_Profile'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php --- a/vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php Fri Feb 23 15:52:07 2018 +0000 @@ -22,7 +22,7 @@ $this->dumpProfile('main()', $profile, $data); $this->dumpChildren('main()', $profile, $data); - $start = microtime(true); + $start = sprintf('%f', microtime(true)); $str = << '#dfd', @@ -43,3 +43,5 @@ return sprintf('%.2fms/%.0f%%', $percent > 20 ? self::$colors['big'] : 'auto', $profile->getDuration() * 1000, $percent); } } + +class_alias('Twig_Profiler_Dumper_Html', 'Twig\Profiler\Dumper\HtmlDumper', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php --- a/vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php Fri Feb 23 15:52:07 2018 +0000 @@ -14,15 +14,8 @@ * * @final */ -class Twig_Profiler_Dumper_Text +class Twig_Profiler_Dumper_Text extends Twig_Profiler_Dumper_Base { - private $root; - - public function dump(Twig_Profiler_Profile $profile) - { - return $this->dumpProfile($profile); - } - protected function formatTemplate(Twig_Profiler_Profile $profile, $prefix) { return sprintf('%sâ”” %s', $prefix, $profile->getTemplate()); @@ -37,34 +30,6 @@ { return sprintf('%.2fms/%.0f%%', $profile->getDuration() * 1000, $percent); } +} - private function dumpProfile(Twig_Profiler_Profile $profile, $prefix = '', $sibling = false) - { - if ($profile->isRoot()) { - $this->root = $profile->getDuration(); - $start = $profile->getName(); - } else { - if ($profile->isTemplate()) { - $start = $this->formatTemplate($profile, $prefix); - } else { - $start = $this->formatNonTemplate($profile, $prefix); - } - $prefix .= $sibling ? '│ ' : ' '; - } - - $percent = $this->root ? $profile->getDuration() / $this->root * 100 : 0; - - if ($profile->getDuration() * 1000 < 1) { - $str = $start."\n"; - } else { - $str = sprintf("%s %s\n", $start, $this->formatTime($profile, $percent)); - } - - $nCount = count($profile->getProfiles()); - foreach ($profile as $i => $p) { - $str .= $this->dumpProfile($p, $prefix, $i + 1 !== $nCount); - } - - return $str; - } -} +class_alias('Twig_Profiler_Dumper_Text', 'Twig\Profiler\Dumper\TextDumper', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php --- a/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,3 +35,5 @@ ; } } + +class_alias('Twig_Profiler_Node_EnterProfile', 'Twig\Profiler\Node\EnterProfileNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php --- a/vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ ; } } + +class_alias('Twig_Profiler_Node_LeaveProfile', 'Twig\Profiler\Node\LeaveProfileNode', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php --- a/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php Fri Feb 23 15:52:07 2018 +0000 @@ -63,3 +63,5 @@ return 0; } } + +class_alias('Twig_Profiler_NodeVisitor_Profiler', 'Twig\Profiler\NodeVisitor\ProfilerNodeVisitor', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Profiler/Profile.php --- a/vendor/twig/twig/lib/Twig/Profiler/Profile.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Profiler/Profile.php Fri Feb 23 15:52:07 2018 +0000 @@ -145,6 +145,12 @@ ); } + public function reset() + { + $this->starts = $this->ends = $this->profiles = array(); + $this->enter(); + } + public function getIterator() { return new ArrayIterator($this->profiles); @@ -160,3 +166,5 @@ list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = unserialize($data); } } + +class_alias('Twig_Profiler_Profile', 'Twig\Profiler\Profile', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php --- a/vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -25,3 +25,5 @@ */ public function load($class); } + +class_alias('Twig_RuntimeLoaderInterface', 'Twig\RuntimeLoader\RuntimeLoaderInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php Fri Feb 23 15:52:07 2018 +0000 @@ -17,3 +17,5 @@ class Twig_Sandbox_SecurityError extends Twig_Error { } + +class_alias('Twig_Sandbox_SecurityError', 'Twig\Sandbox\SecurityError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ return $this->filterName; } } + +class_alias('Twig_Sandbox_SecurityNotAllowedFilterError', 'Twig\Sandbox\SecurityNotAllowedFilterError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ return $this->functionName; } } + +class_alias('Twig_Sandbox_SecurityNotAllowedFunctionError', 'Twig\Sandbox\SecurityNotAllowedFunctionError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,3 +36,5 @@ return $this->methodName; } } + +class_alias('Twig_Sandbox_SecurityNotAllowedMethodError', 'Twig\Sandbox\SecurityNotAllowedMethodError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,3 +36,5 @@ return $this->propertyName; } } + +class_alias('Twig_Sandbox_SecurityNotAllowedPropertyError', 'Twig\Sandbox\SecurityNotAllowedPropertyError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ return $this->tagName; } } + +class_alias('Twig_Sandbox_SecurityNotAllowedTagError', 'Twig\Sandbox\SecurityNotAllowedTagError', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php Fri Feb 23 15:52:07 2018 +0000 @@ -121,3 +121,5 @@ } } } + +class_alias('Twig_Sandbox_SecurityPolicy', 'Twig\Sandbox\SecurityPolicy', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php --- a/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -22,3 +22,5 @@ public function checkPropertyAllowed($obj, $method); } + +class_alias('Twig_Sandbox_SecurityPolicyInterface', 'Twig\Sandbox\SecurityPolicyInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/SimpleFilter.php --- a/vendor/twig/twig/lib/Twig/SimpleFilter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/SimpleFilter.php Fri Feb 23 15:52:07 2018 +0000 @@ -117,3 +117,5 @@ return $this->options['alternative']; } } + +class_alias('Twig_SimpleFilter', 'Twig\TwigFilter', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/SimpleFunction.php --- a/vendor/twig/twig/lib/Twig/SimpleFunction.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/SimpleFunction.php Fri Feb 23 15:52:07 2018 +0000 @@ -107,3 +107,5 @@ return $this->options['alternative']; } } + +class_alias('Twig_SimpleFunction', 'Twig\TwigFunction', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/SimpleTest.php --- a/vendor/twig/twig/lib/Twig/SimpleTest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/SimpleTest.php Fri Feb 23 15:52:07 2018 +0000 @@ -69,3 +69,5 @@ return $this->options['alternative']; } } + +class_alias('Twig_SimpleTest', 'Twig\TwigTest', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Source.php --- a/vendor/twig/twig/lib/Twig/Source.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Source.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,3 +49,5 @@ return $this->path; } } + +class_alias('Twig_Source', 'Twig\Source', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php --- a/vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ */ public function getSourceContext($name); } + +class_alias('Twig_SourceContextLoaderInterface', 'Twig\Loader\SourceContextLoaderInterface', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Template.php --- a/vendor/twig/twig/lib/Twig/Template.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Template.php Fri Feb 23 15:52:07 2018 +0000 @@ -627,11 +627,14 @@ continue; } - if (!isset($cache[$name])) { - $cache[$name] = $method; - } - if (!isset($cache[$lcName])) { - $cache[$lcName] = $method; + // skip get() and is() methods (in which case, $name is empty) + if ($name) { + if (!isset($cache[$name])) { + $cache[$name] = $method; + } + if (!isset($cache[$lcName])) { + $cache[$lcName] = $method; + } } } self::$cache[$class] = $cache; @@ -699,3 +702,5 @@ return $ret; } } + +class_alias('Twig_Template', 'Twig\Template', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TemplateWrapper.php --- a/vendor/twig/twig/lib/Twig/TemplateWrapper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TemplateWrapper.php Fri Feb 23 15:52:07 2018 +0000 @@ -129,3 +129,5 @@ return $this->template->getSourceContext(); } } + +class_alias('Twig_TemplateWrapper', 'Twig\TemplateWrapper', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php --- a/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php Fri Feb 23 15:52:07 2018 +0000 @@ -9,13 +9,15 @@ * file that was distributed with this source code. */ +use PHPUnit\Framework\TestCase; + /** * Integration test helper. * * @author Fabien Potencier * @author Karma Dordrak */ -abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase +abstract class Twig_Test_IntegrationTestCase extends TestCase { /** * @return string @@ -23,6 +25,14 @@ abstract protected function getFixturesDir(); /** + * @return Twig_RuntimeLoaderInterface[] + */ + protected function getRuntimeLoaders() + { + return array(); + } + + /** * @return Twig_ExtensionInterface[] */ protected function getExtensions() @@ -121,6 +131,10 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs) { + if (!$outputs) { + $this->markTestSkipped('no legacy tests to run'); + } + if ($condition) { eval('$ret = '.$condition.';'); if (!$ret) { @@ -137,6 +151,10 @@ ), $match[2] ? eval($match[2].';') : array()); $twig = new Twig_Environment($loader, $config); $twig->addGlobal('global', 'global'); + foreach ($this->getRuntimeLoaders() as $runtimeLoader) { + $twig->addRuntimeLoader($runtimeLoader); + } + foreach ($this->getExtensions() as $extension) { $twig->addExtension($extension); } @@ -192,7 +210,8 @@ if (false !== $exception) { list($class) = explode(':', $exception); - $this->assertThat(null, new PHPUnit_Framework_Constraint_Exception($class)); + $constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception'; + $this->assertThat(null, new $constraintClass($class)); } $expected = trim($match[3], "\n "); @@ -226,3 +245,5 @@ return $templates; } } + +class_alias('Twig_Test_IntegrationTestCase', 'Twig\Test\IntegrationTestCase', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Test/NodeTestCase.php --- a/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php Fri Feb 23 15:52:07 2018 +0000 @@ -8,7 +8,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -abstract class Twig_Test_NodeTestCase extends PHPUnit_Framework_TestCase + +use PHPUnit\Framework\TestCase; + +abstract class Twig_Test_NodeTestCase extends TestCase { abstract public function getTests(); @@ -66,3 +69,7 @@ return '$this->getAttribute('; } } + +class_alias('Twig_Test_NodeTestCase', 'Twig\Test\NodeTestCase', false); +class_exists('Twig_Environment'); +class_exists('Twig_Node'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Token.php --- a/vendor/twig/twig/lib/Twig/Token.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Token.php Fri Feb 23 15:52:07 2018 +0000 @@ -203,3 +203,5 @@ } } } + +class_alias('Twig_Token', 'Twig\Token', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser.php --- a/vendor/twig/twig/lib/Twig/TokenParser.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,3 +29,5 @@ $this->parser = $parser; } } + +class_alias('Twig_TokenParser', 'Twig\TokenParser\AbstractTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php --- a/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php Fri Feb 23 15:52:07 2018 +0000 @@ -79,3 +79,5 @@ return 'autoescape'; } } + +class_alias('Twig_TokenParser_AutoEscape', 'Twig\TokenParser\AutoEscapeTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Block.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Block.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Block.php Fri Feb 23 15:52:07 2018 +0000 @@ -69,3 +69,5 @@ return 'block'; } } + +class_alias('Twig_TokenParser_Block', 'Twig\TokenParser\BlockTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Do.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Do.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Do.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,3 +30,5 @@ return 'do'; } } + +class_alias('Twig_TokenParser_Do', 'Twig\TokenParser\DoTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Embed.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Embed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Embed.php Fri Feb 23 15:52:07 2018 +0000 @@ -63,3 +63,5 @@ return 'embed'; } } + +class_alias('Twig_TokenParser_Embed', 'Twig\TokenParser\EmbedTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Extends.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Extends.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Extends.php Fri Feb 23 15:52:07 2018 +0000 @@ -42,3 +42,5 @@ return 'extends'; } } + +class_alias('Twig_TokenParser_Extends', 'Twig\TokenParser\ExtendsTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Filter.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Filter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Filter.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,3 +49,5 @@ return 'filter'; } } + +class_alias('Twig_TokenParser_Filter', 'Twig\TokenParser\FilterTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Flush.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Flush.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Flush.php Fri Feb 23 15:52:07 2018 +0000 @@ -30,3 +30,5 @@ return 'flush'; } } + +class_alias('Twig_TokenParser_Flush', 'Twig\TokenParser\FlushTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/For.php --- a/vendor/twig/twig/lib/Twig/TokenParser/For.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/For.php Fri Feb 23 15:52:07 2018 +0000 @@ -123,3 +123,5 @@ return 'for'; } } + +class_alias('Twig_TokenParser_For', 'Twig\TokenParser\ForTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/From.php --- a/vendor/twig/twig/lib/Twig/TokenParser/From.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/From.php Fri Feb 23 15:52:07 2018 +0000 @@ -62,3 +62,5 @@ return 'from'; } } + +class_alias('Twig_TokenParser_From', 'Twig\TokenParser\FromTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/If.php --- a/vendor/twig/twig/lib/Twig/TokenParser/If.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/If.php Fri Feb 23 15:52:07 2018 +0000 @@ -82,3 +82,5 @@ return 'if'; } } + +class_alias('Twig_TokenParser_If', 'Twig\TokenParser\IfTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Import.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Import.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Import.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,3 +37,5 @@ return 'import'; } } + +class_alias('Twig_TokenParser_Import', 'Twig\TokenParser\ImportTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Include.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Include.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Include.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,8 +18,6 @@ * Body * {% include 'footer.html' %} *
  • - * - * @final */ class Twig_TokenParser_Include extends Twig_TokenParser { @@ -63,3 +61,5 @@ return 'include'; } } + +class_alias('Twig_TokenParser_Include', 'Twig\TokenParser\IncludeTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Macro.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Macro.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Macro.php Fri Feb 23 15:52:07 2018 +0000 @@ -56,3 +56,5 @@ return 'macro'; } } + +class_alias('Twig_TokenParser_Macro', 'Twig\TokenParser\MacroTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php Fri Feb 23 15:52:07 2018 +0000 @@ -57,3 +57,5 @@ return 'sandbox'; } } + +class_alias('Twig_TokenParser_Sandbox', 'Twig\TokenParser\SandboxTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Set.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Set.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Set.php Fri Feb 23 15:52:07 2018 +0000 @@ -71,3 +71,5 @@ return 'set'; } } + +class_alias('Twig_TokenParser_Set', 'Twig\TokenParser\SetTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,3 +47,5 @@ return 'spaceless'; } } + +class_alias('Twig_TokenParser_Spaceless', 'Twig\TokenParser\SpacelessTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/Use.php --- a/vendor/twig/twig/lib/Twig/TokenParser/Use.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/Use.php Fri Feb 23 15:52:07 2018 +0000 @@ -57,6 +57,8 @@ $stream->expect(Twig_Token::BLOCK_END_TYPE); $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets)))); + + return new Twig_Node(); } public function getTag() @@ -64,3 +66,5 @@ return 'use'; } } + +class_alias('Twig_TokenParser_Use', 'Twig\TokenParser\UseTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParser/With.php --- a/vendor/twig/twig/lib/Twig/TokenParser/With.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParser/With.php Fri Feb 23 15:52:07 2018 +0000 @@ -48,3 +48,5 @@ return 'with'; } } + +class_alias('Twig_TokenParser_With', 'Twig\TokenParser\WithTokenParser', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenParserInterface.php --- a/vendor/twig/twig/lib/Twig/TokenParserInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenParserInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,3 +37,7 @@ */ public function getTag(); } + +class_alias('Twig_TokenParserInterface', 'Twig\TokenParser\TokenParserInterface', false); +class_exists('Twig_Parser'); +class_exists('Twig_Token'); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/TokenStream.php --- a/vendor/twig/twig/lib/Twig/TokenStream.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/TokenStream.php Fri Feb 23 15:52:07 2018 +0000 @@ -192,3 +192,5 @@ return $this->source; } } + +class_alias('Twig_TokenStream', 'Twig\TokenStream', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php --- a/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php Fri Feb 23 15:52:07 2018 +0000 @@ -82,3 +82,5 @@ } } } + +class_alias('Twig_Util_DeprecationCollector', 'Twig\Util\DeprecationCollector', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php --- a/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php Fri Feb 23 15:52:07 2018 +0000 @@ -24,3 +24,5 @@ return (string) parent::key(); } } + +class_alias('Twig_Util_TemplateDirIterator', 'Twig\Util\TemplateDirIterator', false); diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/src/Cache/CacheInterface.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/twig/twig/src/Cache/CacheInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,11 @@ + + */ +interface RuntimeExtensionInterface +{ +} diff -r bfffd8d7479a -r 7a779792577d vendor/twig/twig/src/Extension/SandboxExtension.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/twig/twig/src/Extension/SandboxExtension.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,11 @@ + appveyor.yml - -init: - - SET PATH=c:\php;%PATH% - - SET COMPOSER_NO_INTERACTION=1 - - SET PHP=1 - -install: - - IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php) - - cd c:\php - - IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-7.0.0-nts-Win32-VC14-x86.zip - - IF %PHP%==1 7z x php-7.0.0-nts-Win32-VC14-x86.zip -y >nul - - IF %PHP%==1 del /Q *.zip - - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat - - IF %PHP%==1 copy /Y php.ini-development php.ini - - IF %PHP%==1 echo max_execution_time=1200 >> php.ini - - IF %PHP%==1 echo date.timezone="UTC" >> php.ini - - IF %PHP%==1 echo extension_dir=ext >> php.ini - - IF %PHP%==1 echo extension=php_curl.dll >> php.ini - - IF %PHP%==1 echo extension=php_openssl.dll >> php.ini - - IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini - - IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini - - appveyor DownloadFile https://getcomposer.org/composer.phar - - cd c:\projects\webmozart\assert - - mkdir %APPDATA%\Composer - - IF %APPVEYOR_REPO_NAME%==webmozart/assert copy /Y .composer-auth.json %APPDATA%\Composer\auth.json - - composer update --prefer-dist --no-progress --ansi - -test_script: - - cd c:\projects\webmozart\assert - - vendor\bin\phpunit.bat --verbose diff -r bfffd8d7479a -r 7a779792577d vendor/webmozart/assert/phpunit.xml.dist --- a/vendor/webmozart/assert/phpunit.xml.dist Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - ./tests/ - - - - - - - ./src/ - - - diff -r bfffd8d7479a -r 7a779792577d vendor/webmozart/assert/src/Assert.php --- a/vendor/webmozart/assert/src/Assert.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/webmozart/assert/src/Assert.php Fri Feb 23 15:52:07 2018 +0000 @@ -11,12 +11,14 @@ namespace Webmozart\Assert; +use ArrayAccess; use BadMethodCallException; +use Closure; +use Countable; +use Exception; use InvalidArgumentException; +use Throwable; use Traversable; -use Exception; -use Throwable; -use Closure; /** * Efficient assertions to validate the input/output of your methods. @@ -34,8 +36,11 @@ * @method static void nullOrIsCallable($value, $message = '') * @method static void nullOrIsArray($value, $message = '') * @method static void nullOrIsTraversable($value, $message = '') + * @method static void nullOrIsArrayAccessible($value, $message = '') + * @method static void nullOrIsCountable($value, $message = '') * @method static void nullOrIsInstanceOf($value, $class, $message = '') * @method static void nullOrNotInstanceOf($value, $class, $message = '') + * @method static void nullOrIsInstanceOfAny($value, $classes, $message = '') * @method static void nullOrIsEmpty($value, $message = '') * @method static void nullOrNotEmpty($value, $message = '') * @method static void nullOrTrue($value, $message = '') @@ -51,6 +56,8 @@ * @method static void nullOrRange($value, $min, $max, $message = '') * @method static void nullOrOneOf($value, $values, $message = '') * @method static void nullOrContains($value, $subString, $message = '') + * @method static void nullOrNotContains($value, $subString, $message = '') + * @method static void nullOrNotWhitespaceOnly($value, $message = '') * @method static void nullOrStartsWith($value, $prefix, $message = '') * @method static void nullOrStartsWithLetter($value, $message = '') * @method static void nullOrEndsWith($value, $suffix, $message = '') @@ -79,6 +86,9 @@ * @method static void nullOrKeyExists($value, $key, $message = '') * @method static void nullOrKeyNotExists($value, $key, $message = '') * @method static void nullOrCount($value, $key, $message = '') + * @method static void nullOrMinCount($value, $min, $message = '') + * @method static void nullOrMaxCount($value, $max, $message = '') + * @method static void nullCountBetween($value, $min, $max, $message = '') * @method static void nullOrUuid($values, $message = '') * @method static void allString($values, $message = '') * @method static void allStringNotEmpty($values, $message = '') @@ -93,8 +103,11 @@ * @method static void allIsCallable($values, $message = '') * @method static void allIsArray($values, $message = '') * @method static void allIsTraversable($values, $message = '') + * @method static void allIsArrayAccessible($values, $message = '') + * @method static void allIsCountable($values, $message = '') * @method static void allIsInstanceOf($values, $class, $message = '') * @method static void allNotInstanceOf($values, $class, $message = '') + * @method static void allIsInstanceOfAny($values, $classes, $message = '') * @method static void allNull($values, $message = '') * @method static void allNotNull($values, $message = '') * @method static void allIsEmpty($values, $message = '') @@ -112,6 +125,8 @@ * @method static void allRange($values, $min, $max, $message = '') * @method static void allOneOf($values, $values, $message = '') * @method static void allContains($values, $subString, $message = '') + * @method static void allNotContains($values, $subString, $message = '') + * @method static void allNotWhitespaceOnly($values, $message = '') * @method static void allStartsWith($values, $prefix, $message = '') * @method static void allStartsWithLetter($values, $message = '') * @method static void allEndsWith($values, $suffix, $message = '') @@ -140,6 +155,9 @@ * @method static void allKeyExists($values, $key, $message = '') * @method static void allKeyNotExists($values, $key, $message = '') * @method static void allCount($values, $key, $message = '') + * @method static void allMinCount($values, $min, $message = '') + * @method static void allMaxCount($values, $max, $message = '') + * @method static void allCountBetween($values, $min, $max, $message = '') * @method static void allUuid($values, $message = '') * * @since 1.0 @@ -161,7 +179,7 @@ public static function stringNotEmpty($value, $message = '') { static::string($value, $message); - static::notEmpty($value, $message); + static::notEq($value, '', $message); } public static function integer($value, $message = '') @@ -204,6 +222,16 @@ } } + public static function natural($value, $message = '') + { + if (!is_int($value) || $value < 0) { + static::reportInvalidArgument(sprintf( + $message ?: 'Expected a non-negative integer. Got %s', + static::valueToString($value) + )); + } + } + public static function boolean($value, $message = '') { if (!is_bool($value)) { @@ -274,6 +302,14 @@ public static function isTraversable($value, $message = '') { + @trigger_error( + sprintf( + 'The "%s" assertion is deprecated. You should stop using it, as it will soon be removed in 2.0 version. Use "isIterable" or "isInstanceOf" instead.', + __METHOD__ + ), + E_USER_DEPRECATED + ); + if (!is_array($value) && !($value instanceof Traversable)) { static::reportInvalidArgument(sprintf( $message ?: 'Expected a traversable. Got: %s', @@ -282,6 +318,36 @@ } } + public static function isArrayAccessible($value, $message = '') + { + if (!is_array($value) && !($value instanceof ArrayAccess)) { + static::reportInvalidArgument(sprintf( + $message ?: 'Expected an array accessible. Got: %s', + static::typeToString($value) + )); + } + } + + public static function isCountable($value, $message = '') + { + if (!is_array($value) && !($value instanceof Countable)) { + static::reportInvalidArgument(sprintf( + $message ?: 'Expected a countable. Got: %s', + static::typeToString($value) + )); + } + } + + public static function isIterable($value, $message = '') + { + if (!is_array($value) && !($value instanceof Traversable)) { + static::reportInvalidArgument(sprintf( + $message ?: 'Expected an iterable. Got: %s', + static::typeToString($value) + )); + } + } + public static function isInstanceOf($value, $class, $message = '') { if (!($value instanceof $class)) { @@ -304,6 +370,21 @@ } } + public static function isInstanceOfAny($value, array $classes, $message = '') + { + foreach ($classes as $class) { + if ($value instanceof $class) { + return; + } + } + + static::reportInvalidArgument(sprintf( + $message ?: 'Expected an instance of any of %2$s. Got: %s', + static::typeToString($value), + implode(', ', array_map(array('static', 'valueToString'), $classes)) + )); + } + public static function isEmpty($value, $message = '') { if (!empty($value)) { @@ -483,6 +564,27 @@ } } + public static function notContains($value, $subString, $message = '') + { + if (false !== strpos($value, $subString)) { + static::reportInvalidArgument(sprintf( + $message ?: '%2$s was not expected to be contained in a value. Got: %s', + static::valueToString($value), + static::valueToString($subString) + )); + } + } + + public static function notWhitespaceOnly($value, $message = '') + { + if (preg_match('/^\s*$/', $value)) { + static::reportInvalidArgument(sprintf( + $message ?: 'Expected a non-whitespace string. Got: %s', + static::valueToString($value) + )); + } + } + public static function startsWith($value, $prefix, $message = '') { if (0 !== strpos($value, $prefix)) { @@ -813,6 +915,42 @@ ); } + public static function minCount($array, $min, $message = '') + { + if (count($array) < $min) { + static::reportInvalidArgument(sprintf( + $message ?: 'Expected an array to contain at least %2$d elements. Got: %d', + count($array), + $min + )); + } + } + + public static function maxCount($array, $max, $message = '') + { + if (count($array) > $max) { + static::reportInvalidArgument(sprintf( + $message ?: 'Expected an array to contain at most %2$d elements. Got: %d', + count($array), + $max + )); + } + } + + public static function countBetween($array, $min, $max, $message = '') + { + $count = count($array); + + if ($count < $min || $count > $max) { + static::reportInvalidArgument(sprintf( + $message ?: 'Expected an array to contain between %2$d and %3$d elements. Got: %d', + $count, + $min, + $max + )); + } + } + public static function uuid($value, $message = '') { $value = str_replace(array('urn:', 'uuid:', '{', '}'), '', $value); @@ -836,6 +974,7 @@ static::string($class); $actual = 'none'; + try { $expression(); } catch (Exception $e) { @@ -869,7 +1008,7 @@ } if ('all' === substr($name, 0, 3)) { - static::isTraversable($arguments[0]); + static::isIterable($arguments[0]); $method = lcfirst(substr($name, 3)); $args = $arguments; diff -r bfffd8d7479a -r 7a779792577d vendor/webmozart/assert/tests/AssertTest.php --- a/vendor/webmozart/assert/tests/AssertTest.php Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,451 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Webmozart\Assert\Tests; - -use ArrayIterator; -use Exception; -use Error; -use LogicException; -use PHPUnit_Framework_TestCase; -use RuntimeException; -use stdClass; -use Webmozart\Assert\Assert; - -/** - * @since 1.0 - * - * @author Bernhard Schussek - */ -class AssertTest extends PHPUnit_Framework_TestCase -{ - private static $resource; - - public static function getResource() - { - if (!static::$resource) { - static::$resource = fopen(__FILE__, 'r'); - } - - return static::$resource; - } - - public static function tearDownAfterClass() - { - @fclose(self::$resource); - } - - public function getTests() - { - $resource = self::getResource(); - - return array( - array('string', array('value'), true), - array('string', array(''), true), - array('string', array(1234), false), - array('stringNotEmpty', array('value'), true), - array('stringNotEmpty', array(''), false), - array('stringNotEmpty', array(1234), false), - array('integer', array(123), true), - array('integer', array('123'), false), - array('integer', array(1.0), false), - array('integer', array(1.23), false), - array('integerish', array(1.0), true), - array('integerish', array(1.23), false), - array('integerish', array(123), true), - array('integerish', array('123'), true), - array('float', array(1.0), true), - array('float', array(1.23), true), - array('float', array(123), false), - array('float', array('123'), false), - array('numeric', array(1.0), true), - array('numeric', array(1.23), true), - array('numeric', array(123), true), - array('numeric', array('123'), true), - array('numeric', array('foo'), false), - array('boolean', array(true), true), - array('boolean', array(false), true), - array('boolean', array(1), false), - array('boolean', array('1'), false), - array('scalar', array('1'), true), - array('scalar', array(123), true), - array('scalar', array(true), true), - array('scalar', array(null), false), - array('scalar', array(array()), false), - array('scalar', array(new stdClass()), false), - array('object', array(new stdClass()), true), - array('object', array(new RuntimeException()), true), - array('object', array(null), false), - array('object', array(true), false), - array('object', array(1), false), - array('object', array(array()), false), - array('resource', array($resource), true), - array('resource', array($resource, 'stream'), true), - array('resource', array($resource, 'other'), false), - array('resource', array(1), false), - array('isCallable', array('strlen'), true), - array('isCallable', array(array($this, 'getTests')), true), - array('isCallable', array(function () {}), true), - array('isCallable', array(1234), false), - array('isCallable', array('foobar'), false), - array('isArray', array(array()), true), - array('isArray', array(array(1, 2, 3)), true), - array('isArray', array(new ArrayIterator(array())), false), - array('isArray', array(123), false), - array('isArray', array(new stdClass()), false), - array('isTraversable', array(array()), true), - array('isTraversable', array(array(1, 2, 3)), true), - array('isTraversable', array(new ArrayIterator(array())), true), - array('isTraversable', array(123), false), - array('isTraversable', array(new stdClass()), false), - array('isInstanceOf', array(new stdClass(), 'stdClass'), true), - array('isInstanceOf', array(new Exception(), 'stdClass'), false), - array('isInstanceOf', array(123, 'stdClass'), false), - array('isInstanceOf', array(array(), 'stdClass'), false), - array('notInstanceOf', array(new stdClass(), 'stdClass'), false), - array('notInstanceOf', array(new Exception(), 'stdClass'), true), - array('notInstanceOf', array(123, 'stdClass'), true), - array('notInstanceOf', array(array(), 'stdClass'), true), - array('true', array(true), true), - array('true', array(false), false), - array('true', array(1), false), - array('true', array(null), false), - array('false', array(false), true), - array('false', array(true), false), - array('false', array(1), false), - array('false', array(0), false), - array('false', array(null), false), - array('null', array(null), true), - array('null', array(false), false), - array('null', array(0), false), - array('notNull', array(false), true), - array('notNull', array(0), true), - array('notNull', array(null), false), - array('isEmpty', array(null), true), - array('isEmpty', array(false), true), - array('isEmpty', array(0), true), - array('isEmpty', array(''), true), - array('isEmpty', array(1), false), - array('isEmpty', array('a'), false), - array('notEmpty', array(1), true), - array('notEmpty', array('a'), true), - array('notEmpty', array(null), false), - array('notEmpty', array(false), false), - array('notEmpty', array(0), false), - array('notEmpty', array(''), false), - array('eq', array(1, 1), true), - array('eq', array(1, '1'), true), - array('eq', array(1, true), true), - array('eq', array(1, 0), false), - array('notEq', array(1, 0), true), - array('notEq', array(1, 1), false), - array('notEq', array(1, '1'), false), - array('notEq', array(1, true), false), - array('same', array(1, 1), true), - array('same', array(1, '1'), false), - array('same', array(1, true), false), - array('same', array(1, 0), false), - array('notSame', array(1, 0), true), - array('notSame', array(1, 1), false), - array('notSame', array(1, '1'), true), - array('notSame', array(1, true), true), - array('greaterThan', array(1, 0), true), - array('greaterThan', array(0, 0), false), - array('greaterThanEq', array(2, 1), true), - array('greaterThanEq', array(1, 1), true), - array('greaterThanEq', array(0, 1), false), - array('lessThan', array(0, 1), true), - array('lessThan', array(1, 1), false), - array('lessThanEq', array(0, 1), true), - array('lessThanEq', array(1, 1), true), - array('lessThanEq', array(2, 1), false), - array('range', array(1, 1, 2), true), - array('range', array(2, 1, 2), true), - array('range', array(0, 1, 2), false), - array('range', array(3, 1, 2), false), - array('oneOf', array(1, array(1, 2, 3)), true), - array('oneOf', array(1, array('1', '2', '3')), false), - array('contains', array('abcd', 'ab'), true), - array('contains', array('abcd', 'bc'), true), - array('contains', array('abcd', 'cd'), true), - array('contains', array('abcd', 'de'), false), - array('contains', array('', 'de'), false), - array('startsWith', array('abcd', 'ab'), true), - array('startsWith', array('abcd', 'bc'), false), - array('startsWith', array('', 'bc'), false), - array('startsWithLetter', array('abcd'), true), - array('startsWithLetter', array('1abcd'), false), - array('startsWithLetter', array(''), false), - array('endsWith', array('abcd', 'cd'), true), - array('endsWith', array('abcd', 'bc'), false), - array('endsWith', array('', 'bc'), false), - array('regex', array('abcd', '~^ab~'), true), - array('regex', array('abcd', '~^bc~'), false), - array('regex', array('', '~^bc~'), false), - array('alpha', array('abcd'), true), - array('alpha', array('ab1cd'), false), - array('alpha', array(''), false), - array('digits', array('1234'), true), - array('digits', array('12a34'), false), - array('digits', array(''), false), - array('alnum', array('ab12'), true), - array('alnum', array('ab12$'), false), - array('alnum', array(''), false), - array('lower', array('abcd'), true), - array('lower', array('abCd'), false), - array('lower', array('ab_d'), false), - array('lower', array(''), false), - array('upper', array('ABCD'), true), - array('upper', array('ABcD'), false), - array('upper', array('AB_D'), false), - array('upper', array(''), false), - array('length', array('abcd', 4), true), - array('length', array('abc', 4), false), - array('length', array('abcde', 4), false), - array('length', array('äbcd', 4), true, true), - array('length', array('äbc', 4), false, true), - array('length', array('äbcde', 4), false, true), - array('minLength', array('abcd', 4), true), - array('minLength', array('abcde', 4), true), - array('minLength', array('abc', 4), false), - array('minLength', array('äbcd', 4), true, true), - array('minLength', array('äbcde', 4), true, true), - array('minLength', array('äbc', 4), false, true), - array('maxLength', array('abcd', 4), true), - array('maxLength', array('abc', 4), true), - array('maxLength', array('abcde', 4), false), - array('maxLength', array('äbcd', 4), true, true), - array('maxLength', array('äbc', 4), true, true), - array('maxLength', array('äbcde', 4), false, true), - array('lengthBetween', array('abcd', 3, 5), true), - array('lengthBetween', array('abc', 3, 5), true), - array('lengthBetween', array('abcde', 3, 5), true), - array('lengthBetween', array('ab', 3, 5), false), - array('lengthBetween', array('abcdef', 3, 5), false), - array('lengthBetween', array('äbcd', 3, 5), true, true), - array('lengthBetween', array('äbc', 3, 5), true, true), - array('lengthBetween', array('äbcde', 3, 5), true, true), - array('lengthBetween', array('äb', 3, 5), false, true), - array('lengthBetween', array('äbcdef', 3, 5), false, true), - array('fileExists', array(__FILE__), true), - array('fileExists', array(__DIR__), true), - array('fileExists', array(__DIR__.'/foobar'), false), - array('file', array(__FILE__), true), - array('file', array(__DIR__), false), - array('file', array(__DIR__.'/foobar'), false), - array('directory', array(__DIR__), true), - array('directory', array(__FILE__), false), - array('directory', array(__DIR__.'/foobar'), false), - // no tests for readable()/writable() for now - array('classExists', array(__CLASS__), true), - array('classExists', array(__NAMESPACE__.'\Foobar'), false), - array('subclassOf', array(__CLASS__, 'PHPUnit_Framework_TestCase'), true), - array('subclassOf', array(__CLASS__, 'stdClass'), false), - array('implementsInterface', array('ArrayIterator', 'Traversable'), true), - array('implementsInterface', array(__CLASS__, 'Traversable'), false), - array('propertyExists', array((object) array('property' => 0), 'property'), true), - array('propertyExists', array((object) array('property' => null), 'property'), true), - array('propertyExists', array((object) array('property' => null), 'foo'), false), - array('propertyNotExists', array((object) array('property' => 0), 'property'), false), - array('propertyNotExists', array((object) array('property' => null), 'property'), false), - array('propertyNotExists', array((object) array('property' => null), 'foo'), true), - array('methodExists', array('RuntimeException', 'getMessage'), true), - array('methodExists', array(new RuntimeException(), 'getMessage'), true), - array('methodExists', array('stdClass', 'getMessage'), false), - array('methodExists', array(new stdClass(), 'getMessage'), false), - array('methodExists', array(null, 'getMessage'), false), - array('methodExists', array(true, 'getMessage'), false), - array('methodExists', array(1, 'getMessage'), false), - array('methodNotExists', array('RuntimeException', 'getMessage'), false), - array('methodNotExists', array(new RuntimeException(), 'getMessage'), false), - array('methodNotExists', array('stdClass', 'getMessage'), true), - array('methodNotExists', array(new stdClass(), 'getMessage'), true), - array('methodNotExists', array(null, 'getMessage'), true), - array('methodNotExists', array(true, 'getMessage'), true), - array('methodNotExists', array(1, 'getMessage'), true), - array('keyExists', array(array('key' => 0), 'key'), true), - array('keyExists', array(array('key' => null), 'key'), true), - array('keyExists', array(array('key' => null), 'foo'), false), - array('keyNotExists', array(array('key' => 0), 'key'), false), - array('keyNotExists', array(array('key' => null), 'key'), false), - array('keyNotExists', array(array('key' => null), 'foo'), true), - array('count', array(array(0, 1, 2), 3), true), - array('count', array(array(0, 1, 2), 2), false), - array('uuid', array('00000000-0000-0000-0000-000000000000'), true), - array('uuid', array('ff6f8cb0-c57d-21e1-9b21-0800200c9a66'), true), - array('uuid', array('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'), true), - array('uuid', array('ff6f8cb0-c57d-31e1-9b21-0800200c9a66'), true), - array('uuid', array('ff6f8cb0-c57d-41e1-9b21-0800200c9a66'), true), - array('uuid', array('ff6f8cb0-c57d-51e1-9b21-0800200c9a66'), true), - array('uuid', array('FF6F8CB0-C57D-11E1-9B21-0800200C9A66'), true), - array('uuid', array('zf6f8cb0-c57d-11e1-9b21-0800200c9a66'), false), - array('uuid', array('af6f8cb0c57d11e19b210800200c9a66'), false), - array('uuid', array('ff6f8cb0-c57da-51e1-9b21-0800200c9a66'), false), - array('uuid', array('af6f8cb-c57d-11e1-9b21-0800200c9a66'), false), - array('uuid', array('3f6f8cb0-c57d-11e1-9b21-0800200c9a6'), false), - array('throws', array(function() { throw new LogicException('test'); }, 'LogicException'), true), - array('throws', array(function() { throw new LogicException('test'); }, 'IllogicException'), false), - array('throws', array(function() { throw new Exception('test'); }), true), - array('throws', array(function() { trigger_error('test'); }, 'Throwable'), true, false, 70000), - array('throws', array(function() { trigger_error('test'); }, 'Unthrowable'), false, false, 70000), - array('throws', array(function() { throw new Error(); }, 'Throwable'), true, true, 70000), - ); - } - - public function getMethods() - { - $methods = array(); - - foreach ($this->getTests() as $params) { - $methods[$params[0]] = array($params[0]); - } - - return array_values($methods); - } - - /** - * @dataProvider getTests - */ - public function testAssert($method, $args, $success, $multibyte = false, $minVersion = null) - { - if ($minVersion && PHP_VERSION_ID < $minVersion) { - $this->markTestSkipped(sprintf('This test requires php %s or upper.', $minVersion)); - - return; - } - if ($multibyte && !function_exists('mb_strlen')) { - $this->markTestSkipped('The function mb_strlen() is not available'); - - return; - } - - if (!$success) { - $this->setExpectedException('\InvalidArgumentException'); - } - - call_user_func_array(array('Webmozart\Assert\Assert', $method), $args); - } - - /** - * @dataProvider getTests - */ - public function testNullOr($method, $args, $success, $multibyte = false, $minVersion = null) - { - if ($minVersion && PHP_VERSION_ID < $minVersion) { - $this->markTestSkipped(sprintf('This test requires php %s or upper.', $minVersion)); - - return; - } - if ($multibyte && !function_exists('mb_strlen')) { - $this->markTestSkipped('The function mb_strlen() is not available'); - - return; - } - - if (!$success && null !== reset($args)) { - $this->setExpectedException('\InvalidArgumentException'); - } - - call_user_func_array(array('Webmozart\Assert\Assert', 'nullOr'.ucfirst($method)), $args); - } - - /** - * @dataProvider getMethods - */ - public function testNullOrAcceptsNull($method) - { - call_user_func(array('Webmozart\Assert\Assert', 'nullOr'.ucfirst($method)), null); - } - - /** - * @dataProvider getTests - */ - public function testAllArray($method, $args, $success, $multibyte = false, $minVersion = null) - { - if ($minVersion && PHP_VERSION_ID < $minVersion) { - $this->markTestSkipped(sprintf('This test requires php %s or upper.', $minVersion)); - - return; - } - if ($multibyte && !function_exists('mb_strlen')) { - $this->markTestSkipped('The function mb_strlen() is not available'); - - return; - } - - if (!$success) { - $this->setExpectedException('\InvalidArgumentException'); - } - - $arg = array_shift($args); - array_unshift($args, array($arg)); - - call_user_func_array(array('Webmozart\Assert\Assert', 'all'.ucfirst($method)), $args); - } - - /** - * @dataProvider getTests - */ - public function testAllTraversable($method, $args, $success, $multibyte = false, $minVersion = null) - { - if ($minVersion && PHP_VERSION_ID < $minVersion) { - $this->markTestSkipped(sprintf('This test requires php %s or upper.', $minVersion)); - - return; - } - if ($multibyte && !function_exists('mb_strlen')) { - $this->markTestSkipped('The function mb_strlen() is not available'); - - return; - } - - if (!$success) { - $this->setExpectedException('\InvalidArgumentException'); - } - - $arg = array_shift($args); - array_unshift($args, new ArrayIterator(array($arg))); - - call_user_func_array(array('Webmozart\Assert\Assert', 'all'.ucfirst($method)), $args); - } - - public function getStringConversions() - { - return array( - array('integer', array('foobar'), 'Expected an integer. Got: string'), - array('string', array(1), 'Expected a string. Got: integer'), - array('string', array(true), 'Expected a string. Got: boolean'), - array('string', array(null), 'Expected a string. Got: NULL'), - array('string', array(array()), 'Expected a string. Got: array'), - array('string', array(new stdClass()), 'Expected a string. Got: stdClass'), - array('string', array(self::getResource()), 'Expected a string. Got: resource'), - - array('eq', array('1', '2'), 'Expected a value equal to "2". Got: "1"'), - array('eq', array(1, 2), 'Expected a value equal to 2. Got: 1'), - array('eq', array(true, false), 'Expected a value equal to false. Got: true'), - array('eq', array(true, null), 'Expected a value equal to null. Got: true'), - array('eq', array(null, true), 'Expected a value equal to true. Got: null'), - array('eq', array(array(1), array(2)), 'Expected a value equal to array. Got: array'), - array('eq', array(new ArrayIterator(array()), new stdClass()), 'Expected a value equal to stdClass. Got: ArrayIterator'), - array('eq', array(1, self::getResource()), 'Expected a value equal to resource. Got: 1'), - ); - } - - /** - * @dataProvider getStringConversions - */ - public function testConvertValuesToStrings($method, $args, $exceptionMessage) - { - $this->setExpectedException('\InvalidArgumentException', $exceptionMessage); - - call_user_func_array(array('Webmozart\Assert\Assert', $method), $args); - } -} diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/CHANGELOG.md --- a/vendor/zendframework/zend-diactoros/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,167 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 1.7.0 - 2018-01-04 + +### Added + +- [#285](https://github.com/zendframework/zend-diactoros/pull/285) adds a new + custom response type, `Zend\Diactoros\Response\XmlResponse`, for generating + responses representing XML. Usage is the same as with the `HtmlResponse` or + `TextResponse`; the response generated will have a `Content-Type: + application/xml` header by default. + +- [#280](https://github.com/zendframework/zend-diactoros/pull/280) adds the + response status code/phrase pairing "103 Early Hints" to the + `Response::$phrases` property. This is a new status proposed via + [RFC 8297](https://datatracker.ietf.org/doc/rfc8297/). + +- [#279](https://github.com/zendframework/zend-diactoros/pull/279) adds explicit + support for PHP 7.2; previously, we'd allowed build failures, though none + occured; we now require PHP 7.2 builds to pass. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + +## 1.6.1 - 2017-10-12 + +### Added + +- Nothing. + +### Changed + +- [#273](https://github.com/zendframework/zend-diactoros/pull/273) updates each + of the SAPI emitter implementations to emit the status line after emitting + other headers; this is done to ensure that the status line is not overridden + by PHP. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- [#273](https://github.com/zendframework/zend-diactoros/pull/273) modifies how + the `SapiEmitterTrait` calls `header()` to ensure that a response code is + _always_ passed as the third argument; this is done to prevent PHP from + silently overriding it. + +## 1.6.0 - 2017-09-13 + +### Added + +- Nothing. + +### Changed + +- [#270](https://github.com/zendframework/zend-diactoros/pull/270) changes the + behavior of `Zend\Diactoros\Server`: it no longer creates an output buffer. + +- [#270](https://github.com/zendframework/zend-diactoros/pull/270) changes the + behavior of the two SAPI emitters in two backwards-incompatible ways: + + - They no longer auto-inject a `Content-Length` header. If you need this + functionality, zendframework/zend-expressive-helpers 4.1+ provides it via + `Zend\Expressive\Helper\ContentLengthMiddleware`. + + - They no longer flush the output buffer. Instead, if headers have been sent, + or the output buffer exists and has a non-zero length, the emitters raise an + exception, as mixed PSR-7/output buffer content creates a blocking issue. + If you are emitting content via `echo`, `print`, `var_dump`, etc., or not + catching PHP errors or exceptions, you will need to either fix your + application to always work with a PSR-7 response, or provide your own + emitters that allow mixed output mechanisms. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + +## 1.5.0 - 2017-08-22 + +### Added + +- [#205](https://github.com/zendframework/zend-diactoros/pull/205) adds support + for PHP 7.2. + +- [#250](https://github.com/zendframework/zend-diactoros/pull/250) adds a new + API to `JsonResponse` to avoid the need for decoding the response body in + order to make changes to the underlying content. New methods include: + - `getPayload()`: retrieve the unencoded payload. + - `withPayload($data)`: create a new instance with the given data. + - `getEncodingOptions()`: retrieve the flags to use when encoding the payload + to JSON. + - `withEncodingOptions(int $encodingOptions)`: create a new instance that uses + the provided flags when encoding the payload to JSON. + +### Changed + +- [#249](https://github.com/zendframework/zend-diactoros/pull/249) changes the + behavior of the various `Uri::with*()` methods slightly: if the value + represents no change, these methods will return the same instance instead of a + new one. + +- [#248](https://github.com/zendframework/zend-diactoros/pull/248) changes the + behavior of `Uri::getUserInfo()` slightly: it now (correctly) returns the + percent-encoded values for the user and/or password, per RFC 3986 Section + 3.2.1. `withUserInfo()` will percent-encode values, using a mechanism that + prevents double-encoding. + +- [#243](https://github.com/zendframework/zend-diactoros/pull/243) changes the + exception messages thrown by `UploadedFile::getStream()` and `moveTo()` when + an upload error exists to include details about the upload error. + +- [#233](https://github.com/zendframework/zend-diactoros/pull/233) adds a new + argument to `SapiStreamEmitter::emit`, `$maxBufferLevel` **between** the + `$response` and `$maxBufferLength` arguments. This was done because the + `Server::listen()` method passes only the response and `$maxBufferLevel` to + emitters; previously, this often meant that streams were being chunked 2 bytes + at a time versus the expected default of 8kb. + + If you were calling the `SapiStreamEmitter::emit()` method manually + previously, you will need to update your code. + +### Deprecated + +- Nothing. + +### Removed + +- [#205](https://github.com/zendframework/zend-diactoros/pull/205) and + [#243](https://github.com/zendframework/zend-diactoros/pull/243) **remove + support for PHP versions prior to 5.6 as well as HHVM**. + +### Fixed + +- [#248](https://github.com/zendframework/zend-diactoros/pull/248) fixes how the + `Uri` class provides user-info within the URI authority; the value is now + correctly percent-encoded , per RFC 3986 Section 3.2.1. + ## 1.4.1 - 2017-08-17 ### Added diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/composer.json --- a/vendor/zendframework/zend-diactoros/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -13,21 +13,24 @@ "issues": "https://github.com/zendframework/zend-diactoros/issues", "source": "https://github.com/zendframework/zend-diactoros" }, + "config": { + "sort-packages": true + }, "extra": { "branch-alias": { - "dev-master": "1.4-dev", - "dev-develop": "1.5-dev" + "dev-master": "1.7.x-dev", + "dev-develop": "1.8.x-dev" } }, "require": { - "php": "^5.4 || ^7.0", - "psr/http-message": "~1.0" + "php": "^5.6 || ^7.0", + "psr/http-message": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.6 || ^5.5", - "zendframework/zend-coding-standard": "~1.0.0", "ext-dom": "*", - "ext-libxml": "*" + "ext-libxml": "*", + "phpunit/phpunit": "^5.7.16 || ^6.0.8", + "zendframework/zend-coding-standard": "~1.0" }, "provide": { "psr/http-message-implementation": "1.0" @@ -51,10 +54,10 @@ "@cs-check", "@test" ], - "upload-coverage": "coveralls -v", "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit --colors=always", - "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", + "upload-coverage": "php-coveralls -v" } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/composer.lock --- a/vendor/zendframework/zend-diactoros/composer.lock Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/composer.lock Fri Feb 23 15:52:07 2018 +0000 @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "287996fa611f46eb393c625c762f709f", - "content-hash": "3efa62db7f378a4802a4cf729875f3aa", + "content-hash": "de254758c5d28198ad8441fb154fc7f3", "packages": [ { "name": "psr/http-message", @@ -55,7 +54,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" } ], "packages-dev": [ @@ -111,41 +110,234 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "name": "myclabs/deep-copy", + "version": "1.6.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-04-12T18:52:22+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27T11:43:31+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.3.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -157,10 +349,58 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03 12:10:50" + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-08-08T06:39:58+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-06-03T08:32:36+00:00" }, { "name": "phpspec/prophecy", @@ -223,43 +463,45 @@ "spy", "stub" ], - "time": "2017-03-02 20:05:34" + "time": "2017-03-02T20:05:34+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b", + "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b", "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.3.2", - "sebastian/version": "~1.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^1.4.11 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "ext-xdebug": "^2.5", + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "5.2.x-dev" } }, "autoload": { @@ -285,7 +527,7 @@ "testing", "xunit" ], - "time": "2015-10-06 15:47:00" + "time": "2017-08-03T12:40:43+00:00" }, { "name": "phpunit/php-file-iterator", @@ -332,7 +574,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -373,7 +615,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -422,33 +664,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26 11:10:40" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.11", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -471,45 +713,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27 10:12:30" + "time": "2017-08-20T05:47:52+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.35", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" + "reference": "9501bab711403a1ab5b8378a8adb4ec3db3debdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9501bab711403a1ab5b8378a8adb4ec3db3debdb", + "reference": "9501bab711403a1ab5b8378a8adb4ec3db3debdb", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.2.2", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^4.0.3", + "sebastian/comparator": "^2.0.2", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" }, "suggest": { - "phpunit/php-invoker": "~1.1" + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -517,7 +771,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "6.3.x-dev" } }, "autoload": { @@ -543,30 +797,33 @@ "testing", "xunit" ], - "time": "2017-02-06 05:18:07" + "time": "2017-08-04T05:20:39+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.0" + }, + "conflict": { + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-soap": "*" @@ -574,7 +831,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -599,34 +856,79 @@ "mock", "xunit" ], - "time": "2015-10-02 06:51:40" + "time": "2017-08-03T14:08:16+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.4", + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0", + "sebastian/exporter": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -663,32 +965,32 @@ "compare", "equality" ], - "time": "2017-01-29 09:50:25" + "time": "2017-08-03T07:14:59+00:00" }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -715,32 +1017,32 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -765,34 +1067,34 @@ "environment", "hhvm" ], - "time": "2016-08-18 05:49:44" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -832,27 +1134,27 @@ "export", "exporter" ], - "time": "2016-06-17 09:04:28" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -860,7 +1162,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -883,32 +1185,124 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2017-04-27T15:39:26+00:00" }, { - "name": "sebastian/recursion-context", - "version": "1.0.5", + "name": "sebastian/object-enumerator", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -936,23 +1330,73 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03 07:41:43" + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", - "version": "1.0.6", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, + "require": { + "php": ">=5.6" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -971,20 +1415,20 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "2.8.1", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", "shasum": "" }, "require": { @@ -1049,38 +1493,79 @@ "phpcs", "standards" ], - "time": "2017-03-01 22:17:45" + "time": "2017-05-22T02:43:20+00:00" }, { - "name": "symfony/yaml", - "version": "v2.8.19", + "name": "theseer/tokenizer", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "286d84891690b0e2515874717e49360d1c98a703" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/286d84891690b0e2515874717e49360d1c98a703", - "reference": "286d84891690b0e2515874717e49360d1c98a703", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", "shasum": "" }, "require": { - "php": ">=5.3.9" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "1.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Webmozart\\Assert\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1088,17 +1573,17 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2017-03-20 09:41:44" + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23T20:04:58+00:00" }, { "name": "zendframework/zend-coding-standard", @@ -1127,7 +1612,7 @@ "Coding Standard", "zf" ], - "time": "2016-11-09 21:30:43" + "time": "2016-11-09T21:30:43+00:00" } ], "aliases": [], @@ -1136,7 +1621,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^5.4 || ^7.0" + "php": "^5.6 || ^7.0" }, "platform-dev": { "ext-dom": "*", diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/HeaderSecurity.php --- a/vendor/zendframework/zend-diactoros/src/HeaderSecurity.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/HeaderSecurity.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,9 +1,7 @@ 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', + 103 => 'Early Hints', // SUCCESS CODES 200 => 'OK', 201 => 'Created', diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/Response/JsonResponse.php --- a/vendor/zendframework/zend-diactoros/src/Response/JsonResponse.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/Response/JsonResponse.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,9 +1,7 @@ write($this->jsonEncode($data, $encodingOptions)); - $body->rewind(); + $this->setPayload($data); + $this->encodingOptions = $encodingOptions; + + $json = $this->jsonEncode($data, $this->encodingOptions); + $body = $this->createBodyFromJson($json); $headers = $this->injectContentType('application/json', $headers); @@ -69,6 +79,60 @@ } /** + * @return mixed + */ + public function getPayload() + { + return $this->payload; + } + + /** + * @param $data + * + * @return JsonResponse + */ + public function withPayload($data) + { + $new = clone $this; + $new->setPayload($data); + return $this->updateBodyFor($new); + } + + /** + * @return int + */ + public function getEncodingOptions() + { + return $this->encodingOptions; + } + + /** + * @param int $encodingOptions + * + * @return JsonResponse + */ + public function withEncodingOptions($encodingOptions) + { + $new = clone $this; + $new->encodingOptions = $encodingOptions; + return $this->updateBodyFor($new); + } + + /** + * @param string $json + * + * @return Stream + */ + private function createBodyFromJson($json) + { + $body = new Stream('php://temp', 'wb+'); + $body->write($json); + $body->rewind(); + + return $body; + } + + /** * Encode the provided data to JSON. * * @param mixed $data @@ -97,4 +161,29 @@ return $json; } + + /** + * @param $data + */ + private function setPayload($data) + { + if (is_object($data)) { + $data = clone $data; + } + + $this->payload = $data; + } + + /** + * Update the response body for the given instance. + * + * @param self $toUpdate Instance to update. + * @return JsonResponse Returns a new instance with an updated body. + */ + private function updateBodyFor(self $toUpdate) + { + $json = $this->jsonEncode($toUpdate->payload, $toUpdate->encodingOptions); + $body = $this->createBodyFromJson($json); + return $toUpdate->withBody($body); + } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/Response/SapiEmitter.php --- a/vendor/zendframework/zend-diactoros/src/Response/SapiEmitter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/Response/SapiEmitter.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,9 +1,7 @@ assertNoPreviousOutput(); - $response = $this->injectContentLength($response); - + $this->emitHeaders($response); $this->emitStatusLine($response); - $this->emitHeaders($response); - $this->flush($maxBufferLevel); $this->emitBody($response); } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/Response/SapiEmitterTrait.php --- a/vendor/zendframework/zend-diactoros/src/Response/SapiEmitterTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/Response/SapiEmitterTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,35 +1,35 @@ hasHeader('Content-Length')) { - // PSR-7 indicates int OR null for the stream size; for null values, - // we will not auto-inject the Content-Length. - if (null !== $response->getBody()->getSize()) { - return $response->withHeader('Content-Length', (string) $response->getBody()->getSize()); - } + if (headers_sent()) { + throw new RuntimeException('Unable to emit response; headers already sent'); } - return $response; + if (ob_get_level() > 0 && ob_get_length() > 0) { + throw new RuntimeException('Output has been emitted previously; cannot emit response'); + } } /** @@ -38,17 +38,25 @@ * Emits the status line using the protocol version and status code from * the response; if a reason phrase is available, it, too, is emitted. * + * It is important to mention that this method should be called after + * `emitHeaders()` in order to prevent PHP from changing the status code of + * the emitted response. + * * @param ResponseInterface $response + * + * @see \Zend\Diactoros\Response\SapiEmitterTrait::emitHeaders() */ private function emitStatusLine(ResponseInterface $response) { $reasonPhrase = $response->getReasonPhrase(); + $statusCode = $response->getStatusCode(); + header(sprintf( 'HTTP/%s %d%s', $response->getProtocolVersion(), - $response->getStatusCode(), + $statusCode, ($reasonPhrase ? ' ' . $reasonPhrase : '') - )); + ), true, $statusCode); } /** @@ -63,6 +71,8 @@ */ private function emitHeaders(ResponseInterface $response) { + $statusCode = $response->getStatusCode(); + foreach ($response->getHeaders() as $header => $values) { $name = $this->filterHeader($header); $first = $name === 'Set-Cookie' ? false : true; @@ -71,30 +81,13 @@ '%s: %s', $name, $value - ), $first); + ), $first, $statusCode); $first = false; } } } /** - * Loops through the output buffer, flushing each, before emitting - * the response. - * - * @param int|null $maxBufferLevel Flush up to this buffer level. - */ - private function flush($maxBufferLevel = null) - { - if (null === $maxBufferLevel) { - $maxBufferLevel = ob_get_level(); - } - - while (ob_get_level() > $maxBufferLevel) { - ob_end_flush(); - } - } - - /** * Filter a header name to wordcase * * @param string $header diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/Response/SapiStreamEmitter.php --- a/vendor/zendframework/zend-diactoros/src/Response/SapiStreamEmitter.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/Response/SapiStreamEmitter.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,9 +1,7 @@ injectContentLength($response); - + $this->assertNoPreviousOutput(); + $this->emitHeaders($response); $this->emitStatusLine($response); - $this->emitHeaders($response); - $this->flush(); $range = $this->parseContentRange($response->getHeaderLine('Content-Range')); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/Response/Serializer.php --- a/vendor/zendframework/zend-diactoros/src/Response/Serializer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/Response/Serializer.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,9 +1,7 @@ createBody($xml), + $status, + $this->injectContentType('application/xml; charset=utf-8', $headers) + ); + } + + /** + * Create the message body. + * + * @param string|StreamInterface $xml + * @return StreamInterface + * @throws InvalidArgumentException if $xml is neither a string or stream. + */ + private function createBody($xml) + { + if ($xml instanceof StreamInterface) { + return $xml; + } + + if (! is_string($xml)) { + throw new InvalidArgumentException(sprintf( + 'Invalid content (%s) provided to %s', + (is_object($xml) ? get_class($xml) : gettype($xml)), + __CLASS__ + )); + } + + $body = new Stream('php://temp', 'wb+'); + $body->write($xml); + $body->rewind(); + return $body; + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/Server.php --- a/vendor/zendframework/zend-diactoros/src/Server.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/Server.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,9 +1,7 @@ callback; - ob_start(); - $bufferLevel = ob_get_level(); - $response = $callback($this->request, $this->response, $finalHandler); if (! $response instanceof ResponseInterface) { $response = $this->response; } - $this->getEmitter()->emit($response, $bufferLevel); + + $this->getEmitter()->emit($response); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/ServerRequest.php --- a/vendor/zendframework/zend-diactoros/src/ServerRequest.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/ServerRequest.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,9 +1,7 @@ 'There is no error, the file uploaded with success', + UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini', + UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was ' + . 'specified in the HTML form', + UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded', + UPLOAD_ERR_NO_FILE => 'No file was uploaded', + UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder', + UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk', + UPLOAD_ERR_EXTENSION => 'A PHP extension stopped the file upload.', + ]; + /** - * @var string + * @var string|null */ private $clientFilename; /** - * @var string + * @var string|null */ private $clientMediaType; @@ -114,7 +124,10 @@ public function getStream() { if ($this->error !== UPLOAD_ERR_OK) { - throw new RuntimeException('Cannot retrieve stream due to upload error'); + throw new RuntimeException(sprintf( + 'Cannot retrieve stream due to upload error: %s', + self::ERROR_MESSAGES[$this->error] + )); } if ($this->moved) { @@ -147,7 +160,10 @@ } if ($this->error !== UPLOAD_ERR_OK) { - throw new RuntimeException('Cannot retrieve stream due to upload error'); + throw new RuntimeException(sprintf( + 'Cannot retrieve stream due to upload error: %s', + self::ERROR_MESSAGES[$this->error] + )); } if (! is_string($targetPath) || empty($targetPath)) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-diactoros/src/Uri.php --- a/vendor/zendframework/zend-diactoros/src/Uri.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-diactoros/src/Uri.php Fri Feb 23 15:52:07 2018 +0000 @@ -1,9 +1,7 @@ scheme) { // Do nothing if no change was made. - return clone $this; + return $this; } $new = clone $this; @@ -242,6 +244,11 @@ } /** + * Create and return a new instance containing the provided user credentials. + * + * The value will be percent-encoded in the new instance, but with measures + * taken to prevent double-encoding. + * * {@inheritdoc} */ public function withUserInfo($user, $password = null) @@ -261,14 +268,14 @@ )); } - $info = $user; + $info = $this->filterUserInfoPart($user); if ($password) { - $info .= ':' . $password; + $info .= ':' . $this->filterUserInfoPart($password); } if ($info === $this->userInfo) { // Do nothing if no change was made. - return clone $this; + return $this; } $new = clone $this; @@ -292,7 +299,7 @@ if ($host === $this->host) { // Do nothing if no change was made. - return clone $this; + return $this; } $new = clone $this; @@ -319,10 +326,10 @@ if ($port === $this->port) { // Do nothing if no change was made. - return clone $this; + return $this; } - if ($port !== null && $port < 1 || $port > 65535) { + if ($port !== null && ($port < 1 || $port > 65535)) { throw new InvalidArgumentException(sprintf( 'Invalid port "%d" specified; must be a valid TCP/UDP port', $port @@ -362,7 +369,7 @@ if ($path === $this->path) { // Do nothing if no change was made. - return clone $this; + return $this; } $new = clone $this; @@ -392,7 +399,7 @@ if ($query === $this->query) { // Do nothing if no change was made. - return clone $this; + return $this; } $new = clone $this; @@ -418,7 +425,7 @@ if ($fragment === $this->fragment) { // Do nothing if no change was made. - return clone $this; + return $this; } $new = clone $this; @@ -443,7 +450,7 @@ } $this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : ''; - $this->userInfo = isset($parts['user']) ? $parts['user'] : ''; + $this->userInfo = isset($parts['user']) ? $this->filterUserInfoPart($parts['user']) : ''; $this->host = isset($parts['host']) ? $parts['host'] : ''; $this->port = isset($parts['port']) ? $parts['port'] : null; $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : ''; @@ -548,6 +555,23 @@ } /** + * Filters a part of user info in a URI to ensure it is properly encoded. + * + * @param string $part + * @return string + */ + private function filterUserInfoPart($part) + { + // Note the addition of `%` to initial charset; this allows `|` portion + // to match and thus prevent double-encoding. + return preg_replace_callback( + '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/u', + [$this, 'urlEncodeChar'], + $part + ); + } + + /** * Filters the path of a URI to ensure it is properly encoded. * * @param string $path @@ -624,7 +648,7 @@ /** * Filter a fragment value to ensure it is properly encoded. * - * @param null|string $fragment + * @param string $fragment * @return string */ private function filterFragment($fragment) diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/CHANGELOG.md --- a/vendor/zendframework/zend-feed/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,79 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 2.9.0 - 2017-12-04 + +### Added + +- [#52](https://github.com/zendframework/zend-feed/pull/52) adds support for PHP + 7.2 + +- [#53](https://github.com/zendframework/zend-feed/pull/53) adds a number of + additional aliases to the `Writer\ExtensionPluginManager` to ensure plugins + will be pulled as expected. + +- [#63](https://github.com/zendframework/zend-feed/pull/63) adds the feed title + to the attributes incorporated in the `FeedSet` instance, per what was already + documented. + +- [#55](https://github.com/zendframework/zend-feed/pull/55) makes two API + additions to the `StandaloneExtensionManager` implementations of both the reader + and writer subcomponents: + + - `$manager->add($name, $class)` will add an extension class using the + provided name. + - `$manager->remove($name)` will remove an existing extension by the provided + name. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- [#52](https://github.com/zendframework/zend-feed/pull/52) removes support for + HHVM. + +### Fixed + +- [#50](https://github.com/zendframework/zend-feed/pull/50) fixes a few issues + in the PubSubHubbub `Subscription` model where counting was being performed on + uncountable data; this ensures the subcomponent will work correctly under PHP + 7.2. + +## 2.8.0 - 2017-04-02 + +### Added + +- [#27](https://github.com/zendframework/zend-feed/pull/27) adds a documentation + chapter demonstrating wrapping a PSR-7 client to use with `Zend\Feed\Reader`. +- [#22](https://github.com/zendframework/zend-feed/pull/22) adds missing + ExtensionManagerInterface on Writer\ExtensionPluginManager. +- [#32](https://github.com/zendframework/zend-feed/pull/32) adds missing + ExtensionManagerInterface on Reader\ExtensionPluginManager. + +### Deprecated + +- Nothing. + +### Removed + +- [#38](https://github.com/zendframework/zend-feed/pull/38) dropped php 5.5 + support + +### Fixed + +- [#35](https://github.com/zendframework/zend-feed/pull/35) fixed + "A non-numeric value encountered" in php 7.1 +- [#39](https://github.com/zendframework/zend-feed/pull/39) fixed protocol + relative link absolutisation +- [#40](https://github.com/zendframework/zend-feed/pull/40) fixed service + manager v3 compatibility aliases in extension plugin managers + ## 2.7.0 - 2016-02-11 ### Added diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/CONTRIBUTING.md --- a/vendor/zendframework/zend-feed/CONTRIBUTING.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -# CONTRIBUTING - -## RESOURCES - -If you wish to contribute to Zend Framework, please be sure to -read/subscribe to the following resources: - - - [Coding Standards](https://github.com/zendframework/zf2/wiki/Coding-Standards) - - [Contributor's Guide](http://framework.zend.com/participate/contributor-guide) - - ZF Contributor's mailing list: - Archives: http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html - Subscribe: zf-contributors-subscribe@lists.zend.com - - ZF Contributor's IRC channel: - #zftalk.dev on Freenode.net - -If you are working on new features or refactoring [create a proposal](https://github.com/zendframework/zend-feed/issues/new). - -## Reporting Potential Security Issues - -If you have encountered a potential security vulnerability, please **DO NOT** report it on the public -issue tracker: send it to us at [zf-security@zend.com](mailto:zf-security@zend.com) instead. -We will work with you to verify the vulnerability and patch it as soon as possible. - -When reporting issues, please provide the following information: - -- Component(s) affected -- A description indicating how to reproduce the issue -- A summary of the security vulnerability and impact - -We request that you contact us via the email address above and give the project -contributors a chance to resolve the vulnerability and issue a new release prior -to any public exposure; this helps protect users and provides them with a chance -to upgrade and/or update in order to protect their applications. - -For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc). - -## RUNNING TESTS - -> ### Note: testing versions prior to 2.4 -> -> This component originates with Zend Framework 2. During the lifetime of ZF2, -> testing infrastructure migrated from PHPUnit 3 to PHPUnit 4. In most cases, no -> changes were necessary. However, due to the migration, tests may not run on -> versions < 2.4. As such, you may need to change the PHPUnit dependency if -> attempting a fix on such a version. - -To run tests: - -- Clone the repository: - - ```console - $ git clone git@github.com:zendframework/zend-feed.git - $ cd - ``` - -- Install dependencies via composer: - - ```console - $ curl -sS https://getcomposer.org/installer | php -- - $ ./composer.phar install - ``` - - If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/ - -- Run the tests via `phpunit` and the provided PHPUnit config, like in this example: - - ```console - $ ./vendor/bin/phpunit - ``` - -You can turn on conditional tests with the phpunit.xml file. -To do so: - - - Copy `phpunit.xml.dist` file to `phpunit.xml` - - Edit `phpunit.xml` to enable any specific functionality you - want to test, as well as to provide test values to utilize. - -## Running Coding Standards Checks - -This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding -standards checks, and provides configuration for our selected checks. -`php-cs-fixer` is installed by default via Composer. - -To run checks only: - -```console -$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs -``` - -To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run` -flag: - -```console -$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs -``` - -If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure -they pass, and make sure you add and commit the changes after verification. - -## Recommended Workflow for Contributions - -Your first step is to establish a public repository from which we can -pull your work into the master repository. We recommend using -[GitHub](https://github.com), as that is where the component is already hosted. - -1. Setup a [GitHub account](http://github.com/), if you haven't yet -2. Fork the repository (http://github.com/zendframework/zend-feed) -3. Clone the canonical repository locally and enter it. - - ```console - $ git clone git://github.com:zendframework/zend-feed.git - $ cd zend-feed - ``` - -4. Add a remote to your fork; substitute your GitHub username in the command - below. - - ```console - $ git remote add {username} git@github.com:{username}/zend-feed.git - $ git fetch {username} - ``` - -### Keeping Up-to-Date - -Periodically, you should update your fork or personal repository to -match the canonical ZF repository. Assuming you have setup your local repository -per the instructions above, you can do the following: - - -```console -$ git checkout master -$ git fetch origin -$ git rebase origin/master -# OPTIONALLY, to keep your remote up-to-date - -$ git push {username} master:master -``` - -If you're tracking other branches -- for example, the "develop" branch, where -new feature development occurs -- you'll want to do the same operations for that -branch; simply substitute "develop" for "master". - -### Working on a patch - -We recommend you do each new feature or bugfix in a new branch. This simplifies -the task of code review as well as the task of merging your changes into the -canonical repository. - -A typical workflow will then consist of the following: - -1. Create a new local branch based off either your master or develop branch. -2. Switch to your new local branch. (This step can be combined with the - previous step with the use of `git checkout -b`.) -3. Do some work, commit, repeat as necessary. -4. Push the local branch to your remote repository. -5. Send a pull request. - -The mechanics of this process are actually quite trivial. Below, we will -create a branch for fixing an issue in the tracker. - -```console -$ git checkout -b hotfix/9295 -Switched to a new branch 'hotfix/9295' -``` - -... do some work ... - - -```console -$ git commit -``` - -... write your log message ... - - -```console -$ git push {username} hotfix/9295:hotfix/9295 -Counting objects: 38, done. -Delta compression using up to 2 threads. -Compression objects: 100% (18/18), done. -Writing objects: 100% (20/20), 8.19KiB, done. -Total 20 (delta 12), reused 0 (delta 0) -To ssh://git@github.com/{username}/zend-feed.git - b5583aa..4f51698 HEAD -> master -``` - -To send a pull request, you have two options. - -If using GitHub, you can do the pull request from there. Navigate to -your repository, select the branch you just created, and then select the -"Pull Request" button in the upper right. Select the user/organization -"zendframework" as the recipient. - -If using your own repository - or even if using GitHub - you can use `git -format-patch` to create a patchset for us to apply; in fact, this is -**recommended** for security-related patches. If you use `format-patch`, please -send the patches as attachments to: - -- zf-devteam@zend.com for patches without security implications -- zf-security@zend.com for security patches - -#### What branch to issue the pull request against? - -Which branch should you issue a pull request against? - -- For fixes against the stable release, issue the pull request against the - "master" branch. -- For new features, or fixes that introduce new elements to the public API (such - as new public methods or properties), issue the pull request against the - "develop" branch. - -### Branch Cleanup - -As you might imagine, if you are a frequent contributor, you'll start to -get a ton of branches both locally and on your remote. - -Once you know that your changes have been accepted to the master -repository, we suggest doing some cleanup of these branches. - -- Local branch cleanup - - ```console - $ git branch -d - ``` - -- Remote branch removal - - ```console - $ git push {username} : - ``` diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/LICENSE.md --- a/vendor/zendframework/zend-feed/LICENSE.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/LICENSE.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,16 +1,15 @@ -Copyright (c) 2005-2015, Zend Technologies USA, Inc. - +Copyright (c) 2005-2017, Zend Technologies USA, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +- Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +- Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. - Neither the name of Zend Technologies USA, Inc. nor the names of its contributors may be used to endorse or promote products derived from this diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/README.md --- a/vendor/zendframework/zend-feed/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,13 +1,12 @@ # zend-feed [![Build Status](https://secure.travis-ci.org/zendframework/zend-feed.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-feed) -[![Coverage Status](https://coveralls.io/repos/zendframework/zend-feed/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-feed?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-feed/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-feed?branch=master) `Zend\Feed` provides functionality for consuming RSS and Atom feeds. It provides a natural syntax for accessing elements of feeds, feed attributes, and entry attributes. `Zend\Feed` also has extensive support for modifying feed and entry structure with the same natural syntax, and turning the result back into XML. - - File issues at https://github.com/zendframework/zend-feed/issues -- Documentation is at https://zendframework.github.io/zend-feed/ +- Documentation is at https://docs.zendframework.com/zend-feed/ diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/composer.json --- a/vendor/zendframework/zend-feed/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -3,49 +3,69 @@ "description": "provides functionality for consuming RSS and Atom feeds", "license": "BSD-3-Clause", "keywords": [ - "zf2", + "zf", + "zendframework", "feed" ], - "homepage": "https://github.com/zendframework/zend-feed", - "autoload": { - "psr-4": { - "Zend\\Feed\\": "src/" - } + "support": { + "docs": "https://docs.zendframework.com/zend-feed/", + "issues": "https://github.com/zendframework/zend-feed/issues", + "source": "https://github.com/zendframework/zend-feed", + "rss": "https://github.com/zendframework/zend-feed/releases.atom", + "slack": "https://zendframework-slack.herokuapp.com", + "forum": "https://discourse.zendframework.com/c/questions/components" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-escaper": "^2.5", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "php": "^5.6 || ^7.0", + "zendframework/zend-escaper": "^2.5.2", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" }, "require-dev": { - "zendframework/zend-db": "^2.5", - "zendframework/zend-cache": "^2.5", - "zendframework/zend-http": "^2.5", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", - "zendframework/zend-validator": "^2.5", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/PHPUnit": "~4.0", - "psr/http-message": "^1.0" + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "psr/http-message": "^1.0.1", + "zendframework/zend-cache": "^2.7.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-db": "^2.8.2", + "zendframework/zend-http": "^2.7", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-validator": "^2.10.1" }, "suggest": { - "psr/http-message": "PSR-7 ^1.0, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator", + "psr/http-message": "PSR-7 ^1.0.1, if you wish to use Zend\\Feed\\Reader\\Http\\Psr7ResponseDecorator", "zendframework/zend-cache": "Zend\\Cache component, for optionally caching feeds between requests", "zendframework/zend-db": "Zend\\Db component, for use with PubSubHubbub", "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for easily extending ExtensionManager implementations", - "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries ehen using the Writer subcomponent" + "zendframework/zend-validator": "Zend\\Validator component, for validating email addresses used in Atom feeds and entries when using the Writer subcomponent" }, - "minimum-stability": "dev", - "prefer-stable": true, - "extra": { - "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" + "autoload": { + "psr-4": { + "Zend\\Feed\\": "src/" } }, "autoload-dev": { "psr-4": { "ZendTest\\Feed\\": "test/" } + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "2.9-dev", + "dev-develop": "2.10-dev" + } + }, + "scripts": { + "check": [ + "@cs-check", + "@test" + ], + "cs-check": "phpcs", + "cs-fix": "phpcbf", + "test": "phpunit --colors=always", + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", + "upload-coverage": "coveralls -v" } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/consuming-atom-entry.md --- a/vendor/zendframework/zend-feed/doc/book/consuming-atom-entry.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -# Consuming a Single Atom Entry - -Single Atom `` elements are also valid by themselves. Usually the URL for -an entry is the feed's URL followed by `/`, such as -`http://atom.example.com/feed/1`, using the example URL we used above. This -pattern may exist for some web services which use Atom as a container syntax. - -If you read a single entry, you will have a `Zend\Feed\Reader\Entry\Atom` object. - -## Reading a Single-Entry Atom Feed - -```php -$entry = Zend\Feed\Reader\Reader::import('http://atom.example.com/feed/1'); -echo 'Entry title: ' . $entry->getTitle(); -``` - -> ## Importing requires an HTTP client -> -> To import a feed, you will need to have an [HTTP client](zend.feed.http-clients) -> available. -> -> If you are not using zend-http, you will need to inject `Reader` with the HTTP -> client. See the [section on providing a client to Reader](http-clients.md#providing-a-client-to-reader). diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/consuming-atom.md --- a/vendor/zendframework/zend-feed/doc/book/consuming-atom.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -# Consuming Atom Feeds - -`Zend\Feed\Reader\Feed\Atom` is used in much the same way as -`Zend\Feed\Reader\Feed\Rss`. It provides the same access to feed-level -properties and iteration over entries in the feed. The main difference is in the -structure of the Atom protocol itself. Atom is a successor to RSS; it is a -more generalized protocol and it is designed to deal more easily with feeds that -provide their full content inside the feed, splitting RSS' `description` tag -into two elements, `summary` and `content`, for that purpose. - -## Basic Use of an Atom Feed - -Read an Atom feed and print the `title` and `summary` of each entry: - -```php -$feed = Zend\Feed\Reader\Reader::import('http://atom.example.com/feed/'); -echo 'The feed contains ' . $feed->count() . ' entries.' . "\n\n"; -foreach ($feed as $entry) { - echo 'Title: ' . $entry->getTitle() . "\n"; - echo 'Description: ' . $entry->getDescription() . "\n"; - echo 'URL: ' . $entry->getLink() . "\n\n"; -} -``` - -> ## Importing requires an HTTP client -> -> To import a feed, you will need to have an [HTTP client](zend.feed.http-clients) -> available. -> -> If you are not using zend-http, you will need to inject `Reader` with the HTTP -> client. See the [section on providing a client to Reader](http-clients.md#providing-a-client-to-reader). - -In an Atom feed, you can expect to find the following feed properties: - -- `title`: The feed's title, same as RSS' channel title. -- `id`: Every feed and entry in Atom has a unique identifier. -- `link`: Feeds can have multiple links, which are distinguished by a `type` - attribute. The equivalent to RSS's channel link would be `type="text/html"`. - If the link is to an alternate version of the same content that's in the feed, - it would have a `rel="alternate"` attribute. -- `subtitle`: The feed's description, equivalent to RSS' channel description. -- `author`: The feed's author, with `name` and `email` sub-tags. - -Atom entries commonly have the following properties: - -- `id`: The entry's unique identifier. -- `title`: The entry's title, same as RSS item titles. -- `link`: A link to another format or an alternate view of this entry. - The link property of an atom entry typically has an `href` attribute. -- `summary`: A summary of this entry's content. -- `content`: The full content of the entry; can be skipped if the feed just - contains summaries. -- `author`: with `name` and `email` sub-tags like feeds have. -- `published`: the date the entry was published, in RFC 3339 format. -- `updated`: the date the entry was last updated, in RFC 3339 format. - -Where relevant, `Zend\Feed` supports a number of common RSS extensions including -Dublin Core; Content, Slash, Syndication, and Syndication/Thread; and several -others in common use on blogs. - -For more information on Atom and plenty of resources, see -[http://www.atomenabled.org/](http://www.atomenabled.org/). diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/consuming-rss.md --- a/vendor/zendframework/zend-feed/doc/book/consuming-rss.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -# Consuming RSS Feeds - -## Reading a feed - -To read an RSS feed, pass its URL to `Zend\Feed\Reader\Reader::import()`: - -```php -$channel = Zend\Feed\Reader\Reader::import('http://rss.example.com/channelName'); -``` - -> ## Importing requires an HTTP client -> -> To import a feed, you will need to have an [HTTP client](zend.feed.http-clients) -> available. -> -> If you are not using zend-http, you will need to inject `Reader` with the HTTP -> client. See the [section on providing a client to Reader](http-clients.md#providing-a-client-to-reader). - -If any errors occur fetching the feed, a -`Zend\Feed\Reader\Exception\RuntimeException` will be thrown. - -## Get properties - -Once you have a feed object, you can access any of the standard RSS channel -properties via the various instance getter methods: - -```php -echo $channel->getTitle(); -echo $channel->getAuthor(); -// etc. -``` - -If channel properties have attributes, the getter method will return a key/value -pair, where the key is the attribute name, and the value is the attribute value. - -```php -$author = $channel->getAuthor(); -echo $author['name']; -``` - -Most commonly, you'll want to loop through the feed and do something with its -entries. `Zend\Feed\Reader\Feed\Rss` internally converts all entries to a -`Zend\Feed\Reader\Entry\Rss` instance. Entry properties, similarly to channel -properties, can be accessed via getter methods, such as `getTitle`, -`getDescription`, etc. - -An example of printing all titles of articles in a channel is: - -```php -foreach ($channel as $item) { - echo $item->getTitle() . "\n"; -} -``` - -If you are not familiar with RSS, here are the standard elements you can expect -to be available in an RSS channel and in individual RSS items (entries). - -Required channel elements: - -- `title`: The name of the channel. -- `link`: The URL of the web site corresponding to the channel. -- `description`: A sentence (or more) describing the channel. - -Common optional channel elements: - -- `pubDate`: The publication date of this set of content, in RFC 822 date - format. -- `language`: The language the channel is written in. -- `category`: One or more (specified by multiple tags) categories the channel - belongs to. - -RSS `` elements do not have any strictly required elements. However, -either `title` or `description` must be present. - -Common item elements: - -- `title`: The title of the item. -- `link`: The URL of the item. -- `description`: A synopsis of the item. -- `author`: The author's email address. -- `category`: One more categories that the item belongs to. -- `comments`: URL of comments relating to this item. -- `pubDate`: The date the item was published, in RFC 822 date format. - -In your code you can always test to see if an element is non-empty by calling -the getter: - -```php -if ($item->getPropname()) { - // ... proceed. -} -``` - -Where relevant, `Zend\Feed` supports a number of common RSS extensions including -Dublin Core, Atom (inside RSS); the Content, Slash, Syndication, -Syndication/Thread extensions; as well as several others. - -Please see the official [RSS 2.0 specification](http://cyber.law.harvard.edu/rss/rss.html) -for further information. diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/find-feeds.md --- a/vendor/zendframework/zend-feed/doc/book/find-feeds.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -# Feed Discovery from Web Pages - -Web pages often contain `` tags that refer to feeds with content relevant -to the particular page. `Zend\Feed\Reader\Reader` enables you to retrieve all -feeds referenced by a web page with one method call: - -```php -$feedLinks = Zend\Feed\Reader\Reader::findFeedLinks('http://www.example.com/news.html'); -``` - -> ## Finding feed links requires an HTTP client -> -> To find feed links, you will need to have an [HTTP client](zend.feed.http-clients) -> available. -> -> If you are not using zend-http, you will need to inject `Reader` with the HTTP -> client. See the [section on providing a client to Reader](http-clients.md#providing-a-client-to-reader). - -Here the `findFeedLinks()` method returns a `Zend\Feed\Reader\FeedSet` object, -which is in turn a collection of other `Zend\Feed\Reader\FeedSet` objects, each -referenced by `` tags on the `news.html` web page. -`Zend\Feed\Reader\Reader` will throw a -`Zend\Feed\Reader\Exception\RuntimeException` upon failure, such as an HTTP -404 response code or a malformed feed. - -You can examine all feed links located by iterating across the collection: - -```php -$rssFeed = null; -$feedLinks = Zend\Feed\Reader\Reader::findFeedLinks('http://www.example.com/news.html'); -foreach ($feedLinks as $link) { - if (stripos($link['type'], 'application/rss+xml') !== false) { - $rssFeed = $link['href']; - break; -} -``` - -Each `Zend\Feed\Reader\FeedSet` object will expose the `rel`, `href`, `type`, -and `title` properties of detected links for all RSS, Atom, or RDF feeds. You -can always select the first encountered link of each type by using a shortcut: -the first encountered link of a given type is assigned to a property named after -the feed type. - -```php -$rssFeed = null; -$feedLinks = Zend\Feed\Reader\Reader::findFeedLinks('http://www.example.com/news.html'); -$firstAtomFeed = $feedLinks->atom; -``` diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/http-clients.md --- a/vendor/zendframework/zend-feed/doc/book/http-clients.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -# HTTP Clients and zend-feed - -Several operations in zend-feed's Reader subcomponent require an HTTP client: - -- importing a feed -- finding links in a feed - -In order to allow developers a choice in HTTP clients, the subcomponent defines -several interfaces and classes. Elsewhere in the documentation, we reference -where an HTTP client may be used; this document details what constitutes an HTTP -client and its behavior, and some of the concrete classes available within the -component for implementing this behavior. - -## ClientInterface and HeaderAwareClientInterface - -First, we define two interfaces for clients, -`Zend\Feed\Reader\Http\ClientInterface` and `HeaderAwareClientInterface`: - -```php -namespace Zend\Feed\Reader\Http; - -interface ClientInterface -{ - /** - * Make a GET request to a given URL. - * - * @param string $url - * @return ResponseInterface - */ - public function get($url); -} - -interface HeaderAwareClientInterface extends ClientInterface -{ - /** - * Make a GET request to a given URL. - * - * @param string $url - * @param array $headers - * @return ResponseInterface - */ - public function get($url, array $headers = []); -} -``` - -The first is header-agnostic, and assumes that the client will simply perform an -HTTP GET request. The second allows providing headers to the client; typically, -these are used for HTTP caching headers. `$headers` must be in the following -structure: - -```php -$headers = [ - 'X-Header-Name' => [ - 'header', - 'values', - ], -]; -``` - -i.e., each key is a header name, and each value is an array of values for that -header. If the header represents only a single value, it should be an array with -that value: - -```php -$headers = [ - 'Accept' => [ 'application/rss+xml' ], -]; -``` - -A call to `get()` should yield a *response*. - -## ResponseInterface and HeaderAwareResponseInterface - -Responses are modeled using `Zend\Feed\Reader\Http\ResponseInterface` and -`HeaderAwareResponseInterface`: - -```php -namespace Zend\Feed\Reader\Http; - -class ResponseInterface -{ - /** - * Retrieve the status code. - * - * @return int - */ - public function getStatusCode(); - - /** - * Retrieve the response body contents. - * - * @return string - */ - public function getBody(); -} - -class HeaderAwareResponseInterface extends ResponseInterface -{ - /** - * Retrieve a named header line. - * - * Retrieve a header by name; all values MUST be concatenated to a single - * line. If no matching header is found, return the $default value. - * - * @param string $name - * @param null|string $default - * @return string - public function getHeaderLine($name, $default = null); -} -``` - -Internally, `Reader` will typehint against `ClientInterface` for the bulk of -operations. In some cases, however, certain capabilities are only possible if -the response can provide headers (e.g., for caching); in such cases, it will -check the instance against `HeaderAwareResponseInterface`, and only call -`getHeaderLine()` if it matches. - -## Response - -zend-feed ships with a generic `ResponseInterface` implementation, -`Zend\Feed\Http\Response`. It implements `HeaderAwareResponseInterface`, and -defines the following constructor: - -```php -namespace Zend\Feed\Reader\Http; - -class Response implements HeaderAwareResponseInterface -{ - /** - * Constructor - * - * @param int $statusCode Response status code - * @param string $body Response body - * @param array $headers Response headers, if available - */ - public function __construct($statusCode, $body, array $headers = []); -} -``` - -## PSR-7 Response - -[PSR-7](http://www.php-fig.org/psr/psr-7/) defines a set of HTTP message -interfaces, but not a client interface. To facilitate wrapping an HTTP client -that uses PSR-7 messages, we provide `Zend\Feed\Reader\Psr7ResponseDecorator`: - -```php -namespace Zend\Feed\Reader\Http; - -use Psr\Http\Message\ResponseInterface as PsrResponseInterface; - -class Psr7ResponseDecorator implements HeaderAwareResponseInterface -{ - /** - * @param PsrResponseInterface $response - */ - public function __construct(PsrResponseInterface $response); - - /** - * @return PsrResponseInterface - */ - public function getDecoratedResponse(); -} -``` - -Clients can then take the PSR-7 response they receive, pass it to the decorator, -and return the decorator. - -To use the PSR-7 response, you will need to add the PSR-7 interfaces to your -application, if they are not already installed by the client of your choice: - -```bash -$ composer require psr/http-message -``` - -## zend-http - -We also provide a zend-http client decorator, -`Zend\Feed\Reader\Http\ZendHttpClientDecorator`: - -```php -namespace Zend\Feed\Reader\Http; - -use Zend\Http\Client as HttpClient; - -class ZendHttpClientDecorator implements HeaderAwareClientInterface -{ - /** - * @param HttpClient $client - */ - public function __construct(HttpClient $client); - - /** - * @return HttpClient - */ - public function getDecoratedClient(); -} -``` - -Its `get()` implementation returns a `Response` instance seeded from the -zend-http response returned, including status, body, and headers. - -zend-http is the default implementation assumed by `Zend\Feed\Reader\Reader`, -but *is not installed by default*. You may install it using composer: - -```bash -$ composer require zendframework/zend-http -``` - -## Providing a client to Reader - -By default, `Zend\Feed\Reader\Reader` will lazy load a zend-http client. If you -have not installed zend-http, however, PHP will raise an error indicating the -class is not found! - -As such, you have two options: - -1. Install zend-http: `composer require zendframework/zend-http`. -2. Inject the `Reader` with your own HTTP client. - -To accomplish the second, you will need an implementation of -`Zend\Feed\Reader\Http\ClientInterface` or `HeaderAwareClientInterface`, and an -instance of that implementation. Once you do, you can use the static method -`setHttpClient()` to inject it. - -As an example, let's say you've created a PSR-7-based implementation named -`My\Http\Psr7FeedClient`. You could then do the following: - -```php -use My\Http\Psr7FeedClient; -use Zend\Feed\Reader\Reader; - -Reader::setHttpClient(new Psr7FeedClient()); -``` - -Your client will then be used for all `import()` and `findFeedLinks()` -operations. diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/importing.md --- a/vendor/zendframework/zend-feed/doc/book/importing.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -# Importing Feeds - -`Zend\Feed` enables developers to retrieve feeds via `Zend\Feader\Reader`. If -you know the URI of a feed, use the `Zend\Feed\Reader\Reader::import()` method -to consume it: - -```php -$feed = Zend\Feed\Reader\Reader::import('http://feeds.example.com/feedName'); -``` - -> ## Importing requires an HTTP client -> -> To import a feed, you will need to have an [HTTP client](zend.feed.http-clients) -> available. -> -> If you are not using zend-http, you will need to inject `Reader` with the HTTP -> client. See the [section on providing a client to Reader](http-clients.md#providing-a-client-to-reader). - -You can also use `Zend\Feed\Reader\Reader` to fetch the contents of a feed from -a file or the contents of a PHP string variable: - -```php -// importing a feed from a text file -$feedFromFile = Zend\Feed\Reader\Reader::importFile('feed.xml'); - -// importing a feed from a PHP string variable -$feedFromPHP = Zend\Feed\Reader\Reader::importString($feedString); -``` - -In each of the examples above, an object of a class that extends -`Zend\Feed\Reader\Feed\AbstractFeed` is returned upon success, depending on the -type of the feed. If an RSS feed were retrieved via one of the import methods -above, then a `Zend\Feed\Reader\Feed\Rss` object would be returned. On the other -hand, if an Atom feed were imported, then a `Zend\Feed\Reader\Feed\Atom` object -is returned. The import methods will also throw a -`Zend\Feed\Exception\Reader\RuntimeException` object upon failure, such as an -unreadable or malformed feed. - -## Dumping the contents of a feed - -To dump the contents of a `Zend\Feed\Reader\Feed\AbstractFeed` instance, you may -use the `saveXml()` method. - -```php -assert($feed instanceof Zend\Feed\Reader\Feed\AbstractFeed); - -// dump the feed to standard output -print $feed->saveXml(); -``` diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/index.html --- a/vendor/zendframework/zend-feed/doc/book/index.html Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -
    -
    -

    zend-feed

    - -

    Consume and generate Atom and RSS feeds, and interact with Pubsubhubbub.

    - -
    $ composer require zendframework/zend-feed
    -
    -
    - diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/index.md --- a/vendor/zendframework/zend-feed/doc/book/index.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../README.md \ No newline at end of file diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/intro.md --- a/vendor/zendframework/zend-feed/doc/book/intro.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -# Introduction - -`Zend\Feed` provides functionality for consuming RSS and Atom feeds. It provides -a natural syntax for accessing elements of feeds, feed attributes, and entry -attributes. `Zend\Feed` also has extensive support for modifying feed and entry -structure with the same natural syntax, and turning the result back into XML. -In the future, this modification support could provide support for the Atom -Publishing Protocol. - -`Zend\Feed` consists of `Zend\Feed\Reader` for reading RSS and Atom feeds, -`Zend\Feed\Writer` for writing RSS and Atom feeds, and `Zend\Feed\PubSubHubbub` -for working with Hub servers. Furthermore, both `Zend\Feed\Reader` and -`Zend\Feed\Writer` support extensions which allows for working with additional -data in feeds, not covered in the core API but used in conjunction with RSS and -Atom feeds. - -In the example below, we demonstrate a simple use case of retrieving an RSS feed -and saving relevant portions of the feed data to a simple PHP array, which could -then be used for printing the data, storing to a database, etc. - -> ## RSS optional properties -> -> Many *RSS* feeds have different channel and item properties available. The -> *RSS* specification provides for many optional properties, so be aware of this -> when writing code to work with *RSS* data. `Zend\Feed` supports all optional -> properties of the core *RSS* and *Atom* specifications. - -## Reading RSS Feed Data - -```php -// Fetch the latest Slashdot headlines -try { - $slashdotRss = - Zend\Feed\Reader\Reader::import('http://rss.slashdot.org/Slashdot/slashdot'); -} catch (Zend\Feed\Reader\Exception\RuntimeException $e) { - // feed import failed - echo "Exception caught importing feed: {$e->getMessage()}\n"; - exit; -} - -// Initialize the channel/feed data array -$channel = [ - 'title' => $slashdotRss->getTitle(), - 'link' => $slashdotRss->getLink(), - 'description' => $slashdotRss->getDescription(), - 'items' => [], -]; - -// Loop over each channel item/entry and store relevant data for each -foreach ($slashdotRss as $item) { - $channel['items'][] = [ - 'title' => $item->getTitle(), - 'link' => $item->getLink(), - 'description' => $item->getDescription(), - ]; -} -``` - -Your `$channel` array now contains the basic meta-information for the RSS -channel and all items that it contained. The process is identical for Atom -feeds since `Zend\Feed` provides a common feed API; i.e. all getters and -setters are the same regardless of feed format. diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/pubsubhubbub.md --- a/vendor/zendframework/zend-feed/doc/book/pubsubhubbub.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,452 +0,0 @@ -# Zend\\Feed\\PubSubHubbub - -`Zend\Feed\PubSubHubbub` is an implementation of the [PubSubHubbub Core 0.2/0.3 -Specification (Working Draft)](http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html). -It offers implementations of a Pubsubhubbub Publisher and Subscriber suited to -PHP applications. - -## What is PubSubHubbub? - -Pubsubhubbub is an open, simple, web-scale, pubsub protocol. A common use case -to enable blogs (Publishers) to "push" updates from their RSS or Atom feeds -(Topics) to end Subscribers. These Subscribers will have subscribed to the -blog's RSS or Atom feed via a Hub, a central server which is notified of any -updates by the Publisher, and which then distributes these updates to all -Subscribers. Any feed may advertise that it supports one or more Hubs using an -Atom namespaced link element with a rel attribute of "hub" (i.e., `rel="hub"`). - -Pubsubhubbub has garnered attention because it is a pubsub protocol which is -easy to implement and which operates over HTTP. Its philosophy is to replace the -traditional model where blog feeds have been polled at regular intervals to -detect and retrieve updates. Depending on the frequency of polling, this can -take a lot of time to propagate updates to interested parties from planet -aggregators to desktop readers. With a pubsub system in place, updates are not -simply polled by Subscribers, they are pushed to Subscribers, eliminating any -delay. For this reason, Pubsubhubbub forms part of what has been dubbed the -real-time web. - -The protocol does not exist in isolation. Pubsub systems have been around for a -while, such as the familiar Jabber Publish-Subscribe protocol, -[XEP-0060](http://www.xmpp.org/extensions/xep-0060.html), or the less well-known -[rssCloud](http://www.rssboard.org/rsscloud-interface) (described in 2001). -However, these have not achieved widespread adoption due to either their -complexity, poor timing, or lack of suitability for web applications. rssCloud, -which was recently revived as a response to the appearance of Pubsubhubbub, has -also seen its usage increase significantly, though it lacks a formal -specification and currently does not support Atom 1.0 feeds. - -Perhaps surprisingly given its relative early age, Pubsubhubbub is already in -use including in Google Reader and Feedburner, and there are plugins available -for Wordpress blogs. - -## Architecture - -`Zend\Feed\PubSubHubbub` implements two sides of the Pubsubhubbub 0.2/0.3 -Specification: a Publisher and a Subscriber. It does not currently implement a -Hub Server. - -A Publisher is responsible for notifying all supported Hubs (many can be -supported to add redundancy to the system) of any updates to its feeds, whether -they be Atom or RSS based. This is achieved by pinging the supported Hub Servers -with the URL of the updated feed. In Pubsubhubbub terminology, any updatable -resource capable of being subscribed to is referred to as a Topic. Once a ping -is received, the Hub will request the updated feed, process it for updated -items, and forward all updates to all Subscribers subscribed to that feed. - -A Subscriber is any party or application which subscribes to one or more Hubs to -receive updates from a Topic hosted by a Publisher. The Subscriber never -directly communicates with the Publisher since the Hub acts as an intermediary, -accepting subscriptions and sending updates to Subscribers. The Subscriber -therefore communicates only with the Hub, either to subscribe or unsubscribe to -Topics, or when it receives updates from the Hub. This communication design -("Fat Pings") effectively removes the possibility of a "Thundering Herd" issue. -(Thundering Herds occur in a pubsub system where the Hub merely informs -Subscribers that an update is available, prompting all Subscribers to -immediately retrieve the feed from the Publisher, giving rise to a traffic -spike.) In Pubsubhubbub, the Hub distributes the actual update in a "Fat Ping" -so the Publisher is not subjected to any traffic spike. - -`Zend\Feed\PubSubHubbub` implements Pubsubhubbub Publishers and Subscribers with -the classes `Zend\Feed\PubSubHubbub\Publisher` and -`Zend\Feed\PubSubHubbub\Subscriber`. In addition, the Subscriber implementation -may handle any feed updates forwarded from a Hub by using -`Zend\Feed\PubSubHubbub\Subscriber\Callback`. These classes, their use cases, -and etheir APIs are covered in subsequent sections. - -## Zend\\Feed\\PubSubHubbub\\Publisher - -In Pubsubhubbub, the Publisher is the party publishing a live feed with content -updates. This may be a blog, an aggregator, or even a web service with a public -feed based API. In order for these updates to be pushed to Subscribers, the -Publisher must notify all of its supported Hubs that an update has occurred -using a simple HTTP POST request containing the URI of the updated Topic (i.e., -the updated RSS or Atom feed). The Hub will confirm receipt of the notification, -fetch the updated feed, and forward any updates to any Subscribers who have -subscribed to that Hub for updates from the relevant feed. - -By design, this means the Publisher has very little to do except send these Hub -pings whenever its feeds change. As a result, the Publisher implementation is -extremely simple to use and requires very little work to setup and use when -feeds are updated. - -`Zend\Feed\PubSubHubbub\Publisher` implements a full Pubsubhubbub Publisher. Its -setup for use primarily requires that it is configured with the URI endpoint for -all Hubs to be notified of updates, and the URIs of all Topics to be included in -the notifications. - -The following example shows a Publisher notifying a collection of Hubs about -updates to a pair of local RSS and Atom feeds. The class retains a collection of -errors which include the Hub URLs, so that notification can be attempted again -later and/or logged if any notifications happen to fail. Each resulting error -array also includes a "response" key containing the related HTTP response -object. In the event of any errors, it is strongly recommended to attempt the -operation for failed Hub Endpoints at least once more at a future time. This may -require the use of either a scheduled task for this purpose or a job queue, -though such extra steps are optional. - -```php -use Zend\Feed\PubSubHubbub\Publisher; - -$publisher = Publisher; -$publisher->addHubUrls([ - 'http://pubsubhubbub.appspot.com/', - 'http://hubbub.example.com', -]); -$publisher->addUpdatedTopicUrls([ - 'http://www.example.net/rss', - 'http://www.example.net/atom', -]); -$publisher->notifyAll(); - -if (! $publisher->isSuccess()) { - // check for errors - $errors = $publisher->getErrors(); - $failedHubs = []; - foreach ($errors as $error) { - $failedHubs[] = $error['hubUrl']; - } -} - -// reschedule notifications for the failed Hubs in $failedHubs -``` - -If you prefer having more concrete control over the Publisher, the methods -`addHubUrls()` and `addUpdatedTopicUrls()` pass each array value to the singular -`addHubUrl()` and `addUpdatedTopicUrl()` public methods. There are also matching -`removeUpdatedTopicUrl()` and `removeHubUrl()` methods. - -You can also skip setting Hub URIs, and notify each in turn using the -`notifyHub()` method which accepts the URI of a Hub endpoint as its only -argument. - -There are no other tasks to cover. The Publisher implementation is very simple -since most of the feed processing and distribution is handled by the selected -Hubs. It is, however, important to detect errors and reschedule notifications as -soon as possible (with a reasonable maximum number of retries) to ensure -notifications reach all Subscribers. In many cases, as a final alternative, Hubs -may frequently poll your feeds to offer some additional tolerance for failures -both in terms of their own temporary downtime or Publisher errors or downtime. - -## Zend\\Feed\\PubSubHubbub\\Subscriber - -In Pubsubhubbub, the Subscriber is the party who wishes to receive updates to -any Topic (RSS or Atom feed). They achieve this by subscribing to one or more of -the Hubs advertised by that Topic, usually as a set of one or more Atom 1.0 -links with a rel attribute of "hub" (i.e., `rel="hub"`). The Hub from that point -forward will send an Atom or RSS feed containing all updates to that -Subscriber's callback URL when it receives an update notification from the -Publisher. In this way, the Subscriber need never actually visit the original -feed (though it's still recommended at some level to ensure updates are -retrieved if ever a Hub goes offline). All subscription requests must contain -the URI of the Topic being subscribed and a callback URL which the Hub will use -to confirm the subscription and to forward updates. - -The Subscriber therefore has two roles. The first is to *create* and *manage* -subscriptions, including subscribing for new Topics with a Hub, unsubscribing -(if necessary), and periodically renewing subscriptions, since they may have an -expiry set by the Hub. This is handled by `Zend\Feed\PubSubHubbub\Subscriber`. - -The second role is to *accept updates* sent by a Hub to the Subscriber's -callback URL, i.e. the URI the Subscriber has assigned to handle updates. The -callback URL also handles events where the Hub contacts the Subscriber to -confirm all subscriptions and unsubscriptions. This is handled by using an -instance of `Zend\Feed\PubSubHubbub\Subscriber\Callback` when the callback URL -is accessed. - -> ### Query strings in callback URLs -> -> `Zend\Feed\PubSubHubbub\Subscriber` implements the Pubsubhubbub 0.2/0.3 -> specification. As this is a new specification version, not all Hubs currently -> implement it. The new specification allows the callback URL to include a query -> string which is used by this class, but not supported by all Hubs. In the -> interests of maximising compatibility, it is therefore recommended that the -> query string component of the Subscriber callback URI be presented as a path -> element, i.e. recognised as a parameter in the route associated with the -> callback URI and used by the application's router. - -### Subscribing and Unsubscribing - -`Zend\Feed\PubSubHubbub\Subscriber` implements a full Pubsubhubbub Subscriber -capable of subscribing to, or unsubscribing from, any Topic via any Hub -advertised by that Topic. It operates in conjunction with -`Zend\Feed\PubSubHubbub\Subscriber\Callback`, which accepts requests from a Hub -to confirm all subscription or unsubscription attempts (to prevent third-party -misuse). - -Any subscription (or unsubscription) requires the relevant information before -proceeding, i.e. the URI of the Topic (Atom or RSS feed) to be subscribed to for -updates, and the URI of the endpoint for the Hub which will handle the -subscription and forwarding of the updates. The lifetime of a subscription may -be determined by the Hub, but most Hubs should support automatic subscription -refreshes by checking with the Subscriber. This is supported by -`Zend\Feed\PubSubHubbub\Subscriber\Callback` and requires no other work on your -part. It is still strongly recommended that you use the Hub-sourced subscription -time-to.live (ttl) to schedule the creation of new subscriptions (the process is -identical to that for any new subscription) to refresh it with the Hub. While it -should not be necessary per se, it covers cases where a Hub may not support -automatic subscription refreshing, and rules out Hub errors for additional -redundancy. - -With the relevant information to hand, a subscription can be attempted as -demonstrated below: - -```php -use Zend\Feed\PubSubHubbub\Model\Subscription; -use Zend\Feed\PubSubHubbub\Subscriber; - -$storage = new Subscription; -$subscriber = new Subscriber; -$subscriber->setStorage($storage); -$subscriber->addHubUrl('http://hubbub.example.com'); -$subscriber->setTopicUrl('http://www.example.net/rss.xml'); -$subscriber->setCallbackUrl('http://www.mydomain.com/hubbub/callback'); -$subscriber->subscribeAll(); -``` - -In order to store subscriptions and offer access to this data for general use, -the component requires a database (a schema is provided later in this section). -By default, it is assumed the table name is "subscription", and it utilises -`Zend\Db\TableGateway\TableGateway` in the background, meaning it will use the -default adapter you have set for your application. You may also pass a specific -custom `Zend\Db\TableGateway\TableGateway` instance into the associated model -`Zend\Feed\PubSubHubbub\Model\Subscription`. This custom adapter may be as -simple in intent as changing the table name to use or as complex as you deem -necessary. - -While this model is offered as a default ready-to-roll solution, you may create -your own model using any other backend or database layer (e.g. Doctrine) so long -as the resulting class implements the interface -`Zend\Feed\PubSubHubbub\Model\SubscriptionInterface`. - -An example schema (MySQL) for a subscription table accessible by the provided -model may look similar to: - -```sql -CREATE TABLE IF NOT EXISTS `subscription` ( - `id` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `topic_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `hub_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `created_time` datetime DEFAULT NULL, - `lease_seconds` bigint(20) DEFAULT NULL, - `verify_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `secret` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `expiration_time` datetime DEFAULT NULL, - `subscription_state` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -``` - -Behind the scenes, the Subscriber above will send a request to the Hub endpoint -containing the following parameters (based on the previous example): - -Parameter | Value | Explanation ---------- | ----- | ----------- -`hub.callback` | `http://www.mydomain.com/hubbub/callback?xhub.subscription=5536df06b5dcb966edab3a4c4d56213c16a8184` | The URI used by a Hub to contact the Subscriber and either request confirmation of a (un)subscription request, or send updates from subscribed feeds. The appended query string contains a custom parameter (hence the xhub designation). It is a query string parameter preserved by the Hub and re-sent with all Subscriber requests. Its purpose is to allow the Subscriber to identify and look up the subscription associated with any Hub request in a backend storage medium. This is a non-standard parameter used by this component in preference to encoding a subscription key in the URI path, which is difficult to enforce generically. Nevertheless, since not all Hubs support query string parameters, we still strongly recommend adding the subscription key as a path component in the form `http://www.mydomain.com/hubbub/callback/5536df06b5dcb966edab3a4c4d56213c16a8184`. This requires defining a route capable of parsing out the final value of the key, retrieving the value, and passing it to the Subscriber callback object. The value should be passed into the method `Zend\PubSubHubbub\Subscriber\Callback::setSubscriptionKey()`. A detailed example is offered later. -`hub.lease_seconds` | `2592000` | The number of seconds for which the Subscriber would like a new subscription to remain valid (i.e. a TTL). Hubs may enforce their own maximum subscription period. All subscriptions should be renewed by re-subscribing before the subscription period ends to ensure continuity of updates. Hubs should additionally attempt to automatically refresh subscriptions before they expire by contacting Subscribers (handled automatically by the `Callback` class). -`hub.mode` | `subscribe` | Value indicating this is a subscription request. Unsubscription requests would use the "unsubscribe" value. -`hub.topic` | `http://www.example.net/rss.xml` | The URI of the Topic (i.e. Atom or RSS feed) which the Subscriber wishes to subscribe to for updates. -`hub.verify` | `sync` or `async` | Indicates to the Hub the preferred mode of verifying subscriptions or unsubscriptions. It is repeated twice in order of preference. Technically this component does not distinguish between the two modes and treats both equally. -`hub.verify_token` | `3065919804abcaa7212ae89.879827871253878386` | A verification token returned to the Subscriber by the Hub when it is confirming a subscription or unsubscription. Offers a measure of reliance that the confirmation request originates from the correct Hub to prevent misuse. - -You can modify several of these parameters to indicate a different preference. -For example, you can set a different lease seconds value using -`Zend\Feed\PubSubHubbub\Subscriber::setLeaseSeconds(),` or show a preference for -the `async` verify mode by using `setPreferredVerificationMode(Zend\Feed\PubSubHubbub\PubSubHubbub::VERIFICATION_MODE_ASYNC)`. -However, the Hubs retain the capability to enforce their own preferences, and -for this reason the component is deliberately designed to work across almost any -set of options with minimum end-user configuration required. Conventions are -great when they work! - -> ### Verification modes -> -> While Hubs may require the use of a specific verification mode (both are -> supported by `Zend\Feed\PubSubHubbub`), you may indicate a specific preference -> using the `setPreferredVerificationMode()` method. In `sync` (synchronous) -> mode, the Hub attempts to confirm a subscription as soon as it is received, -> and before responding to the subscription request. In `async` (asynchronous) -> mode, the Hub will return a response to the subscription request immediately, -> and its verification request may occur at a later time. Since -> `Zend\Feed\PubSubHubbub` implements the Subscriber verification role as a -> separate callback class and requires the use of a backend storage medium, it -> actually supports both transparently. In terms of end-user performance, -> asynchronous verification is very much preferred to eliminate the impact of a -> poorly performing Hub tying up end-user server resources and connections for -> too long. - -Unsubscribing from a Topic follows the exact same pattern as the previous -example, with the exception that we should call `unsubscribeAll()` instead. The -parameters included are identical to a subscription request with the exception -that `hub.mode` is set to "unsubscribe". - -By default, a new instance of `Zend\PubSubHubbub\Subscriber` will attempt to use -a database backed storage medium which defaults to using the default zend-db -adapter with a table name of "subscription". It is recommended to set a custom -storage solution where these defaults are not apt either by passing in a new -model supporting the required interface or by passing a new instance of -`Zend\Db\TableGateway\TableGateway` to the default model's constructor to change -the used table name. - -### Handling Subscriber Callbacks - -Whenever a subscription or unsubscription request is made, the Hub must verify -the request by forwarding a new verification request to the callback URL set in -the subscription or unsubscription parameters. To handle these Hub requests, -which will include all future communications containing Topic (feed) updates, -the callback URL should trigger the execution of an instance of -`Zend\Feed\PubSubHubbub\Subscriber\Callback` to handle the request. - -The `Callback` class should be configured to use the same storage medium as the -`Subscriber` class. The bulk of the work is handled internal to these classes. - -```php -use Zend\Feed\PubSubHubbub\Model\Subscription; -use Zend\Feed\PubSubHubbub\Subscriber\Callback; - -$storage = new Subscription(); -$callback = new Callback(); -$callback->setStorage($storage); -$callback->handle(); -$callback->sendResponse(); - -/* - * Check if the callback resulting in the receipt of a feed update. - * Otherwise it was either a (un)sub verification request or invalid request. - * Typically we need do nothing other than add feed update handling; the rest - * is handled internally by the class. - */ -if ($callback->hasFeedUpdate()) { - $feedString = $callback->getFeedUpdate(); - /* - * Process the feed update asynchronously to avoid a Hub timeout. - */ -} -``` - -> #### Query and body parameters -> -> It should be noted that `Zend\Feed\PubSubHubbub\Subscriber\Callback` may -> independently parse any incoming query string and other parameters. This is -> necessary since PHP alters the structure and keys of a query string when it is -> parsed into the `$_GET` or `$_POST` superglobals; for example, all duplicate -> keys are ignored and periods are converted to underscores. Pubsubhubbub -> features both of these in the query strings it generates. - -> #### Always delay feed processing -> -> It is essential that developers recognise that Hubs are only concerned with -> sending requests and receiving a response which verifies its receipt. If a -> feed update is received, it should never be processed on the spot since this -> leaves the Hub waiting for a response. Rather, any processing should be -> offloaded to another process or deferred until after a response has been -> returned to the Hub. One symptom of a failure to promptly complete Hub -> requests is that a Hub may continue to attempt delivery of the update or -> verification request leading to duplicated update attempts being processed by -> the Subscriber. This appears problematic, but in reality a Hub may apply a -> timeout of just a few seconds, and if no response is received within that time -> it may disconnect (assuming a delivery failure) and retry later. Note that -> Hubs are expected to distribute vast volumes of updates so their resources are -> stretched; please process feeds asynchronously (e.g. in a separate process or -> a job queue or even a cronjob) as much as possible. - -### Setting Up And Using A Callback URL Route - -As noted earlier, the `Zend\Feed\PubSubHubbub\Subscriber\Callback` class -receives the combined key associated with any subscription from the Hub via one -of two methods. The technically preferred method is to add this key to the -callback URL employed by the Hub in all future requests using a query string -parameter with the key `xhub.subscription`. However, for historical reasons -(primarily that this was not supported in Pubsubhubbub 0.1, and a late addition -to 0.2 ), it is strongly recommended to use the most compatible means of adding -this key to the callback URL by appending it to the URL's path. - -Thus the URL `http://www.example.com/callback?xhub.subscription=key` would become -`http://www.example.com/callback/key`. - -Since the query string method is the default in anticipation of a greater level -of future support for the full 0.2/0.3 specification, this requires some -additional work to implement. - -The first step is to make the `Zend\Feed\PubSubHubbub\Subscriber\Callback` class -aware of the path contained subscription key. It's manually injected; therefore -it also requires manually defining a route for this purpose. This is achieved by -called the method `Zend\Feed\PubSubHubbub\Subscriber\Callback::setSubscriptionKey()` -with the parameter being the key value available from the router. The example -below demonstrates this using a zend-mvc controller. - -```php -use Zend\Feed\PubSubHubbub\Model\Subscription; -use Zend\Feed\PubSubHubbub\Subscriber\Callback; -use Zend\Mvc\Controller\AbstractActionController; - -class CallbackController extends AbstractActionController -{ - - public function indexAction() - { - $storage = new Subscription(); - $callback = new Callback(); - $callback->setStorage($storage); - - /* - * Inject subscription key parsing from URL path using - * a parameter from the router. - */ - $subscriptionKey = $this->params()->fromRoute('subkey'); - $callback->setSubscriptionKey($subscriptionKey); - $callback->handle(); - $callback->sendResponse(); - - /* - * Check if the callback resulting in the receipt of a feed update. - * Otherwise it was either a (un)sub verification request or invalid - * request. Typically we need do nothing other than add feed update - * handling; the rest is handled internally by the class. - */ - if ($callback->hasFeedUpdate()) { - $feedString = $callback->getFeedUpdate(); - /* - * Process the feed update asynchronously to avoid a Hub timeout. - */ - } - } -} -``` - -The example below illustrates adding a route mapping the path segment to a route -parameter, using zend-mvc: - -```php -use Zend\Mvc\Router\Http\Segment as SegmentRoute;; - -// Route defininition for enabling appending of a PuSH Subscription's lookup key -$route = SegmentRoute::factory([ - 'route' => '/callback/:subkey', - 'constraints' => [ - 'subkey' => '[a-z0-9]+', - ], - 'defaults' => [ - 'controller' => 'application-index', - 'action' => 'index', - ] -]); -``` diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/reader.md --- a/vendor/zendframework/zend-feed/doc/book/reader.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,825 +0,0 @@ -# Zend\\Feed\\Reader - -`Zend\Feed\Reader` is a component used to consume RSS and Atom feeds of -any version, including RDF/RSS 1.0, RSS 2.0, Atom 0.3, and Atom 1.0. The API for -retrieving feed data is deliberately simple since `Zend\Feed\Reader` is capable -of searching any feed of any type for the information requested through the API. -If the typical elements containing this information are not present, it will -adapt and fall back on a variety of alternative elements instead. This ability -to choose from alternatives removes the need for users to create their own -abstraction layer on top of the component to make it useful or have any in-depth -knowledge of the underlying standards, current alternatives, and namespaced -extensions. - -Internally, the `Zend\Feed\Reader\Reader` class works almost entirely on the -basis of making XPath queries against the feed XML's Document Object Model. This -singular approach to parsing is consistent, and the component offers a plugin -system to add to the Feed and Entry APIs by writing extensions on a similar -basis. - -Performance is assisted in three ways. First of all, `Zend\Feed\Reader\Reader` -supports caching using [zend-cache](https://github.com/zendframework/zend-cache) -to maintain a copy of the original feed XML. This allows you to skip network -requests for a feed URI if the cache is valid. Second, the Feed and Entry APIs -are backed by an internal cache (non-persistent) so repeat API calls for the -same feed will avoid additional DOM or XPath use. Thirdly, importing feeds from -a URI can take advantage of HTTP Conditional `GET` requests which allow servers -to issue an empty 304 response when the requested feed has not changed since the -last time you requested it. In the final case, an zend-cache storage instance -will hold the last received feed along with the ETag and Last-Modified header -values sent in the HTTP response. - -`Zend\Feed\Reader\Reader` is not capable of constructing feeds, and delegates -this responsibility to `Zend\Feed\Writer\Writer`. - -## Importing Feeds - -Feeds can be imported from a string, file or a URI. Importing from a URI can -additionally utilise an HTTP Conditional `GET` request. If importing fails, an -exception will be raised. The end result will be an object of type -`Zend\Feed\Reader\Feed\AbstractFeed`, the core implementations of which are -`Zend\Feed\Reader\Feed\Rss` and `Zend\Feed\Reader\Feed\Atom`. Both objects -support multiple (all existing) versions of these broad feed types. - -In the following example, we import an RDF/RSS 1.0 feed and extract some basic -information that can be saved to a database or elsewhere. - -```php -$feed = Zend\Feed\Reader\Reader::import('http://www.planet-php.net/rdf/'); -$data = [ - 'title' => $feed->getTitle(), - 'link' => $feed->getLink(), - 'dateModified' => $feed->getDateModified(), - 'description' => $feed->getDescription(), - 'language' => $feed->getLanguage(), - 'entries' => [], -]; - -foreach ($feed as $entry) { - $edata = [ - 'title' => $entry->getTitle(), - 'description' => $entry->getDescription(), - 'dateModified' => $entry->getDateModified(), - 'authors' => $entry->getAuthors(), - 'link' => $entry->getLink(), - 'content' => $entry->getContent(), - ]; - $data['entries'][] = $edata; -} -``` - -> ## Importing requires an HTTP client -> -> To import a feed, you will need to have an [HTTP client](zend.feed.http-clients) -> available. -> -> If you are not using zend-http, you will need to inject `Reader` with the HTTP -> client. See the [section on providing a client to Reader](http-clients.md#providing-a-client-to-reader). - -The example above demonstrates `Zend\Feed\Reader\Reader`'s API, and it also -demonstrates some of its internal operation. In reality, the RDF feed selected -does not have any native date or author elements; however it does utilise the -Dublin Core 1.1 module which offers namespaced creator and date elements. -`Zend\Feed\Reader\Reader` falls back on these and similar options if no relevant -native elements exist. If it absolutely cannot find an alternative it will -return `NULL`, indicating the information could not be found in the feed. You -should note that classes implementing `Zend\Feed\Reader\Feed\AbstractFeed` also -implement the SPL `Iterator` and `Countable` interfaces. - -Feeds can also be imported from strings or files. - -```php -// from a URI -$feed = Zend\Feed\Reader\Reader::import('http://www.planet-php.net/rdf/'); - -// from a String -$feed = Zend\Feed\Reader\Reader::importString($feedXmlString); - -// from a file -$feed = Zend\Feed\Reader\Reader::importFile('./feed.xml'); -``` - -## Retrieving Underlying Feed and Entry Sources - -`Zend\Feed\Reader\Reader` does its best not to stick you in a narrow confine. If -you need to work on a feed outside of `Zend\Feed\Reader\Reader`, you can extract -the base DOMDocument or DOMElement objects from any class, or even an XML -string containing these. Also provided are methods to extract the current -DOMXPath object (with all core and extension namespaces registered) and the -correct prefix used in all XPath queries for the current feed or entry. The -basic methods to use (on any object) are `saveXml()`, `getDomDocument()`, -`getElement()`, `getXpath()` and `getXpathPrefix()`. These will let you break -free of `Zend\Feed\Reader` and do whatever else you want. - -- `saveXml()` returns an XML string containing only the element representing the - current object. -- `getDomDocument()` returns the DOMDocument object representing the entire feed - (even if called from an entry object). -- `getElement()` returns the DOMElement of the current object (i.e. the feed or - current entry). -- `getXpath()` returns the DOMXPath object for the current feed (even if called - from an entry object) with the namespaces of the current feed type and all - loaded extensions pre-registered. -- `getXpathPrefix()` returns the query prefix for the current object (i.e. the - feed or current entry) which includes the correct XPath query path for that - specific feed or entry. - -Let's look at an example where a feed might include an RSS extension not -supported by `Zend\Feed\Reader\Reader` out of the box. Notably, you could write -and register an extension (covered later) to do this, but that's not always -warranted for a quick check. You must register any new namespaces on the -DOMXPath object before use unless they are registered by `Zend\Feed\Reader` or -an extension beforehand. - -```php -$feed = Zend\Feed\Reader\Reader::import('http://www.planet-php.net/rdf/'); -$xpathPrefix = $feed->getXpathPrefix(); -$xpath = $feed->getXpath(); -$xpath->registerNamespace('admin', 'http://webns.net/mvcb/'); -$reportErrorsTo = $xpath->evaluate( - 'string(' . $xpathPrefix . '/admin:errorReportsTo)' -); -``` - -> ### Do not register duplicate namespaces -> -> If you register an already registered namespace with a different prefix name -> to that used internally by `Zend\Feed\Reader\Reader`, it will break the -> internal operation of this component. - -## Cache Support and Intelligent Requests - -### Adding Cache Support to Zend\\Feed\\Reader\\Reader - -`Zend\Feed\Reader\Reader` supports using a -[zend-cache](https://github.com/zendframework/zend-cache) storage instance to -cache feeds (as XML) to avoid unnecessary network requests. To add a cache, -create and configure your cache instance, and then tell -`Zend\Feed\Reader\Reader` to use it. The cache key used is -"`Zend\Feed\Reader\\`" followed by the MD5 hash of the feed's URI. - -```php -$cache = Zend\Cache\StorageFactory::adapterFactory('Memory'); -Zend\Feed\Reader\Reader::setCache($cache); -``` - -### HTTP Conditional GET Support - -The big question often asked when importing a feed frequently is if it has even -changed. With a cache enabled, you can add HTTP Conditional `GET` support to -your arsenal to answer that question. - -Using this method, you can request feeds from URIs and include their last known -ETag and Last-Modified response header values with the request (using the -If-None-Match and If-Modified-Since headers). If the feed on the server remains -unchanged, you should receive a 304 response which tells -`Zend\Feed\Reader\Reader` to use the cached version. If a full feed is sent in a -response with a status code of 200, this means the feed has changed and -`Zend\Feed\Reader\Reader` will parse the new version and save it to the cache. -It will also cache the new ETag and Last-Modified header values for future use. - -> #### Conditional GET requires a HeaderAwareClientInterface -> -> Conditional GET support only works for `Zend\Feed\Reader\Http\HeaderAwareClientInterface` -> client implementations, as it requires the ability to send HTTP headers. - -These "conditional" requests are not guaranteed to be supported by the server -you request a *URI* of, but can be attempted regardless. Most common feed -sources like blogs should however have this supported. To enable conditional -requests, you will need to provide a cache to `Zend\Feed\Reader\Reader`. - -```php -$cache = Zend\Cache\StorageFactory::adapterFactory('Memory'); - -Zend\Feed\Reader\Reader::setCache($cache); -Zend\Feed\Reader\Reader::useHttpConditionalGet(); - -$feed = Zend\Feed\Reader\Reader::import('http://www.planet-php.net/rdf/'); -``` - -In the example above, with HTTP Conditional `GET` requests enabled, the response -header values for ETag and Last-Modified will be cached along with the feed. For -the the cache's lifetime, feeds will only be updated on the cache if a non-304 -response is received containing a valid RSS or Atom XML document. - -If you intend on managing request headers from outside -`Zend\Feed\Reader\Reader`, you can set the relevant If-None-Matches and -If-Modified-Since request headers via the URI import method. - -```php -$lastEtagReceived = '5e6cefe7df5a7e95c8b1ba1a2ccaff3d'; -$lastModifiedDateReceived = 'Wed, 08 Jul 2009 13:37:22 GMT'; -$feed = Zend\Feed\Reader\Reader::import( - $uri, $lastEtagReceived, $lastModifiedDateReceived -); -``` - -## Locating Feed URIs from Websites - -These days, many websites are aware that the location of their XML feeds is not -always obvious. A small RDF, RSS, or Atom graphic helps when the user is reading -the page, but what about when a machine visits trying to identify where your -feeds are located? To assist in this, websites may point to their feeds using -`` tags in the `` section of their HTML. To take advantage -of this, you can use `Zend\Feed\Reader\Reader` to locate these feeds using the -static `findFeedLinks()` method. - -This method calls any URI and searches for the location of RSS, RDF, and Atom -feeds assuming, the website's HTML contains the relevant links. It then returns -a value object where you can check for the existence of a RSS, RDF or Atom feed -URI. - -The returned object is an `ArrayObject` subclass called -`Zend\Feed\Reader\FeedSet`, so you can cast it to an array or iterate over it to -access all the detected links. However, as a simple shortcut, you can just grab -the first RSS, RDF, or Atom link using its public properties as in the example -below. Otherwise, each element of the `ArrayObject` is a simple array with the -keys `type` and `uri` where the type is one of "rdf", "rss", or "atom". - -```php -$links = Zend\Feed\Reader\Reader::findFeedLinks('http://www.planet-php.net'); - -if (isset($links->rdf)) { - echo $links->rdf, "\n"; // http://www.planet-php.org/rdf/ -} -if (isset($links->rss)) { - echo $links->rss, "\n"; // http://www.planet-php.org/rss/ -} -if (isset($links->atom)) { - echo $links->atom, "\n"; // http://www.planet-php.org/atom/ -} -``` - -Based on these links, you can then import from whichever source you wish in the usual manner. - -> ### Finding feed links requires an HTTP client -> -> To find feed links, you will need to have an [HTTP client](zend.feed.http-clients) -> available. -> -> If you are not using zend-http, you will need to inject `Reader` with the HTTP -> client. See the [section on providing a client to Reader](http-clients.md#providing-a-client-to-reader). - -This quick method only gives you one link for each feed type, but websites may -indicate many links of any type. Perhaps it's a news site with a RSS feed for -each news category. You can iterate over all links using the ArrayObject's -iterator. - -```php -$links = Zend\Feed\Reader::findFeedLinks('http://www.planet-php.net'); - -foreach ($links as $link) { - echo $link['href'], "\n"; -} -``` - -## Attribute Collections - -In an attempt to simplify return types, return types from the various feed and -entry level methods may include an object of type -`Zend\Feed\Reader\Collection\AbstractCollection`. Despite the special class name -which I'll explain below, this is just a simple subclass of SPL's `ArrayObject`. - -The main purpose here is to allow the presentation of as much data as possible -from the requested elements, while still allowing access to the most relevant -data as a simple array. This also enforces a standard approach to returning such -data which previously may have wandered between arrays and objects. - -The new class type acts identically to `ArrayObject` with the sole addition -being a new method `getValues()` which returns a simple flat array containing -the most relevant information. - -A simple example of this is `Zend\Feed\Reader\Reader\FeedInterface::getCategories()`. -When used with any RSS or Atom feed, this method will return category data as a -container object called `Zend\Feed\Reader\Collection\Category`. The container -object will contain, per category, three fields of data: term, scheme, and label. -The "term" is the basic category name, often machine readable (i.e. plays nice -with URIs). The scheme represents a categorisation scheme (usually a URI -identifier) also known as a "domain" in RSS 2.0. The "label" is a human readable -category name which supports HTML entities. In RSS 2.0, there is no label -attribute so it is always set to the same value as the term for convenience. - -To access category labels by themselves in a simple value array, you might -commit to something like: - -```php -$feed = Zend\Feed\Reader\Reader::import('http://www.example.com/atom.xml'); -$categories = $feed->getCategories(); -$labels = []; -foreach ($categories as $cat) { - $labels[] = $cat['label'] -} -``` - -It's a contrived example, but the point is that the labels are tied up with -other information. - -However, the container class allows you to access the "most relevant" data as a -simple array using the `getValues()` method. The concept of "most relevant" is -obviously a judgement call. For categories it means the category labels (not the -terms or schemes) while for authors it would be the authors' names (not their -email addresses or URIs). The simple array is flat (just values) and passed -through `array_unique()` to remove duplication. - -```php -$feed = Zend\Feed\Reader\Reader::import('http://www.example.com/atom.xml'); -$categories = $feed->getCategories(); -$labels = $categories->getValues(); -``` - -The above example shows how to extract only labels and nothing else thus giving -simple access to the category labels without any additional work to extract that -data by itself. - -## Retrieving Feed Information - -Retrieving information from a feed (we'll cover entries and items in the next -section though they follow identical principals) uses a clearly defined API -which is exactly the same regardless of whether the feed in question is RSS, -RDF, or Atom. The same goes for sub-versions of these standards and we've tested -every single RSS and Atom version. While the underlying feed XML can differ -substantially in terms of the tags and elements they present, they nonetheless -are all trying to convey similar information and to reflect this all the -differences and wrangling over alternative tags are handled internally by -`Zend\Feed\Reader\Reader` presenting you with an identical interface for each. -Ideally, you should not have to care whether a feed is RSS or Atom so long as -you can extract the information you want. - -> ### RSS feeds vary widely -> -> While determining common ground between feed types is itself complex, it -> should be noted that *RSS* in particular is a constantly disputed -> "specification". This has its roots in the original RSS 2.0 document, which -> contains ambiguities and does not detail the correct treatment of all -> elements. As a result, this component rigorously applies the RSS 2.0.11 -> Specification published by the RSS Advisory Board and its accompanying RSS -> Best Practices Profile. No other interpretation of RSS -> 2.0 will be supported, though exceptions may be allowed where it does not -> directly prevent the application of the two documents mentioned above. - -Of course, we don't live in an ideal world, so there may be times the API just -does not cover what you're looking for. To assist you, `Zend\Feed\Reader\Reader` -offers a plugin system which allows you to write extensions to expand the core -API and cover any additional data you are trying to extract from feeds. If -writing another extension is too much trouble, you can simply grab the -underlying DOM or XPath objects and do it by hand in your application. Of -course, we really do encourage writing an extension simply to make it more -portable and reusable, and useful extensions may be proposed to the component -for formal addition. - -Below is a summary of the Core API for feeds. You should note it comprises not -only the basic RSS and Atom standards, but also accounts for a number of -included extensions bundled with `Zend\Feed\Reader\Reader`. The naming of these -extension sourced methods remain fairly generic; all Extension methods operate -at the same level as the Core API though we do allow you to retrieve any -specific extension object separately if required. - -### Feed Level API Methods - -Method | Description ------- | ----------- -`getId()` | Returns a unique ID associated with this feed -`getTitle()` | Returns the title of the feed -`getDescription()` | Returns the text description of the feed. -`getLink()` | Returns a URI to the HTML website containing the same or similar information as this feed (i.e. if the feed is from a blog, it should provide the blog's URI where the HTML version of the entries can be read). -`getFeedLink()` | Returns the URI of this feed, which may be the same as the URI used to import the feed. There are important cases where the feed link may differ because the source URI is being updated and is intended to be removed in the future. -`getAuthors()` | Returns an object of type `Zend\Feed\Reader\Collection\Author` which is an `ArrayObject` whose elements are each simple arrays containing any combination of the keys "name", "email" and "uri". Where irrelevant to the source data, some of these keys may be omitted. -`getAuthor(integer $index = 0)` | Returns either the first author known, or with the optional $index parameter any specific index on the array of authors as described above (returning `NULL` if an invalid index). -`getDateCreated()` | Returns the date on which this feed was created. Generally only applicable to Atom, where it represents the date the resource described by an Atom 1.0 document was created. The returned date will be a `DateTime` object. -`getDateModified()` | Returns the date on which this feed was last modified. The returned date will be a `DateTime` object. -`getLastBuildDate()` | Returns the date on which this feed was last built. The returned date will be a `DateTime` object. This is only supported by RSS; Atom feeds will always return `NULL`. -`getLanguage()` | Returns the language of the feed (if defined) or simply the language noted in the XML document. -`getGenerator()` | Returns the generator of the feed, e.g. the software which generated it. This may differ between RSS and Atom since Atom defines a different notation. -`getCopyright()` | Returns any copyright notice associated with the feed. -`getHubs()` | Returns an array of all Hub Server URI endpoints which are advertised by the feed for use with the Pubsubhubbub Protocol, allowing subscriptions to the feed for real-time updates. -`getCategories()` | Returns a `Zend\Feed\Reader\Collection\Category` object containing the details of any categories associated with the overall feed. The supported fields include "term" (the machine readable category name), "scheme" (the categorisation scheme and domain for this category), and "label" (a HTML decoded human readable category name). Where any of the three fields are absent from the field, they are either set to the closest available alternative or, in the case of "scheme", set to `NULL`. -`getImage()` | Returns an array containing data relating to any feed image or logo, or `NULL` if no image found. The resulting array may contain the following keys: uri, link, title, description, height, and width. Atom logos only contain a URI so the remaining metadata is drawn from RSS feeds only. - -Given the variety of feeds in the wild, some of these methods will undoubtedly -return `NULL` indicating the relevant information couldn't be located. Where -possible, `Zend\Feed\Reader\Reader` will fall back on alternative elements -during its search. For example, searching an RSS feed for a modification date is -more complicated than it looks. RSS 2.0 feeds should include a `` -tag and/or a `` element. But what if it doesn't? Maybe this is an RSS -1.0 feed? Perhaps it instead has an `` element with identical -information (Atom may be used to supplement RSS syntax)? Failing that, we -could simply look at the entries, pick the most recent, and use its `` -element. Assuming it exists, that is. Many feeds also use Dublin Core 1.0 or 1.1 -`` elements for feeds and entries. Or we could find Atom lurking again. - -The point is, `Zend\Feed\Reader\Reader` was designed to know this. When you ask -for the modification date (or anything else), it will run off and search for all -these alternatives until it either gives up and returns `NULL`, or finds an -alternative that should have the right answer. - -In addition to the above methods, all feed objects implement methods for -retrieving the DOM and XPath objects for the current feeds as described -earlier. Feed objects also implement the SPL Iterator and Countable -interfaces. The extended API is summarised below. - -### Extended Feed API Methods - -Method | Description ------- | ----------- -`getDomDocument()` | Returns the parent DOMDocument object for the entire source XML document. -`getElement()` | Returns the current feed level DOMElement object. -`saveXml()` | Returns a string containing an XML document of the entire feed element (this is not the original document, but a rebuilt version). -`getXpath()` | Returns the DOMXPath object used internally to run queries on the DOMDocument object (this includes core and extension namespaces pre-registered). -`getXpathPrefix()` | Returns the valid DOM path prefix prepended to all XPath queries matching the feed being queried. -`getEncoding()` | Returns the encoding of the source XML document (note: this cannot account for errors such as the server sending documents in a different encoding). Where not defined, the default UTF-8 encoding of Unicode is applied. -`count()` | Returns a count of the entries or items this feed contains (implements SPL `Countable` interface) -`current()` | Returns either the current entry (using the current index from `key()`). -`key()` | Returns the current entry index. -`next()` | Increments the entry index value by one. -`rewind()` | Resets the entry index to 0. -`valid()` | Checks that the current entry index is valid, i.e. it does not fall below 0 and does not exceed the number of entries existing. -`getExtensions()` | Returns an array of all extension objects loaded for the current feed (note: both feed-level and entry-level extensions exist, and only feed-level extensions are returned here). The array keys are of the form `{ExtensionName}_Feed`. -`getExtension(string $name)` | Returns an extension object for the feed registered under the provided name. This allows more fine-grained access to extensions which may otherwise be hidden within the implementation of the standard API methods. -`getType()` | Returns a static class constant (e.g. `Zend\Feed\Reader\Reader::TYPE_ATOM_03`, i.e. "Atom 0.3"), indicating exactly what kind of feed is being consumed. - -## Retrieving Entry/Item Information - -Retrieving information for specific entries or items (depending on whether you -speak Atom or RSS) is identical to feed level data. Accessing entries is -simply a matter of iterating over a feed object or using the SPL `Iterator` -interface feed objects implement, and calling the appropriate method on each. - -### Entry API Methods - -Method | Description ------- | ----------- -`getId()` | Returns a unique ID for the current entry. -`getTitle()` | Returns the title of the current entry. -`getDescription()` | Returns a description of the current entry. -`getLink()` | Returns a URI to the HTML version of the current entry. -`getPermaLink()` | Returns the permanent link to the current entry. In most cases, this is the same as using `getLink()`. -`getAuthors()` | Returns an object of type `Zend\Feed\Reader\Collection\Author`, which is an `ArrayObject` whose elements are each simple arrays containing any combination of the keys "name", "email" and "uri". Where irrelevant to the source data, some of these keys may be omitted. -`getAuthor(integer $index = 0)` | Returns either the first author known, or, with the optional `$index` parameter, any specific index on the array of Authors as described above (returning `NULL` if an invalid index). -`getDateCreated()` | Returns the date on which the current entry was created. Generally only applicable to Atom where it represents the date the resource described by an Atom 1.0 document was created. -`getDateModified()` | Returns the date on which the current entry was last modified. -`getContent()` | Returns the content of the current entry (this has any entities reversed if possible, assuming the content type is HTML). The description is returned if a separate content element does not exist. -`getEnclosure()` | Returns an array containing the value of all attributes from a multi-media `` element including as array keys: url, length, type. In accordance with the RSS Best Practices Profile of the RSS Advisory Board, no support is offers for multiple enclosures since such support forms no part of the RSS specification. -`getCommentCount()` | Returns the number of comments made on this entry at the time the feed was last generated. -`getCommentLink()` | Returns a URI pointing to the HTML page where comments can be made on this entry. -`getCommentFeedLink([string $type = ‘atom'|'rss'])` | Returns a URI pointing to a feed of the provided type containing all comments for this entry (type defaults to Atom/RSS depending on current feed type). -`getCategories()` | Returns a `Zend\Feed\Reader\Collection\Category` object containing the details of any categories associated with the entry. The supported fields include "term" (the machine readable category name), "scheme" (the categorisation scheme and domain for this category), and "label" (an HTML-decoded human readable category name). Where any of the three fields are absent from the field, they are either set to the closest available alternative or, in the case of "scheme", set to `NULL`. - -The extended API for entries is identical to that for feeds with the exception -of the `Iterator` methods, which are not needed here. - -> ### Modified vs Created dates -> -> There is often confusion over the concepts of *modified* and *created* dates. -> In Atom, these are two clearly defined concepts (so knock yourself out) but in -> RSS they are vague. RSS 2.0 defines a single `` element which -> typically refers to the date this entry was published, i.e. a creation date of -> sorts. This is not always the case, and it may change with updates or not. As a -> result, if you really want to check whether an entry has changed, don't rely on -> the results of `getDateModified()`. Instead, consider tracking the MD5 hash of -> three other elements concatenated, e.g. using `getTitle()`, `getDescription()`, -> and `getContent()`. If the entry was truly updated, this hash computation will -> give a different result than previously saved hashes for the same entry. This -> is obviously content oriented, and will not assist in detecting changes to -> other relevant elements. Atom feeds should not require such steps. - -> Further muddying the waters, dates in feeds may follow different standards. -> Atom and Dublin Core dates should follow ISO 8601, and RSS dates should -> follow RFC 822 or RFC 2822 (which is also common). Date methods will throw an -> exception if `DateTime` cannot load the date string using one of the above -> standards, or the PHP recognised possibilities for RSS dates. - -> ### Validation -> -> The values returned from these methods are not validated. This means users -> must perform validation on all retrieved data including the filtering of any -> HTML such as from `getContent()` before it is output from your application. -> Remember that most feeds come from external sources, and therefore the default -> assumption should be that they cannot be trusted. - -### Extended Entry Level API Methods - -Method | Description ------- | ----------- -`getDomDocument()` | Returns the parent DOMDocument object for the entire feed (not just the current entry). -`getElement()` | Returns the current entry level DOMElement object. -`getXpath()` | Returns the DOMXPath object used internally to run queries on the DOMDocument object (this includes core and extension namespaces pre-registered). -`getXpathPrefix()` | Returns the valid DOM path prefix prepended to all XPath queries matching the entry being queried. -`getEncoding()` | Returns the encoding of the source XML document (note: this cannot account for errors such as the server sending documents in a different encoding). The default encoding applied in the absence of any other is the UTF-8 encoding of Unicode. -`getExtensions()` | Returns an array of all extension objects loaded for the current entry (note: both feed-level and entry-level extensions exist, and only entry-level extensions are returned here). The array keys are in the form `{ExtensionName}Entry`. -`getExtension(string $name)` | Returns an extension object for the entry registered under the provided name. This allows more fine-grained access to extensions which may otherwise be hidden within the implementation of the standard API methods. -`getType()` | Returns a static class constant (e.g. `Zend\Feed\Reader\Reader::TYPE_ATOM_03`, i.e. "Atom 0.3") indicating exactly what kind of feed is being consumed. - -## Extending Feed and Entry APIs - -Extending `Zend\Feed\Reader\Reader` allows you to add methods at both the feed -and entry level which cover the retrieval of information not already supported -by `Zend\Feed\Reader\Reader`. Given the number of RSS and Atom extensions that -exist, this is a good thing, since `Zend\Feed\Reader\Reader` couldn't possibly -add everything. - -There are two types of extensions possible, those which retrieve information -from elements which are immediate children of the root element (e.g. -`` for RSS or `` for Atom), and those who retrieve information -from child elements of an entry (e.g. `` for RSS or `` for Atom). -On the filesystem, these are grouped as classes within a namespace based on the -extension standard's name. For example, internally we have -`Zend\Feed\Reader\Extension\DublinCore\Feed` and -`Zend\Feed\Reader\Extension\DublinCore\Entry` classes which are two extensions -implementing Dublin Core 1.0 and 1.1 support. - -Extensions are loaded into `Zend\Feed\Reader\Reader` using an "extension -manager". Extension managers must implement `Zend\Feed\Reader\ExtensionManagerInterface`. -Three implementations exist: - -- `Zend\Feed\Reader\StandaloneExtensionManager` is a hard-coded implementation - seeded with all feed and entry implementations. You can extend it to add - extensions, though it's likely easier to copy and paste it, adding your - changes. -- `Zend\Feed\Reader\ExtensionPluginManager` is a `Zend\ServiceManager\AbstractPluginManager` - implementation, `Zend\Feed\Reader\ExtensionManager`; as such, you can extend - it to add more extensions, use a `Zend\ServiceManager\ConfigInterface` instance - to inject it with more extensions, or use its public API for adding services - (e.g., `setService()`, `setFactory()`, etc.). This implementation *does not* - implement `ExtensionManagerInterface`, and must be used with `ExtensionManager`. -- `Zend\Feed\Reader\ExtensionManager` exists for legacy purposes; prior to 2.3, - this was an `AbstractPluginManager` implementation, and the only provided - extension manager. It now implements `ExtensionManagerInterface`, and acts as - a decorator for `ExtensionPluginManager`. - -By default, `Zend\Feed\Reader\Reader` composes a `StandaloneExtensionManager`. You -can inject an alternate implementation using `Reader::setExtensionManager()`: - -```php -$extensions = new Zend\Feed\Reader\ExtensionPluginManager(); -Zend\Feed\Reader\Reader::setExtensionManager( - new ExtensionManager($extensions) -); -``` - -The shipped implementations all provide the default extensions (so-called -"Core Extensions") used internally by `Zend\Feed\Reader\Reader`. These -include: - -Extension | Description ---------- | ----------- -DublinCore (Feed and Entry) | Implements support for Dublin Core Metadata Element Set 1.0 and 1.1. -Content (Entry only) | Implements support for Content 1.0. -Atom (Feed and Entry) | Implements support for Atom 0.3 and Atom 1.0. -Slash | Implements support for the Slash RSS 1.0 module. -WellFormedWeb | Implements support for the Well Formed Web CommentAPI 1.0. -Thread | Implements support for Atom Threading Extensions as described in RFC 4685. -Podcast | Implements support for the Podcast 1.0 DTD from Apple. - -The core extensions are somewhat special since they are extremely common and -multi-faceted. For example, we have a core extension for Atom. Atom is -implemented as an extension (not just a base class) because it doubles as a -valid RSS module; you can insert Atom elements into RSS feeds. I've even seen -RDF feeds which use a lot of Atom in place of more common extensions like -Dublin Core. - -The following is a list of non-Core extensions that are offered, but not registered -by default. If you want to use them, you'll need to -tell `Zend\Feed\Reader\Reader` to load them in advance of importing a feed. -Additional non-Core extensions will be included in future iterations of the -component. - -Extension | Description ---------- | ----------- -Syndication | Implements Syndication 1.0 support for RSS feeds. -CreativeCommons | An RSS module that adds an element at the `` or `` level that specifies which Creative Commons license applies. - -`Zend\Feed\Reader\Reader` requires you to explicitly register non-Core -extensions in order to expose their API to feed and entry objects. Below, we -register the optional Syndication extension, and discover that it can be -directly called from the entry API without any effort. (Note that -extension names are case sensitive and use camelCasing for multiple terms.) - -```php -use Zend\Feed\Reader\Reader; - -Reader::registerExtension('Syndication'); -$feed = Reader::import('http://rss.slashdot.org/Slashdot/slashdot'); -$updatePeriod = $feed->getUpdatePeriod(); -``` - -In the simple example above, we checked how frequently a feed is being updated -using the `getUpdatePeriod()` method. Since it's not part of -`Zend\Feed\Reader\Reader`'s core API, it could only be a method supported by -the newly registered Syndication extension. - -As you can also notice, methods provided by extensions are accessible from the -main API using method overloading. As an alternative, you can also directly -access any extension object for a similar result as seen below. - -```php -use Zend\Feed\Reader\Reader; - -Reader::registerExtension('Syndication'); -$feed = Reader::import('http://rss.slashdot.org/Slashdot/slashdot'); -$syndication = $feed->getExtension('Syndication'); -$updatePeriod = $syndication->getUpdatePeriod(); -``` - -### Writing Zend\\Feed\\Reader Extensions - -Inevitably, there will be times when the `Zend\Feed\Reader` API is just -not capable of getting something you need from a feed or entry. You can use the -underlying source objects, like DOMDocument, to get these by hand; however, there -is a more reusable method available: you can write extensions supporting these new -queries. - -As an example, let's take the case of a purely fictitious corporation named -Jungle Books. Jungle Books have been publishing a lot of reviews on books they -sell (from external sources and customers), which are distributed as an RSS 2.0 -feed. Their marketing department realises that web applications using this feed -cannot currently figure out exactly what book is being reviewed. To make life -easier for everyone, they determine that the geek department needs to extend -RSS 2.0 to include a new element per entry supplying the ISBN-10 or ISBN-13 -number of the publication the entry concerns. They define the new `` -element quite simply with a standard name and namespace URI: - -- Name: JungleBooks 1.0 -- Namespace URI: http://example.com/junglebooks/rss/module/1.0/ - -A snippet of RSS containing this extension in practice could be something -similar to: - -```xml - - - - Jungle Books Customer Reviews - http://example.com/junglebooks - Many book reviews! - Fri, 26 Jun 2009 19:15:10 GMT - - http://example.com/junglebooks/book/938 - - - Review Of Flatland: A Romance of Many Dimensions - http://example.com/junglebooks/review/987 - Confused Physics Student - - A romantic square?! - - Thu, 25 Jun 2009 20:03:28 -0700 - 048627263X - - - -``` - -Implementing this new ISBN element as a simple entry level extension would -require the following class (using your own namespace). - -```php -namespace My\FeedReader\Extension\JungleBooks; - -use Zend\Feed\Reader\Extension\AbstractEntry; - -class Entry extends AbstractEntry -{ - public function getIsbn() - { - if (isset($this->data['isbn'])) { - return $this->data['isbn']; - } - - $isbn = $this->xpath->evaluate( - 'string(' . $this->getXpathPrefix() . '/jungle:isbn)' - ); - - if (! $isbn) { - $isbn = null; - } - - $this->data['isbn'] = $isbn; - return $this->data['isbn']; - } - - protected function registerNamespaces() - { - $this->xpath->registerNamespace( - 'jungle', - 'http://example.com/junglebooks/rss/module/1.0/' - ); - } -} -``` - -This extension creates a new method `getIsbn()`, which runs an XPath query on -the current entry to extract the ISBN number enclosed by the `` -element. It can optionally store this to the internal non-persistent cache (no -need to keep querying the DOM if it's called again on the same entry). The -value is returned to the caller. At the end we have a protected method (it's -abstract, making it required by implementations) which registers the Jungle -Books namespace for their custom RSS module. While we call this an RSS module, -there's nothing to prevent the same element being used in Atom feeds; all -extensions which use the prefix provided by `getXpathPrefix()` are actually -neutral and work on RSS or Atom feeds with no extra code. - -Since this extension is stored outside of zend-feed, you'll need to ensure your -application can autoload it. Once that's in place, you will also need to ensure -your extension manager knows about it, and then register the extension with -`Zend\Feed\Reader\Reader`. - -The following example uses `Zend\Feed\Reader\ExtensionPluginManager` to manage -extensions, as it provides the ability to register new extensions without -requiring extension of the plugin manager itself. To use it, first intall -zend-servicemanager: - -```bash -$ composer require zendframework/zend-servicemanager -``` - -From there: - -```php -use My\FeedReader\Extension\JungleBooks; -use Zend\Feed\Reader\ExtensionManager; -use Zend\Feed\Reader\ExtensionPluginManager; -use Zend\Feed\Reader\Reader; - -$extensions = new ExtensionPluginManager(); -$extensions->setInvokableClass('JungleBooksEntry', JungleBooks\Entry::class); -Reader::setExtensionManager(new ExtensionManager($extensions)); -Reader::registerExtension('JungleBooks'); - -$feed = Reader::import('http://example.com/junglebooks/rss'); - -// ISBN for whatever book the first entry in the feed was concerned with -$firstIsbn = $feed->current()->getIsbn(); -``` - -Writing a feed extension is not much different. The example feed from earlier -included an unmentioned `` element which Jungle Books have -added to their standard to include a link to the day's most popular book (in -terms of visitor traffic). Here's an extension which adds a -`getDaysPopularBookLink()` method to the feel level API. - -```php -namespace My\FeedReader\Extension\JungleBooks; - -use Zend\Feed\Reader\Extension\AbstractFeed; - -class Feed extends AbstractFeed -{ - public function getDaysPopularBookLink() - { - if (isset($this->data['dayPopular'])) { - return $this->data['dayPopular']; - } - - $dayPopular = $this->xpath->evaluate( - 'string(' . $this->getXpathPrefix() . '/jungle:dayPopular)' - ); - - if (!$dayPopular) { - $dayPopular = null; - } - - $this->data['dayPopular'] = $dayPopular; - return $this->data['dayPopular']; - } - - protected function registerNamespaces() - { - $this->xpath->registerNamespace( - 'jungle', - 'http://example.com/junglebooks/rss/module/1.0/' - ); - } -} -``` - -Let's add to the previous example; we'll register the new class with the -extension manager, and then demonstrate using the newly exposed method: - -```php -use My\FeedReader\Extension\JungleBooks; -use Zend\Feed\Reader\ExtensionManager; -use Zend\Feed\Reader\ExtensionPluginManager; -use Zend\Feed\Reader\Reader; - -$extensions = new ExtensionPluginManager(); -$extensions->setInvokableClass('JungleBooksEntry', JungleBooks\Entry::class); -$extensions->setInvokableClass('JungleBooksFeed', JungleBooks\Feed::class); -Reader::setExtensionManager(new ExtensionManager($extensions)); -Reader::registerExtension('JungleBooks'); - -$feed = Reader::import('http://example.com/junglebooks/rss'); - -// URI to the information page of the day's most popular book with visitors -$daysPopularBookLink = $feed->getDaysPopularBookLink(); -``` - -Going through these examples, you'll note that while we need to register the -feed and entry classes separately with the plugin manager, we don't register -them separately when registering the extension with the `Reader`. Extensions -within the same standard may or may not include both a feed and entry class, so -`Zend\Feed\Reader\Reader` only requires you to register the overall parent name, -e.g. JungleBooks, DublinCore, Slash. Internally, it can check at what level -extensions exist and load them up if found. In our case, we have a complete -extension now, spanning the classes `JungleBooks\Feed` and `JungleBooks\Entry`. diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/security.md --- a/vendor/zendframework/zend-feed/doc/book/security.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -# Zend\\Feed\\Reader and Security - -As with any data coming from a source that is beyond the developer's control, -special attention needs to be given to securing, validating and filtering that -data. Similar to data input to our application by users, data coming from RSS -and Atom feeds should also be considered unsafe and potentially dangerous, as it -allows the delivery of HTML and [xHTML](http://tools.ietf.org/html/rfc4287#section-8.1). -Because data validation and filtration is out of `Zend\Feed`'s scope, this task -is left for implementation by the developer, by using libraries such as -zend-escaper for escaping and [HTMLPurifier](http://www.htmlpurifier.org/) for -validating and filtering feed data. - -Escaping and filtering of potentially insecure data is highly recommended before -outputting it anywhere in our application or before storing that data in some -storage engine (be it a simple file or a database.). - -## Filtering data using HTMLPurifier - -Currently, the best available library for filtering and validating (x)HTML data -in PHP is [HTMLPurifier](http://www.htmlpurifier.org/), and, as such, is the -recommended tool for this task. HTMLPurifier works by filtering out all (x)HTML -from the data, except for the tags and attributes specifically allowed in a -whitelist, and by checking and fixing nesting of tags, ensuring -standards-compliant output. - -The following examples will show a basic usage of HTMLPurifier, but developers -are urged to go through and read [HTMLPurifier's documentation](http://www.htmlpurifier.org/docs). - -```php -// Setting HTMLPurifier's options -$options = [ - // Allow only paragraph tags - // and anchor tags wit the href attribute - [ - 'HTML.Allowed', - 'p,a[href]' - ], - // Format end output with Tidy - [ - 'Output.TidyFormat', - true - ], - // Assume XHTML 1.0 Strict Doctype - [ - 'HTML.Doctype', - 'XHTML 1.0 Strict' - ], - // Disable cache, but see note after the example - [ - 'Cache.DefinitionImpl', - null - ] -]; - -// Configuring HTMLPurifier -$config = HTMLPurifier_Config::createDefault(); -foreach ($options as $option) { - $config->set($option[0], $option[1]); -} - -// Creating a HTMLPurifier with it's config -$purifier = new HTMLPurifier($config); - -// Fetch the RSS -try { - $rss = Zend\Feed\Reader\Reader::import('http://www.planet-php.net/rss/'); -} catch (Zend\Feed\Exception\Reader\RuntimeException $e) { - // feed import failed - echo "Exception caught importing feed: {$e->getMessage()}\n"; - exit; -} - -// Initialize the channel data array -// See that we're cleaning the description with HTMLPurifier -$channel = [ - 'title' => $rss->getTitle(), - 'link' => $rss->getLink(), - 'description' => $purifier->purify($rss->getDescription()), - 'items' => [], -]; - -// Loop over each channel item and store relevant data -// See that we're cleaning the descriptions with HTMLPurifier -foreach ($rss as $item) { - $channel['items'][] = [ - 'title' => $item->getTitle(), - 'link' => $item->getLink(), - 'description' => $purifier->purify($item->getDescription()), - ]; -} -``` - -> ### Tidy is required -> -> HTMLPurifier is using the PHP [Tidy extension](http://php.net/tidy) to clean -> and repair the final output. If this extension is not available, it will -> silently fail, but its availability has no impact on the library's security. - -> ### Caching -> -> For the sake of this example, the HTMLPurifier's cache is disabled, but it is -> recommended to configure caching and use its standalone include file as it can -> improve the performance of HTMLPurifier substantially. - -## Escaping data using zend-escaper - -To help prevent XSS attacks, Zend Framework provides the [zend-escaper component](https://github.com/zendframework/zend-escaper), -which complies to the current [OWASP recommendations](https://www.owasp.org/index.php/XSS_Prevention_Cheat_Sheet), -and as such, is the recommended tool for escaping HTML tags and attributes, -Javascript, CSS and URLs before outputing any potentially insecure data to the -users. - -```php -try { - $rss = Zend\Feed\Reader\Reader::import('http://www.planet-php.net/rss/'); -} catch (Zend\Feed\Exception\Reader\RuntimeException $e) { - // feed import failed - echo "Exception caught importing feed: {$e->getMessage()}\n"; - exit; -} - -// Validate all URIs -$linkValidator = new Zend\Validator\Uri; -$link = null; -if ($linkValidator->isValid($rss->getLink())) { - $link = $rss->getLink(); -} - -// Escaper used for escaping data -$escaper = new Zend\Escaper\Escaper('utf-8'); - -// Initialize the channel data array -$channel = [ - 'title' => $escaper->escapeHtml($rss->getTitle()), - 'link' => $escaper->escapeUrl($link), - 'description' => $escaper->escapeHtml($rss->getDescription()), - 'items' => [], -]; - -// Loop over each channel item and store relevant data -foreach ($rss as $item) { - $link = null; - if ($linkValidator->isValid($rss->getLink())) { - $link = $item->getLink(); - } - $channel['items'][] = [ - 'title' => $escaper->escapeHtml($item->getTitle()), - 'link' => $escaper->escapeUrl($link), - 'description' => $escaper->escapeHtml($item->getDescription()), - ]; -} -``` - -The feed data is now safe for output to HTML templates. You can, of course, skip -escaping when simply storing the data persistently, but remember to escape it on -output later! - -Of course, these are just basic examples, and cannot cover all possible -scenarios that you, as a developer, can, and most likely will, encounter. Your -responsibility is to learn what libraries and tools are at your disposal, and -when and how to use them to secure your web applications. diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/doc/book/writer.md --- a/vendor/zendframework/zend-feed/doc/book/writer.md Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,280 +0,0 @@ -# Zend\\Feed\\Writer - -`Zend\Feed\Writer` is the sibling component to `Zend\Feed\Reader` responsible -for *generating* feeds. It supports the Atom 1.0 specification (RFC 4287) and -RSS 2.0 as specified by the RSS Advisory Board (RSS 2.0.11). It does not deviate -from these standards. It does, however, offer a simple extension system which -allows for any extension and module for either of these two specifications to be -implemented if they are not provided out of the box. - -In many ways, `Zend\Feed\Writer` is the inverse of `Zend\Feed\Reader`. Where -`Zend\Reader\Reader` focuses on providing an easy to use architecture fronted by -getter methods, `Zend\Feed\Writer` is fronted by similarly named setters or -mutators. This ensures the API won't pose a learning curve to anyone familiar -with `Zend\Feed\Reader`. - -As a result of this design, the rest may even be obvious. Behind the scenes, -data set on any `Zend\Feed\Writer\Writer` instance is translated at render time -onto a DOMDocument object using the necessary feed elements. For each supported -feed type there is both an Atom 1.0 and RSS 2.0 renderer. Using a DOMDocument -class rather than a templating solution has numerous advantages, the most -obvious being the ability to export the DOMDocument for additional processing -and relying on PHP DOM for correct and valid rendering. - -## Architecture - -The architecture of `Zend\Feed\Writer` is very simple. It has two core sets of -classes: data containers and renderers. - -The containers include the `Zend\Feed\Writer\Feed` and `Zend\Feed\Writer\Entry` -classes. The Entry classes can be attached to any Feed class. The sole purpose -of these containers is to collect data about the feed to generate using a simple -interface of setter methods. These methods perform some data validity testing. -For example, it will validate any passed URIs, dates, etc. These checks are not -tied to any of the feed standards definitions. The container objects also -contain methods to allow for fast rendering and export of the final feed, and -these can be reused at will. - -In addition to the main data container classes, there are two additional Atom -2.0-specific classes: `Zend\Feed\Writer\Source` and `Zend\Feed\Writer\Deleted`. -The former implements Atom 2.0 source elements which carry source feed metadata -for a specific entry within an aggregate feed (i.e. the current feed is not the -entry's original source). The latter implements the [Atom Tombstones RFC](https://tools.ietf.org/html/rfc6721), -allowing feeds to carry references to entries which have been deleted. - -While there are two main data container types, there are four renderers: two -matching container renderers per supported feed type. Each renderer accepts a -container, and, based on its content, attempts to generate valid feed markup. If -the renderer is unable to generate valid feed markup (perhaps due to the -container missing an obligatory data point), it will report this by throwing an -exception. While it is possible to ignore exceptions, this removes the default -safeguard of ensuring you have sufficient data set to render a wholly valid -feed. - -To explain this more clearly: you may construct a set of data containers for a -feed where there is a Feed container, into which has been added some Entry -containers and a Deleted container. This forms a data hierarchy resembling a -normal feed. When rendering is performed, this hierarchy has its pieces passed -to relevant renderers, and the partial feeds (all DOMDocuments) are then pieced -together to create a complete feed. In the case of Source or Deleted (Tombstone) -containers, these are rendered only for Atom 2.0 and ignored for RSS. - -Due to the system being divided between data containers and renderers, -extensions have more mandatory requirements than their equivalents in the -`Zend\Feed\Reader` subcomponent. A typical extension offering namespaced feed -and entry level elements must itself reflect the exact same architecture: i.e. -it must offer both feed and entry level data containers, and matching renderers. -There is, fortunately, no complex integration work required since all extension -classes are simply registered and automatically used by the core classes. We -cover extensions in more detail at the end of this chapter. - -## Getting Started - -To use `Zend\Feed\Writer\Writer`, you will provide it with data, and then -trigger the renderer. What follows is an example demonstrating generation of a -minimal Atom 1.0 feed. Each feed or entry uses a separate data container. - -```php -use Zend\Feed\Writer\Feed; - -/** - * Create the parent feed - */ -$feed = new Feed; -$feed->setTitle("Paddy's Blog"); -$feed->setLink('http://www.example.com'); -$feed->setFeedLink('http://www.example.com/atom', 'atom'); -$feed->addAuthor([ - 'name' => 'Paddy', - 'email' => 'paddy@example.com', - 'uri' => 'http://www.example.com', -]); -$feed->setDateModified(time()); -$feed->addHub('http://pubsubhubbub.appspot.com/'); - -/** - * Add one or more entries. Note that entries must - * be manually added once created. - */ -$entry = $feed->createEntry(); -$entry->setTitle('All Your Base Are Belong To Us'); -$entry->setLink('http://www.example.com/all-your-base-are-belong-to-us'); -$entry->addAuthor([ - 'name' => 'Paddy', - 'email' => 'paddy@example.com', - 'uri' => 'http://www.example.com', -]); -$entry->setDateModified(time()); -$entry->setDateCreated(time()); -$entry->setDescription('Exposing the difficulty of porting games to English.'); -$entry->setContent( - 'I am not writing the article. The example is long enough as is ;).' -); -$feed->addEntry($entry); - -/** - * Render the resulting feed to Atom 1.0 and assign to $out. - * You can substitute "atom" with "rss" to generate an RSS 2.0 feed. - */ -$out = $feed->export('atom'); -``` - -The output rendered should be as follows: - -```xml - - - Paddy's Blog - Writing about PC Games since 176 BC. - 2009-12-14T20:28:18+00:00 - - Zend\Feed\Writer - - - - http://www.example.com - - Paddy - paddy@example.com - http://www.example.com - - - - <![CDATA[All Your Base Are Belong To - Us]]> - - - - 2009-12-14T20:28:18+00:00 - 2009-12-14T20:28:18+00:00 - - http://www.example.com/all-your-base-are-belong-to-us - - Paddy - paddy@example.com - http://www.example.com - - - - - - -``` - -This is a perfectly valid Atom 1.0 example. It should be noted that omitting an -obligatory point of data, such as a title, will trigger an exception when -rendering as Atom 1.0. This will differ for RSS 2.0, since a title may be -omitted so long as a description is present. This gives rise to exceptions that -differ between the two standards depending on the renderer in use. By design, -`Zend\Feed\Writer` will not render an invalid feed for either standard -unless the end-user deliberately elects to ignore all exceptions. This built in -safeguard was added to ensure users without in-depth knowledge of the relevant -specifications have a bit less to worry about. - -## Setting Feed Data Points - -Before you can render a feed, you must first setup the data necessary for the -feed being rendered. This utilises a simple setter style API, which doubles as -a method for validating the data being set. By design, the API closely matches -that for `Zend\Feed\Reader` to avoid undue confusion and uncertainty. - -`Zend\Feed\Writer` offers this API via its data container classes -`Zend\Feed\Writer\Feed` and `Zend\Feed\Writer\Entry` (not to mention the Atom -2.0 specific and extension classes). These classes merely store all feed data in -a type-agnostic manner, meaning you may reuse any data container with any -renderer without requiring additional work. Both classes are also amenable to -extensions, meaning that an extension may define its own container classes which -are registered to the base container classes as extensions, and are checked when -any method call triggers the base container's `__call()` method, allowing method -overloading to the extension classes. - -Here's a summary of the Core API for Feeds. You should note it comprises not -only the basic RSS and Atom standards, but also accounts for a number of -included extensions bundled with `Zend\Feed\Writer`. The naming of these -extension sourced methods remain fairly generic; all extension methods operate -at the same level as the Core API, though we do allow you to retrieve any -specific extension object separately if required. - -The Feed API for data is contained in `Zend\Feed\Writer\Feed`. In addition to the API -detailed below, the class also implements the `Countable` and `Iterator` interfaces. - -### Feed API Methods - -Method | Description ------- | ----------- -`setId()` | Set a unique identifier associated with this feed. For Atom 1.0 this is an `atom:id` element, whereas for RSS 2.0 it is added as a `guid` element. These are optional so long as a link is added; i.e. if no identifier is provided, the link is used. -`setTitle()` | Set the title of the feed. -`setDescription()` | Set the text description of the feed. -`setLink()` | Set a URI to the HTML website containing the same or similar information as this feed (i.e. if the feed is from a blog, it should provide the blog's URI where the HTML version of the entries can be read). -`setFeedLinks()` | Add a link to an XML feed, whether it is to the feed being generated, or an alternate URI pointing to the same feed but in a different format. At a minimum, it is recommended to include a link to the feed being generated so it has an identifiable final URI allowing a client to track its location changes without necessitating constant redirects. The parameter is an array of arrays, where each sub-array contains the keys "type" and "uri". The type should be one of "atom", "rss", or "rdf". -`addAuthors()` | Sets the data for authors. The parameter is an array of array,s where each sub-array may contain the keys "name", "email", and "uri". The "uri" value is only applicable for Atom feeds, since RSS contains no facility to show it. For RSS 2.0, rendering will create two elements: an author element containing the email reference with the name in brackets, and a Dublin Core creator element only containing the name. -`addAuthor()` | Sets the data for a single author following the same array format as described above for a single sub-array. -`setDateCreated()` | Sets the date on which this feed was created. Generally only applicable to Atom, where it represents the date the resource described by an Atom 1.0 document was created. The expected parameter may be a UNIX timestamp or a `DateTime` object. -`setDateModified()` | Sets the date on which this feed was last modified. The expected parameter may be a UNIX timestamp or a `DateTime` object. -`setLastBuildDate()` | Sets the date on which this feed was last build. The expected parameter may be a UNIX timestamp or a `DateTime` object. This will only be rendered for RSS 2.0 feeds, and is automatically rendered as the current date by default when not explicitly set. -`setLanguage()` | Sets the language of the feed. This will be omitted unless set. -`setGenerator()` | Allows the setting of a generator. The parameter should be an array containing the keys "name", "version", and "uri". If omitted a default generator will be added referencing `Zend\Feed\Writer`, the current zend-version version, and the Framework's URI. -`setCopyright()` | Sets a copyright notice associated with the feed. -`addHubs()` | Accepts an array of Pubsubhubbub Hub Endpoints to be rendered in the feed as Atom links so that PuSH Subscribers may subscribe to your feed. Note that you must implement a Pubsubhubbub Publisher in order for real-time updates to be enabled. A Publisher may be implemented using `Zend\Feed\Pubsubhubbub\Publisher`. The method `addHub()` allows adding a single hub at a time. -`addCategories()` | Accepts an array of categories for rendering, where each element is itself an array whose possible keys include "term", "label", and "scheme". The "term" is a typically a category name suitable for inclusion in a URI. The "label" may be a human readable category name supporting special characters (it is HTML encoded during rendering) and is a required key. The "scheme" (called the domain in RSS) is optional, but must be a valid URI. The method `addCategory()` allows adding a single category at a time. -`setImage()` | Accepts an array of image metadata for an RSS image or Atom logo. Atom 1.0 only requires a URI. RSS 2.0 requires a URI, HTML link, and an image title. RSS 2.0 optionally may send a width, height, and image description. To provide these, use an array argument with the following keys: "uri", "link", "title", "description", "height", and "width". The RSS 2.0 HTML link should point to the feed source's HTML page. -`createEntry()` | Returns a new instance of `Zend\Feed\Writer\Entry`. This is the Entry data container. New entries are not automatically assigned to the current feed, so you must explicitly call `addEntry()` to add the entry for rendering. -`addEntry()` | Adds an instance of `Zend\Feed\Writer\Entry` to the current feed container for rendering. -`createTombstone()` | Returns a new instance of `Zend\Feed\Writer\Deleted`. This is the Atom 2.0 Tombstone data container. New entries are not automatically assigned to the current feed, so you must explicitly call `addTombstone()` to add the deleted entry for rendering. -`addTombstone()` | Adds an instance of `Zend\Feed\Writer\Deleted` to the current feed container for rendering. -`removeEntry()` | Accepts a parameter indicating an array index of the entry to remove from the feed. -`export()` | Exports the entire data hierarchy to an XML feed. The method has two parameters. The first is the feed type, one of "atom" or "rss". The second is an optional boolean to set indicating whether or not Exceptions are thrown. The default is `TRUE`. - -> #### Retrieval methods -> -> In addition to the setters listed above, `Feed` instances also provide -> matching getters to retrieve data from the `Feed` data container. For -> example, `setImage()` is matched with a `getImage()` method. - -## Setting Entry Data Points - -Below is a summary of the Core API for entries and items. You should note that -it covers not only the basic RSS and Atom standards, but also a number of -included extensions bundled with `Zend\Feed\Writer`. The naming of these -extension sourced methods remain fairly generic; all extension methods operate -at the same level as the Core API, though we do allow you to retrieve any -specific extension object separately if required. - -The Entry *API* for data is contained in `Zend\Feed\Writer\Entry`. - -### Entry API Methods - -Method | Description ------- | ----------- -`setId()` | Set a unique identifier associated with this entry. For Atom 1.0 this is an `atom:id` element, whereas for RSS 2.0 it is added as a `guid` element. These are optional so long as a link is added; i.e. if no identifier is provided, the link is used. -`setTitle()` | Set the title of the entry. -`setDescription()` | Set the text description of the entry. -`setContent()` | Set the content of the entry. -`setLink()` | Set a URI to the HTML website containing the same or similar information as this entry (i.e. if the feed is from a blog, it should provide the blog article's URI where the HTML version of the entry can be read). -`setFeedLinks()` | Add a link to an XML feed, whether it is to the feed being generated, or an alternate URI pointing to the same feed but in a different format. At a minimum, it is recommended to include a link to the feed being generated so it has an identifiable final URI allowing a client to track its location changes without necessitating constant redirects. The parameter is an array of arrays, where each sub-array contains the keys "type" and "uri". The type should be one of "atom", "rss", or "rdf". If a type is omitted, it defaults to the type used when rendering the feed. -`addAuthors()` | Sets the data for authors. The parameter is an array of array,s where each sub-array may contain the keys "name", "email", and "uri". The "uri" value is only applicable for Atom feeds, since RSS contains no facility to show it. For RSS 2.0, rendering will create two elements: an author element containing the email reference with the name in brackets, and a Dublin Core creator element only containing the name. -`addAuthor()` | Sets the data for a single author following the same format as described above for a single sub-array. -`setDateCreated()` | Sets the date on which this entry was created. Generally only applicable to Atom where it represents the date the resource described by an Atom 1.0 document was created. The expected parameter may be a UNIX timestamp or a `DateTime` object. If omitted, the date used will be the current date and time. -`setDateModified()` | Sets the date on which this entry was last modified. The expected parameter may be a UNIX timestamp or a `DateTime` object. If omitted, the date used will be the current date and time. -`setCopyright()` | Sets a copyright notice associated with the entry. -`addCategories()` | Accepts an array of categories for rendering, where each element is itself an array whose possible keys include "term", "label", and "scheme". The "term" is a typically a category name suitable for inclusion in a URI. The "label" may be a human readable category name supporting special characters (it is encoded during rendering) and is a required key. The "scheme" (called the domain in RSS) is optional but must be a valid URI. -`addCategory()` | Sets the data for a single category following the same format as described above for a single sub-array. -`setCommentCount()` | Sets the number of comments associated with this entry. Rendering differs between RSS and Atom 2.0 depending on the element or attribute needed. -`setCommentLink()` | Sets a link to an HTML page containing comments associated with this entry. -`setCommentFeedLink()` | Sets a link to an XML feed containing comments associated with this entry. The parameter is an array containing the keys "uri" and "type", where the type is one of "rdf", "rss", or "atom". -`setCommentFeedLinks()` | Same as `setCommentFeedLink()`, except it accepts an array of arrays, where each subarray contains the expected parameters of `setCommentFeedLink()`. -`setEncoding()` | Sets the encoding of entry text. This will default to UTF-8, which is the preferred encoding. - -> #### Retrieval methods -> -> In addition to the setters listed above, `Entry` instances also provide -> matching getters to retrieve data from the `Entry` data container. For -> example, `setContent()` is matched with a `getContent()` method. - -## Extensions - -- TODO diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/mkdocs.yml --- a/vendor/zendframework/zend-feed/mkdocs.yml Fri Feb 23 15:51:18 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -docs_dir: doc/book -site_dir: doc/html -pages: - - index.md - - Introduction: intro.md - - Reader: - - "Zend\\Feed\\Reader": reader.md - - 'HTTP Clients': http-clients.md - - 'Importing Feeds': importing.md - - 'Feed Discovery': find-feeds.md - - 'Consuming RSS Feeds': consuming-rss.md - - 'Consuming Atom Feeds': consuming-atom.md - - 'Consuming Atom Entries': consuming-atom-entry.md - - Security: security.md - - Writer: writer.md - - Pubsubhubbub: pubsubhubbub.md -site_name: zend-feed -site_description: Zend\Feed -repo_url: 'https://github.com/zendframework/zend-feed' -copyright: 'Copyright (c) 2016 Zend Technologies USA Inc.' diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php --- a/vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,7 +67,7 @@ $options = ArrayUtils::iteratorToArray($options); } - if (!is_array($options)) { + if (! is_array($options)) { throw new Exception\InvalidArgumentException('Array or Traversable object' . 'expected, got ' . gettype($options)); } @@ -137,7 +137,7 @@ */ public function setHttpResponse($httpResponse) { - if (!$httpResponse instanceof HttpResponse && !$httpResponse instanceof PhpResponse) { + if (! $httpResponse instanceof HttpResponse && ! $httpResponse instanceof PhpResponse) { throw new Exception\InvalidArgumentException('HTTP Response object must' . ' implement one of Zend\Feed\Pubsubhubbub\HttpResponse or' . ' Zend\Http\PhpEnvironment\Response'); @@ -196,8 +196,10 @@ * Attempt to detect the callback URL (specifically the path forward) * @return string */ + // @codingStandardsIgnoreStart protected function _detectCallbackUrl() { + // @codingStandardsIgnoreEnd $callbackUrl = ''; if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { $callbackUrl = $_SERVER['HTTP_X_ORIGINAL_URL']; @@ -214,8 +216,8 @@ $callbackUrl = substr($callbackUrl, strlen($schemeAndHttpHost)); } } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { - $callbackUrl= $_SERVER['ORIG_PATH_INFO']; - if (!empty($_SERVER['QUERY_STRING'])) { + $callbackUrl = $_SERVER['ORIG_PATH_INFO']; + if (! empty($_SERVER['QUERY_STRING'])) { $callbackUrl .= '?' . $_SERVER['QUERY_STRING']; } } @@ -227,9 +229,11 @@ * * @return string */ + // @codingStandardsIgnoreStart protected function _getHttpHost() { - if (!empty($_SERVER['HTTP_HOST'])) { + // @codingStandardsIgnoreEnd + if (! empty($_SERVER['HTTP_HOST'])) { return $_SERVER['HTTP_HOST']; } $scheme = 'http'; @@ -253,19 +257,21 @@ * @param string $header * @return bool|string */ + // @codingStandardsIgnoreStart protected function _getHeader($header) { + // @codingStandardsIgnoreEnd $temp = strtoupper(str_replace('-', '_', $header)); - if (!empty($_SERVER[$temp])) { + if (! empty($_SERVER[$temp])) { return $_SERVER[$temp]; } $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header)); - if (!empty($_SERVER[$temp])) { + if (! empty($_SERVER[$temp])) { return $_SERVER[$temp]; } if (function_exists('apache_request_headers')) { $headers = apache_request_headers(); - if (!empty($headers[$header])) { + if (! empty($headers[$header])) { return $headers[$header]; } } @@ -277,8 +283,10 @@ * * @return string|false Raw body, or false if not present */ + // @codingStandardsIgnoreStart protected function _getRawBody() { + // @codingStandardsIgnoreEnd $body = file_get_contents('php://input'); if (strlen(trim($body)) == 0 && isset($GLOBALS['HTTP_RAW_POST_DATA'])) { $body = $GLOBALS['HTTP_RAW_POST_DATA']; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/PubSubHubbub/HttpResponse.php --- a/vendor/zendframework/zend-feed/src/PubSubHubbub/HttpResponse.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/HttpResponse.php Fri Feb 23 15:52:07 2018 +0000 @@ -60,14 +60,14 @@ } $httpCodeSent = false; foreach ($this->headers as $header) { - if (!$httpCodeSent && $this->statusCode) { + if (! $httpCodeSent && $this->statusCode) { header($header['name'] . ': ' . $header['value'], $header['replace'], $this->statusCode); $httpCodeSent = true; } else { header($header['name'] . ': ' . $header['value'], $header['replace']); } } - if (!$httpCodeSent) { + if (! $httpCodeSent) { header('HTTP/1.1 ' . $this->statusCode); } } @@ -140,9 +140,11 @@ { $ok = headers_sent($file, $line); if ($ok && $throw) { - throw new Exception\RuntimeException('Cannot send headers; headers already sent in ' . $file . ', line ' . $line); + throw new Exception\RuntimeException( + 'Cannot send headers; headers already sent in ' . $file . ', line ' . $line + ); } - return !$ok; + return ! $ok; } /** @@ -154,7 +156,7 @@ */ public function setStatusCode($code) { - if (!is_int($code) || (100 > $code) || (599 < $code)) { + if (! is_int($code) || (100 > $code) || (599 < $code)) { throw new Exception\InvalidArgumentException('Invalid HTTP response' . ' code:' . $code); } @@ -201,8 +203,10 @@ * @param string $name * @return string */ + // @codingStandardsIgnoreStart protected function _normalizeHeader($name) { + // @codingStandardsIgnoreEnd $filtered = str_replace(['-', '_'], ' ', (string) $name); $filtered = ucwords(strtolower($filtered)); $filtered = str_replace(' ', '-', $filtered); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/PubSubHubbub/Model/Subscription.php --- a/vendor/zendframework/zend-feed/src/PubSubHubbub/Model/Subscription.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/Model/Subscription.php Fri Feb 23 15:52:07 2018 +0000 @@ -31,7 +31,7 @@ */ public function setSubscription(array $data) { - if (!isset($data['id'])) { + if (! isset($data['id'])) { throw new PubSubHubbub\Exception\InvalidArgumentException( 'ID must be set before attempting a save' ); @@ -66,12 +66,12 @@ */ public function getSubscription($key) { - if (empty($key) || !is_string($key)) { + if (empty($key) || ! is_string($key)) { throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "key"' .' of "' . $key . '" must be a non-empty string'); } $result = $this->db->select(['id' => $key]); - if (count($result)) { + if ($result && count($result)) { return $result->current()->getArrayCopy(); } return false; @@ -86,12 +86,12 @@ */ public function hasSubscription($key) { - if (empty($key) || !is_string($key)) { + if (empty($key) || ! is_string($key)) { throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "key"' .' of "' . $key . '" must be a non-empty string'); } $result = $this->db->select(['id' => $key]); - if (count($result)) { + if ($result && count($result)) { return true; } return false; @@ -106,7 +106,7 @@ public function deleteSubscription($key) { $result = $this->db->select(['id' => $key]); - if (count($result)) { + if ($result && count($result)) { $this->db->delete( ['id' => $key] ); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/PubSubHubbub/PubSubHubbub.php --- a/vendor/zendframework/zend-feed/src/PubSubHubbub/PubSubHubbub.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/PubSubHubbub.php Fri Feb 23 15:52:07 2018 +0000 @@ -85,7 +85,7 @@ */ public static function getHttpClient() { - if (!isset(static::$httpClient)) { + if (! isset(static::$httpClient)) { static::$httpClient = new Http\Client; } else { static::$httpClient->resetParameters(); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/PubSubHubbub/Publisher.php --- a/vendor/zendframework/zend-feed/src/PubSubHubbub/Publisher.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/Publisher.php Fri Feb 23 15:52:07 2018 +0000 @@ -75,7 +75,7 @@ $options = ArrayUtils::iteratorToArray($options); } - if (!is_array($options)) { + if (! is_array($options)) { throw new Exception\InvalidArgumentException('Array or Traversable object' . 'expected, got ' . gettype($options)); } @@ -100,7 +100,7 @@ */ public function addHubUrl($url) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter "url"' . ' of "' . $url . '" must be a non-empty string and a valid' . 'URL'); @@ -131,7 +131,7 @@ */ public function removeHubUrl($url) { - if (!in_array($url, $this->getHubUrls())) { + if (! in_array($url, $this->getHubUrls())) { return $this; } $key = array_search($url, $this->hubUrls); @@ -159,7 +159,7 @@ */ public function addUpdatedTopicUrl($url) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter "url"' . ' of "' . $url . '" must be a non-empty string and a valid' . 'URL'); @@ -190,7 +190,7 @@ */ public function removeUpdatedTopicUrl($url) { - if (!in_array($url, $this->getUpdatedTopicUrls())) { + if (! in_array($url, $this->getUpdatedTopicUrls())) { return $this; } $key = array_search($url, $this->updatedTopicUrls); @@ -219,7 +219,7 @@ */ public function notifyHub($url) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter "url"' . ' of "' . $url . '" must be a non-empty string and a valid' . 'URL'); @@ -281,7 +281,7 @@ $this->setParameters($name); return $this; } - if (empty($name) || !is_string($name)) { + if (empty($name) || ! is_string($name)) { throw new Exception\InvalidArgumentException('Invalid parameter "name"' . ' of "' . $name . '" must be a non-empty string'); } @@ -289,7 +289,7 @@ $this->removeParameter($name); return $this; } - if (empty($value) || (!is_string($value) && $value !== null)) { + if (empty($value) || (! is_string($value) && $value !== null)) { throw new Exception\InvalidArgumentException('Invalid parameter "value"' . ' of "' . $value . '" must be a non-empty string'); } @@ -320,7 +320,7 @@ */ public function removeParameter($name) { - if (empty($name) || !is_string($name)) { + if (empty($name) || ! is_string($name)) { throw new Exception\InvalidArgumentException('Invalid parameter "name"' . ' of "' . $name . '" must be a non-empty string'); } @@ -348,7 +348,7 @@ */ public function isSuccess() { - return !(count($this->errors) != 0); + return ! (count($this->errors) != 0); } /** @@ -369,8 +369,10 @@ * @return \Zend\Http\Client * @throws Exception\RuntimeException */ + // @codingStandardsIgnoreStart protected function _getHttpClient() { + // @codingStandardsIgnoreEnd $client = PubSubHubbub::getHttpClient(); $client->setMethod(HttpRequest::METHOD_POST); $client->setOptions([ diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/PubSubHubbub/Subscriber.php --- a/vendor/zendframework/zend-feed/src/PubSubHubbub/Subscriber.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/Subscriber.php Fri Feb 23 15:52:07 2018 +0000 @@ -147,7 +147,7 @@ $options = ArrayUtils::iteratorToArray($options); } - if (!is_array($options)) { + if (! is_array($options)) { throw new Exception\InvalidArgumentException('Array or Traversable object' . 'expected, got ' . gettype($options)); } @@ -193,7 +193,7 @@ */ public function setTopicUrl($url) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter "url"' .' of "' . $url . '" must be a non-empty string and a valid' .' URL'); @@ -256,7 +256,7 @@ */ public function setCallbackUrl($url) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter "url"' . ' of "' . $url . '" must be a non-empty string and a valid' . ' URL'); @@ -326,7 +326,7 @@ */ public function addHubUrl($url) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter "url"' . ' of "' . $url . '" must be a non-empty string and a valid' . ' URL'); @@ -357,7 +357,7 @@ */ public function removeHubUrl($url) { - if (!in_array($url, $this->getHubUrls())) { + if (! in_array($url, $this->getHubUrls())) { return $this; } $key = array_search($url, $this->hubUrls); @@ -386,7 +386,7 @@ */ public function addAuthentication($url, array $authentication) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter "url"' . ' of "' . $url . '" must be a non-empty string and a valid' . ' URL'); @@ -445,7 +445,7 @@ $this->setParameters($name); return $this; } - if (empty($name) || !is_string($name)) { + if (empty($name) || ! is_string($name)) { throw new Exception\InvalidArgumentException('Invalid parameter "name"' . ' of "' . $name . '" must be a non-empty string'); } @@ -453,7 +453,7 @@ $this->removeParameter($name); return $this; } - if (empty($value) || (!is_string($value) && $value !== null)) { + if (empty($value) || (! is_string($value) && $value !== null)) { throw new Exception\InvalidArgumentException('Invalid parameter "value"' . ' of "' . $value . '" must be a non-empty string'); } @@ -484,7 +484,7 @@ */ public function removeParameter($name) { - if (empty($name) || !is_string($name)) { + if (empty($name) || ! is_string($name)) { throw new Exception\InvalidArgumentException('Invalid parameter "name"' . ' of "' . $name . '" must be a non-empty string'); } @@ -602,8 +602,10 @@ * @return void * @throws Exception\RuntimeException */ + // @codingStandardsIgnoreStart protected function _doRequest($mode) { + // @codingStandardsIgnoreEnd $client = $this->_getHttpClient(); $hubs = $this->getHubUrls(); if (empty($hubs)) { @@ -648,8 +650,10 @@ * * @return \Zend\Http\Client */ + // @codingStandardsIgnoreStart protected function _getHttpClient() { + // @codingStandardsIgnoreEnd $client = PubSubHubbub::getHttpClient(); $client->setMethod(HttpRequest::METHOD_POST); $client->setOptions(['useragent' => 'Zend_Feed_Pubsubhubbub_Subscriber/' @@ -666,9 +670,11 @@ * @return string * @throws Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _getRequestParameters($hubUrl, $mode) { - if (!in_array($mode, ['subscribe', 'unsubscribe'])) { + // @codingStandardsIgnoreEnd + if (! in_array($mode, ['subscribe', 'unsubscribe'])) { throw new Exception\InvalidArgumentException('Invalid mode specified: "' . $mode . '" which should have been "subscribe" or "unsubscribe"'); } @@ -705,7 +711,7 @@ $params['hub.verify_token'] = $token; // Note: query string only usable with PuSH 0.2 Hubs - if (!$this->usePathParameter) { + if (! $this->usePathParameter) { $params['hub.callback'] = $this->getCallbackUrl() . '?xhub.subscription=' . PubSubHubbub::urlencode($key); } else { @@ -738,7 +744,9 @@ 'verify_token' => hash('sha256', $params['hub.verify_token']), 'secret' => null, 'expiration_time' => $expires, - 'subscription_state' => ($mode == 'unsubscribe')? PubSubHubbub::SUBSCRIPTION_TODELETE : PubSubHubbub::SUBSCRIPTION_NOTVERIFIED, + // @codingStandardsIgnoreStart + 'subscription_state' => ($mode == 'unsubscribe') ? PubSubHubbub::SUBSCRIPTION_TODELETE : PubSubHubbub::SUBSCRIPTION_NOTVERIFIED, + // @codingStandardsIgnoreEnd ]; $this->getStorage()->setSubscription($data); @@ -754,9 +762,11 @@ * * @return string */ + // @codingStandardsIgnoreStart protected function _generateVerifyToken() { - if (!empty($this->testStaticToken)) { + // @codingStandardsIgnoreEnd + if (! empty($this->testStaticToken)) { return $this->testStaticToken; } return uniqid(rand(), true) . time(); @@ -770,8 +780,10 @@ * @param string $hubUrl The Hub Server URL for which this token will apply * @return string */ + // @codingStandardsIgnoreStart protected function _generateSubscriptionKey(array $params, $hubUrl) { + // @codingStandardsIgnoreEnd $keyBase = $params['hub.topic'] . $hubUrl; $key = md5($keyBase); @@ -784,8 +796,10 @@ * @param array $params * @return array */ + // @codingStandardsIgnoreStart protected function _urlEncode(array $params) { + // @codingStandardsIgnoreEnd $encoded = []; foreach ($params as $key => $value) { if (is_array($value)) { @@ -809,8 +823,10 @@ * @param array $params * @return array */ + // @codingStandardsIgnoreStart protected function _toByteValueOrderedString(array $params) { + // @codingStandardsIgnoreEnd $return = []; uksort($params, 'strnatcmp'); foreach ($params as $key => $value) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/PubSubHubbub/Subscriber/Callback.php --- a/vendor/zendframework/zend-feed/src/PubSubHubbub/Subscriber/Callback.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/Subscriber/Callback.php Fri Feb 23 15:52:07 2018 +0000 @@ -147,7 +147,7 @@ 'hub_verify_token', ]; foreach ($required as $key) { - if (!array_key_exists($key, $httpGetData)) { + if (! array_key_exists($key, $httpGetData)) { return false; } } @@ -157,11 +157,11 @@ return false; } if ($httpGetData['hub_mode'] == 'subscribe' - && !array_key_exists('hub_lease_seconds', $httpGetData) + && ! array_key_exists('hub_lease_seconds', $httpGetData) ) { return false; } - if (!Uri::factory($httpGetData['hub_topic'])->isValid()) { + if (! Uri::factory($httpGetData['hub_topic'])->isValid()) { return false; } @@ -169,7 +169,7 @@ * Attempt to retrieve any Verification Token Key attached to Callback * URL's path by our Subscriber implementation */ - if (!$this->_hasValidVerifyToken($httpGetData)) { + if (! $this->_hasValidVerifyToken($httpGetData)) { return false; } return true; @@ -220,14 +220,16 @@ * @param bool $checkValue * @return bool */ + // @codingStandardsIgnoreStart protected function _hasValidVerifyToken(array $httpGetData = null, $checkValue = true) { + // @codingStandardsIgnoreEnd $verifyTokenKey = $this->_detectVerifyTokenKey($httpGetData); if (empty($verifyTokenKey)) { return false; } $verifyTokenExists = $this->getStorage()->hasSubscription($verifyTokenKey); - if (!$verifyTokenExists) { + if (! $verifyTokenExists) { return false; } if ($checkValue) { @@ -250,8 +252,10 @@ * @param null|array $httpGetData * @return false|string */ + // @codingStandardsIgnoreStart protected function _detectVerifyTokenKey(array $httpGetData = null) { + // @codingStandardsIgnoreEnd /** * Available when sub keys encoding in Callback URL path */ @@ -286,8 +290,10 @@ * * @return array|void */ + // @codingStandardsIgnoreStart protected function _parseQueryString() { + // @codingStandardsIgnoreEnd $params = []; $queryString = ''; if (isset($_SERVER['QUERY_STRING'])) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/AbstractEntry.php --- a/vendor/zendframework/zend-feed/src/Reader/AbstractEntry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/AbstractEntry.php Fri Feb 23 15:52:07 2018 +0000 @@ -121,7 +121,7 @@ $dom = new DOMDocument('1.0', $this->getEncoding()); $entry = $dom->importNode($this->getElement(), true); $dom->appendChild($entry); - return $dom->saveXml(); + return $dom->saveXML(); } /** @@ -141,7 +141,7 @@ */ public function getXpath() { - if (!$this->xpath) { + if (! $this->xpath) { $this->setXpath(new DOMXPath($this->getDomDocument())); } return $this->xpath; @@ -207,8 +207,10 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _loadExtensions() { + // @codingStandardsIgnoreEnd $all = Reader::getExtensions(); $feed = $all['entry']; foreach ($feed as $extension) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/AbstractFeed.php --- a/vendor/zendframework/zend-feed/src/Reader/AbstractFeed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/AbstractFeed.php Fri Feb 23 15:52:07 2018 +0000 @@ -168,7 +168,7 @@ */ public function saveXml() { - return $this->getDomDocument()->saveXml(); + return $this->getDomDocument()->saveXML(); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Collection/Category.php --- a/vendor/zendframework/zend-feed/src/Reader/Collection/Category.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Collection/Category.php Fri Feb 23 15:52:07 2018 +0000 @@ -23,7 +23,7 @@ { $categories = []; foreach ($this->getIterator() as $element) { - if (isset($element['label']) && !empty($element['label'])) { + if (isset($element['label']) && ! empty($element['label'])) { $categories[] = $element['label']; } else { $categories[] = $element['term']; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Entry/AbstractEntry.php --- a/vendor/zendframework/zend-feed/src/Reader/Entry/AbstractEntry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Entry/AbstractEntry.php Fri Feb 23 15:52:07 2018 +0000 @@ -126,7 +126,7 @@ $deep = version_compare(PHP_VERSION, '7', 'ge') ? 1 : true; $entry = $dom->importNode($this->getElement(), $deep); $dom->appendChild($entry); - return $dom->saveXml(); + return $dom->saveXML(); } /** @@ -146,7 +146,7 @@ */ public function getXpath() { - if (!$this->xpath) { + if (! $this->xpath) { $this->setXpath(new DOMXPath($this->getDomDocument())); } return $this->xpath; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php --- a/vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php Fri Feb 23 15:52:07 2018 +0000 @@ -199,7 +199,7 @@ */ public function getLink($index = 0) { - if (!array_key_exists('links', $this->data)) { + if (! array_key_exists('links', $this->data)) { $this->getLinks(); } @@ -269,7 +269,7 @@ $commentcount = $this->getExtension('Thread')->getCommentCount(); - if (!$commentcount) { + if (! $commentcount) { $commentcount = $this->getExtension('Atom')->getCommentCount(); } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php --- a/vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,8 +41,8 @@ public function __construct(DOMElement $entry, $entryKey, $type = null) { parent::__construct($entry, $entryKey, $type); - $this->xpathQueryRss = '//item[' . ($this->entryKey+1) . ']'; - $this->xpathQueryRdf = '//rss:item[' . ($this->entryKey+1) . ']'; + $this->xpathQueryRss = '//item[' . ($this->entryKey + 1) . ']'; + $this->xpathQueryRdf = '//rss:item[' . ($this->entryKey + 1) . ']'; $manager = Reader\Reader::getExtensionManager(); $extensions = [ @@ -92,7 +92,7 @@ $authors = []; $authorsDc = $this->getExtension('DublinCore')->getAuthors(); - if (!empty($authorsDc)) { + if (! empty($authorsDc)) { foreach ($authorsDc as $author) { $authors[] = [ 'name' => $author['name'] @@ -151,7 +151,7 @@ $content = $this->getExtension('Content')->getContent(); - if (!$content) { + if (! $content) { $content = $this->getDescription(); } @@ -209,7 +209,8 @@ 'Could not load date due to unrecognised' .' format (should follow RFC 822 or 2822):' . $e->getMessage(), - 0, $e + 0, + $e ); } } @@ -218,15 +219,15 @@ } } - if (!$date) { + if (! $date) { $date = $this->getExtension('DublinCore')->getDate(); } - if (!$date) { + if (! $date) { $date = $this->getExtension('Atom')->getDateModified(); } - if (!$date) { + if (! $date) { $date = null; } @@ -256,7 +257,7 @@ $description = $this->xpath->evaluate('string(' . $this->xpathQueryRdf . '/rss:description)'); } - if (!$description) { + if (! $description) { $description = $this->getExtension('DublinCore')->getDescription(); } @@ -264,7 +265,7 @@ $description = $this->getExtension('Atom')->getDescription(); } - if (!$description) { + if (! $description) { $description = null; } @@ -296,7 +297,7 @@ } } - if (!$enclosure) { + if (! $enclosure) { $enclosure = $this->getExtension('Atom')->getEnclosure(); } @@ -324,7 +325,7 @@ $id = $this->xpath->evaluate('string(' . $this->xpathQueryRss . '/guid)'); } - if (!$id) { + if (! $id) { $id = $this->getExtension('DublinCore')->getId(); } @@ -332,7 +333,7 @@ $id = $this->getExtension('Atom')->getId(); } - if (!$id) { + if (! $id) { if ($this->getPermalink()) { $id = $this->getPermalink(); } elseif ($this->getTitle()) { @@ -355,7 +356,7 @@ */ public function getLink($index = 0) { - if (!array_key_exists('links', $this->data)) { + if (! array_key_exists('links', $this->data)) { $this->getLinks(); } @@ -386,7 +387,7 @@ $list = $this->xpath->query($this->xpathQueryRdf . '//rss:link'); } - if (!$list->length) { + if (! $list->length) { $links = $this->getExtension('Atom')->getLinks(); } else { foreach ($list as $link) { @@ -470,15 +471,15 @@ $title = $this->xpath->evaluate('string(' . $this->xpathQueryRdf . '/rss:title)'); } - if (!$title) { + if (! $title) { $title = $this->getExtension('DublinCore')->getTitle(); } - if (!$title) { + if (! $title) { $title = $this->getExtension('Atom')->getTitle(); } - if (!$title) { + if (! $title) { $title = null; } @@ -500,15 +501,15 @@ $commentcount = $this->getExtension('Slash')->getCommentCount(); - if (!$commentcount) { + if (! $commentcount) { $commentcount = $this->getExtension('Thread')->getCommentCount(); } - if (!$commentcount) { + if (! $commentcount) { $commentcount = $this->getExtension('Atom')->getCommentCount(); } - if (!$commentcount) { + if (! $commentcount) { $commentcount = null; } @@ -536,11 +537,11 @@ $commentlink = $this->xpath->evaluate('string(' . $this->xpathQueryRss . '/comments)'); } - if (!$commentlink) { + if (! $commentlink) { $commentlink = $this->getExtension('Atom')->getCommentLink(); } - if (!$commentlink) { + if (! $commentlink) { $commentlink = null; } @@ -562,15 +563,15 @@ $commentfeedlink = $this->getExtension('WellFormedWeb')->getCommentFeedLink(); - if (!$commentfeedlink) { + if (! $commentfeedlink) { $commentfeedlink = $this->getExtension('Atom')->getCommentFeedLink('rss'); } - if (!$commentfeedlink) { + if (! $commentfeedlink) { $commentfeedlink = $this->getExtension('Atom')->getCommentFeedLink('rdf'); } - if (!$commentfeedlink) { + if (! $commentfeedlink) { $commentfeedlink = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/AbstractEntry.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/AbstractEntry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/AbstractEntry.php Fri Feb 23 15:52:07 2018 +0000 @@ -135,18 +135,18 @@ if ($type === Reader\Reader::TYPE_RSS_10 || $type === Reader\Reader::TYPE_RSS_090 ) { - $this->setXpathPrefix('//rss:item[' . ($this->entryKey + 1) . ']'); + $this->setXpathPrefix('//rss:item[' . ((int)$this->entryKey + 1) . ']'); return $this; } if ($type === Reader\Reader::TYPE_ATOM_10 || $type === Reader\Reader::TYPE_ATOM_03 ) { - $this->setXpathPrefix('//atom:entry[' . ($this->entryKey + 1) . ']'); + $this->setXpathPrefix('//atom:entry[' . ((int)$this->entryKey + 1) . ']'); return $this; } - $this->setXpathPrefix('//item[' . ($this->entryKey + 1) . ']'); + $this->setXpathPrefix('//item[' . ((int)$this->entryKey + 1) . ']'); return $this; } @@ -186,7 +186,7 @@ */ public function getXpath() { - if (!$this->xpath) { + if (! $this->xpath) { $this->setXpath(new DOMXPath($this->getDomDocument())); } return $this->xpath; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,7 +51,7 @@ $authors = []; $list = $this->getXpath()->query($this->getXpathPrefix() . '//atom:author'); - if (!$list->length) { + if (! $list->length) { /** * TODO: Limit query to feed level els only! */ @@ -61,7 +61,7 @@ if ($list->length) { foreach ($list as $author) { $author = $this->getAuthorFromElement($author); - if (!empty($author)) { + if (! empty($author)) { $authors[] = $author; } } @@ -121,7 +121,7 @@ } } - if (!$content) { + if (! $content) { $content = $this->getDescription(); } @@ -139,7 +139,7 @@ */ protected function collectXhtml($xhtml, $prefix) { - if (!empty($prefix)) { + if (! empty($prefix)) { $prefix = $prefix . ':'; } $matches = [ @@ -147,7 +147,7 @@ "/<\/" . $prefix . "div>\s*$/" ]; $xhtml = preg_replace($matches, '', $xhtml); - if (!empty($prefix)) { + if (! empty($prefix)) { $xhtml = preg_replace("/(<[\/]?)" . $prefix . "([a-zA-Z]+)/", '$1$2', $xhtml); } return $xhtml; @@ -222,7 +222,7 @@ $description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:summary)'); - if (!$description) { + if (! $description) { $description = null; } @@ -271,7 +271,7 @@ $id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:id)'); - if (!$id) { + if (! $id) { if ($this->getPermalink()) { $id = $this->getPermalink(); } elseif ($this->getTitle()) { @@ -304,11 +304,11 @@ . ')' ); - if (!$baseUrl) { + if (! $baseUrl) { $baseUrl = $this->getXpath()->evaluate('string(//@xml:base[1])'); } - if (!$baseUrl) { + if (! $baseUrl) { $baseUrl = null; } @@ -325,7 +325,7 @@ */ public function getLink($index = 0) { - if (!array_key_exists('links', $this->data)) { + if (! array_key_exists('links', $this->data)) { $this->getLinks(); } @@ -388,7 +388,7 @@ $title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:title)'); - if (!$title) { + if (! $title) { $title = null; } @@ -554,10 +554,10 @@ */ protected function absolutiseUri($link) { - if (!Uri::factory($link)->isAbsolute()) { + if (! Uri::factory($link)->isAbsolute()) { if ($this->getBaseUrl() !== null) { $link = $this->getBaseUrl() . $link; - if (!Uri::factory($link)->isValid()) { + if (! Uri::factory($link)->isValid()) { $link = null; } } @@ -623,11 +623,11 @@ $prefixAtom03 = $dom->lookupPrefix(Reader\Reader::NAMESPACE_ATOM_03); $prefixAtom10 = $dom->lookupPrefix(Reader\Reader::NAMESPACE_ATOM_10); if ($dom->isDefaultNamespace(Reader\Reader::NAMESPACE_ATOM_03) - || !empty($prefixAtom03)) { + || ! empty($prefixAtom03)) { return Reader\Reader::TYPE_ATOM_03; } if ($dom->isDefaultNamespace(Reader\Reader::NAMESPACE_ATOM_10) - || !empty($prefixAtom10)) { + || ! empty($prefixAtom10)) { return Reader\Reader::TYPE_ATOM_10; } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -53,7 +53,7 @@ if ($list->length) { foreach ($list as $author) { $author = $this->getAuthorFromElement($author); - if (!empty($author)) { + if (! empty($author)) { $authors[] = $author; } } @@ -91,7 +91,7 @@ $copyright = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:rights)'); } - if (!$copyright) { + if (! $copyright) { $copyright = null; } @@ -175,7 +175,7 @@ $description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:subtitle)'); } - if (!$description) { + if (! $description) { $description = null; } @@ -197,7 +197,7 @@ // TODO: Add uri support $generator = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:generator)'); - if (!$generator) { + if (! $generator) { $generator = null; } @@ -219,7 +219,7 @@ $id = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:id)'); - if (!$id) { + if (! $id) { if ($this->getLink()) { $id = $this->getLink(); } elseif ($this->getTitle()) { @@ -247,11 +247,11 @@ $language = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:lang)'); - if (!$language) { + if (! $language) { $language = $this->xpath->evaluate('string(//@xml:lang[1])'); } - if (!$language) { + if (! $language) { $language = null; } @@ -273,7 +273,7 @@ $imageUrl = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:logo)'); - if (!$imageUrl) { + if (! $imageUrl) { $image = null; } else { $image = ['uri' => $imageUrl]; @@ -297,7 +297,7 @@ $baseUrl = $this->xpath->evaluate('string(//@xml:base[1])'); - if (!$baseUrl) { + if (! $baseUrl) { $baseUrl = null; } $this->data['baseUrl'] = $baseUrl; @@ -394,7 +394,7 @@ $title = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:title)'); - if (!$title) { + if (! $title) { $title = null; } @@ -482,10 +482,10 @@ */ protected function absolutiseUri($link) { - if (!Uri::factory($link)->isAbsolute()) { + if (! Uri::factory($link)->isAbsolute()) { if ($this->getBaseUrl() !== null) { $link = $this->getBaseUrl() . $link; - if (!Uri::factory($link)->isValid()) { + if (! Uri::factory($link)->isValid()) { $link = null; } } @@ -523,12 +523,12 @@ $prefixAtom03 = $dom->lookupPrefix(Reader\Reader::NAMESPACE_ATOM_03); $prefixAtom10 = $dom->lookupPrefix(Reader\Reader::NAMESPACE_ATOM_10); if ($dom->isDefaultNamespace(Reader\Reader::NAMESPACE_ATOM_10) - || !empty($prefixAtom10) + || ! empty($prefixAtom10) ) { return Reader\Reader::TYPE_ATOM_10; } if ($dom->isDefaultNamespace(Reader\Reader::NAMESPACE_ATOM_03) - || !empty($prefixAtom03) + || ! empty($prefixAtom03) ) { return Reader\Reader::TYPE_ATOM_03; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Entry.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,13 +47,13 @@ $authors = []; $list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc11:creator'); - if (!$list->length) { + if (! $list->length) { $list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc10:creator'); } - if (!$list->length) { + if (! $list->length) { $list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc11:publisher'); - if (!$list->length) { + if (! $list->length) { $list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc10:publisher'); } } @@ -89,7 +89,7 @@ $list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc11:subject'); - if (!$list->length) { + if (! $list->length) { $list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc10:subject'); } @@ -133,11 +133,11 @@ $description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)'); - if (!$description) { + if (! $description) { $description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)'); } - if (!$description) { + if (! $description) { $description = null; } @@ -159,7 +159,7 @@ $id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)'); - if (!$id) { + if (! $id) { $id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)'); } @@ -181,11 +181,11 @@ $title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)'); - if (!$title) { + if (! $title) { $title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)'); } - if (!$title) { + if (! $title) { $title = null; } @@ -208,7 +208,7 @@ $d = null; $date = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)'); - if (!$date) { + if (! $date) { $date = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)'); } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,13 +47,13 @@ $authors = []; $list = $this->getXpath()->query('//dc11:creator'); - if (!$list->length) { + if (! $list->length) { $list = $this->getXpath()->query('//dc10:creator'); } - if (!$list->length) { + if (! $list->length) { $list = $this->getXpath()->query('//dc11:publisher'); - if (!$list->length) { + if (! $list->length) { $list = $this->getXpath()->query('//dc10:publisher'); } } @@ -89,11 +89,11 @@ $copyright = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:rights)'); - if (!$copyright) { + if (! $copyright) { $copyright = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:rights)'); } - if (!$copyright) { + if (! $copyright) { $copyright = null; } @@ -115,11 +115,11 @@ $description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)'); - if (!$description) { + if (! $description) { $description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)'); } - if (!$description) { + if (! $description) { $description = null; } @@ -141,7 +141,7 @@ $id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)'); - if (!$id) { + if (! $id) { $id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)'); } @@ -163,11 +163,11 @@ $language = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:language)'); - if (!$language) { + if (! $language) { $language = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:language)'); } - if (!$language) { + if (! $language) { $language = null; } @@ -189,11 +189,11 @@ $title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)'); - if (!$title) { + if (! $title) { $title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)'); } - if (!$title) { + if (! $title) { $title = null; } @@ -216,7 +216,7 @@ $d = null; $date = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)'); - if (!$date) { + if (! $date) { $date = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)'); } @@ -242,7 +242,7 @@ $list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc11:subject'); - if (!$list->length) { + if (! $list->length) { $list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc10:subject'); } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Entry.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -28,7 +28,7 @@ $author = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:author)'); - if (!$author) { + if (! $author) { $author = null; } @@ -50,7 +50,7 @@ $block = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:block)'); - if (!$block) { + if (! $block) { $block = null; } @@ -72,7 +72,7 @@ $duration = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:duration)'); - if (!$duration) { + if (! $duration) { $duration = null; } @@ -94,7 +94,7 @@ $explicit = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:explicit)'); - if (!$explicit) { + if (! $explicit) { $explicit = null; } @@ -116,7 +116,7 @@ $keywords = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)'); - if (!$keywords) { + if (! $keywords) { $keywords = null; } @@ -138,7 +138,7 @@ $subtitle = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:subtitle)'); - if (!$subtitle) { + if (! $subtitle) { $subtitle = null; } @@ -160,7 +160,7 @@ $summary = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:summary)'); - if (!$summary) { + if (! $summary) { $summary = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Feed.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,7 +29,7 @@ $author = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:author)'); - if (!$author) { + if (! $author) { $author = null; } @@ -51,7 +51,7 @@ $block = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:block)'); - if (!$block) { + if (! $block) { $block = null; } @@ -83,7 +83,7 @@ $children = []; foreach ($node->childNodes as $childNode) { - if (!($childNode instanceof DOMText)) { + if (! ($childNode instanceof DOMText)) { $children[$childNode->getAttribute('text')] = null; } } @@ -93,7 +93,7 @@ } } - if (!$categories) { + if (! $categories) { $categories = null; } @@ -115,7 +115,7 @@ $explicit = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:explicit)'); - if (!$explicit) { + if (! $explicit) { $explicit = null; } @@ -137,7 +137,7 @@ $image = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:image/@href)'); - if (!$image) { + if (! $image) { $image = null; } @@ -159,7 +159,7 @@ $keywords = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)'); - if (!$keywords) { + if (! $keywords) { $keywords = null; } @@ -181,7 +181,7 @@ $newFeedUrl = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:new-feed-url)'); - if (!$newFeedUrl) { + if (! $newFeedUrl) { $newFeedUrl = null; } @@ -206,13 +206,13 @@ $email = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:owner/itunes:email)'); $name = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:owner/itunes:name)'); - if (!empty($email)) { + if (! empty($email)) { $owner = $email . (empty($name) ? '' : ' (' . $name . ')'); - } elseif (!empty($name)) { + } elseif (! empty($name)) { $owner = $name; } - if (!$owner) { + if (! $owner) { $owner = null; } @@ -234,7 +234,7 @@ $subtitle = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:subtitle)'); - if (!$subtitle) { + if (! $subtitle) { $subtitle = null; } @@ -256,7 +256,7 @@ $summary = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:summary)'); - if (!$summary) { + if (! $summary) { $summary = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/Slash/Entry.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/Slash/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/Slash/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,7 +51,7 @@ $stringParade = $this->getData($name); $hitParade = []; - if (!empty($stringParade)) { + if (! empty($stringParade)) { $stringParade = explode(',', $stringParade); foreach ($stringParade as $hit) { @@ -78,7 +78,7 @@ $comments = $this->getData($name, 'string'); - if (!$comments) { + if (! $comments) { $this->data[$name] = null; return $this->data[$name]; } @@ -101,7 +101,7 @@ $data = $this->xpath->evaluate($type . '(' . $this->getXpathPrefix() . '/slash10:' . $name . ')'); - if (!$data) { + if (! $data) { $data = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/Syndication/Feed.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/Syndication/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/Syndication/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,8 +39,7 @@ return $period; default: throw new Reader\Exception\InvalidArgumentException("Feed specified invalid update period: '$period'." - . " Must be one of hourly, daily, weekly or yearly" - ); + . " Must be one of hourly, daily, weekly or yearly"); } } @@ -54,7 +53,7 @@ $name = 'updateFrequency'; $freq = $this->getData($name, 'number'); - if (!$freq || $freq < 1) { + if (! $freq || $freq < 1) { $this->data[$name] = 1; return 1; } @@ -72,7 +71,7 @@ $name = 'updateFrequency'; $freq = $this->getData($name, 'number'); - if (!$freq || $freq < 1) { + if (! $freq || $freq < 1) { $this->data[$name] = 1; $freq = 1; } @@ -130,7 +129,7 @@ $data = $this->xpath->evaluate($type . '(' . $this->getXpathPrefix() . '/syn10:' . $name . ')'); - if (!$data) { + if (! $data) { $data = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/Thread/Entry.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/Thread/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/Thread/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,7 +51,7 @@ $data = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/thread10:' . $name . ')'); - if (!$data) { + if (! $data) { $data = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Extension/WellFormedWeb/Entry.php --- a/vendor/zendframework/zend-feed/src/Reader/Extension/WellFormedWeb/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/WellFormedWeb/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,7 +29,7 @@ $data = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/wfw:' . $name . ')'); - if (!$data) { + if (! $data) { $data = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/ExtensionManager.php --- a/vendor/zendframework/zend-feed/src/Reader/ExtensionManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/ExtensionManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -46,7 +46,7 @@ */ public function __call($method, $args) { - if (!method_exists($this->pluginManager, $method)) { + if (! method_exists($this->pluginManager, $method)) { throw new Exception\BadMethodCallException(sprintf( 'Method by name of %s does not exist in %s', $method, diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/ExtensionPluginManager.php --- a/vendor/zendframework/zend-feed/src/Reader/ExtensionPluginManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/ExtensionPluginManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -20,7 +20,7 @@ * Validation checks that we have an Extension\AbstractEntry or * Extension\AbstractFeed. */ -class ExtensionPluginManager extends AbstractPluginManager +class ExtensionPluginManager extends AbstractPluginManager implements ExtensionManagerInterface { /** * Aliases for default set of extension classes @@ -31,42 +31,55 @@ 'atomentry' => Extension\Atom\Entry::class, 'atomEntry' => Extension\Atom\Entry::class, 'AtomEntry' => Extension\Atom\Entry::class, + 'Atom\Entry' => Extension\Atom\Entry::class, 'atomfeed' => Extension\Atom\Feed::class, 'atomFeed' => Extension\Atom\Feed::class, 'AtomFeed' => Extension\Atom\Feed::class, + 'Atom\Feed' => Extension\Atom\Feed::class, 'contententry' => Extension\Content\Entry::class, 'contentEntry' => Extension\Content\Entry::class, 'ContentEntry' => Extension\Content\Entry::class, + 'Content\Entry' => Extension\Content\Entry::class, 'creativecommonsentry' => Extension\CreativeCommons\Entry::class, 'creativeCommonsEntry' => Extension\CreativeCommons\Entry::class, 'CreativeCommonsEntry' => Extension\CreativeCommons\Entry::class, + 'CreativeCommons\Entry' => Extension\CreativeCommons\Entry::class, 'creativecommonsfeed' => Extension\CreativeCommons\Feed::class, 'creativeCommonsFeed' => Extension\CreativeCommons\Feed::class, 'CreativeCommonsFeed' => Extension\CreativeCommons\Feed::class, + 'CreativeCommons\Feed' => Extension\CreativeCommons\Feed::class, 'dublincoreentry' => Extension\DublinCore\Entry::class, 'dublinCoreEntry' => Extension\DublinCore\Entry::class, 'DublinCoreEntry' => Extension\DublinCore\Entry::class, + 'DublinCore\Entry' => Extension\DublinCore\Entry::class, 'dublincorefeed' => Extension\DublinCore\Feed::class, 'dublinCoreFeed' => Extension\DublinCore\Feed::class, 'DublinCoreFeed' => Extension\DublinCore\Feed::class, + 'DublinCore\Feed' => Extension\DublinCore\Feed::class, 'podcastentry' => Extension\Podcast\Entry::class, 'podcastEntry' => Extension\Podcast\Entry::class, 'PodcastEntry' => Extension\Podcast\Entry::class, + 'Podcast\Entry' => Extension\Podcast\Entry::class, 'podcastfeed' => Extension\Podcast\Feed::class, 'podcastFeed' => Extension\Podcast\Feed::class, 'PodcastFeed' => Extension\Podcast\Feed::class, + 'Podcast\Feed' => Extension\Podcast\Feed::class, 'slashentry' => Extension\Slash\Entry::class, 'slashEntry' => Extension\Slash\Entry::class, 'SlashEntry' => Extension\Slash\Entry::class, + 'Slash\Entry' => Extension\Slash\Entry::class, 'syndicationfeed' => Extension\Syndication\Feed::class, 'syndicationFeed' => Extension\Syndication\Feed::class, 'SyndicationFeed' => Extension\Syndication\Feed::class, + 'Syndication\Feed' => Extension\Syndication\Feed::class, 'threadentry' => Extension\Thread\Entry::class, 'threadEntry' => Extension\Thread\Entry::class, 'ThreadEntry' => Extension\Thread\Entry::class, + 'Thread\Entry' => Extension\Thread\Entry::class, 'wellformedwebentry' => Extension\WellFormedWeb\Entry::class, 'wellFormedWebEntry' => Extension\WellFormedWeb\Entry::class, 'WellFormedWebEntry' => Extension\WellFormedWeb\Entry::class, + 'WellFormedWeb\Entry' => Extension\WellFormedWeb\Entry::class, ]; /** diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Feed/AbstractFeed.php --- a/vendor/zendframework/zend-feed/src/Reader/Feed/AbstractFeed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Feed/AbstractFeed.php Fri Feb 23 15:52:07 2018 +0000 @@ -172,7 +172,7 @@ */ public function saveXml() { - return $this->getDomDocument()->saveXml(); + return $this->getDomDocument()->saveXML(); } /** @@ -282,8 +282,10 @@ if (in_array($extension, $all['core'])) { continue; } - if (!$manager->has($extension)) { - throw new Exception\RuntimeException(sprintf('Unable to load extension "%s"; cannot find class', $extension)); + if (! $manager->has($extension)) { + throw new Exception\RuntimeException( + sprintf('Unable to load extension "%s"; cannot find class', $extension) + ); } $plugin = $manager->get($extension); $plugin->setDomDocument($this->getDomDocument()); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Feed/Atom.php --- a/vendor/zendframework/zend-feed/src/Reader/Feed/Atom.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Feed/Atom.php Fri Feb 23 15:52:07 2018 +0000 @@ -92,7 +92,7 @@ $copyright = $this->getExtension('Atom')->getCopyright(); - if (!$copyright) { + if (! $copyright) { $copyright = null; } @@ -104,7 +104,7 @@ /** * Get the feed creation date * - * @return string|null + * @return \DateTime|null */ public function getDateCreated() { @@ -114,7 +114,7 @@ $dateCreated = $this->getExtension('Atom')->getDateCreated(); - if (!$dateCreated) { + if (! $dateCreated) { $dateCreated = null; } @@ -126,7 +126,7 @@ /** * Get the feed modification date * - * @return string|null + * @return \DateTime|null */ public function getDateModified() { @@ -136,7 +136,7 @@ $dateModified = $this->getExtension('Atom')->getDateModified(); - if (!$dateModified) { + if (! $dateModified) { $dateModified = null; } @@ -168,7 +168,7 @@ $description = $this->getExtension('Atom')->getDescription(); - if (!$description) { + if (! $description) { $description = null; } @@ -226,11 +226,11 @@ $language = $this->getExtension('Atom')->getLanguage(); - if (!$language) { + if (! $language) { $language = $this->xpath->evaluate('string(//@xml:lang[1])'); } - if (!$language) { + if (! $language) { $language = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Feed/FeedInterface.php --- a/vendor/zendframework/zend-feed/src/Reader/Feed/FeedInterface.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Feed/FeedInterface.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,14 +41,14 @@ /** * Get the feed creation date * - * @return string|null + * @return \DateTime|null */ public function getDateCreated(); /** * Get the feed modification date * - * @return string|null + * @return \DateTime|null */ public function getDateModified(); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Feed/Rss.php --- a/vendor/zendframework/zend-feed/src/Reader/Feed/Rss.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Feed/Rss.php Fri Feb 23 15:52:07 2018 +0000 @@ -85,7 +85,7 @@ $authors = []; $authorsDc = $this->getExtension('DublinCore')->getAuthors(); - if (!empty($authorsDc)) { + if (! empty($authorsDc)) { foreach ($authorsDc as $author) { $authors[] = [ 'name' => $author['name'] @@ -153,7 +153,7 @@ $copyright = $this->xpath->evaluate('string(/rss/channel/copyright)'); } - if (!$copyright && $this->getExtension('DublinCore') !== null) { + if (! $copyright && $this->getExtension('DublinCore') !== null) { $copyright = $this->getExtension('DublinCore')->getCopyright(); } @@ -161,7 +161,7 @@ $copyright = $this->getExtension('Atom')->getCopyright(); } - if (!$copyright) { + if (! $copyright) { $copyright = null; } @@ -173,7 +173,7 @@ /** * Get the feed creation date * - * @return string|null + * @return DateTime|null */ public function getDateCreated() { @@ -197,7 +197,7 @@ if ($this->getType() !== Reader\Reader::TYPE_RSS_10 && $this->getType() !== Reader\Reader::TYPE_RSS_090) { $dateModified = $this->xpath->evaluate('string(/rss/channel/pubDate)'); - if (!$dateModified) { + if (! $dateModified) { $dateModified = $this->xpath->evaluate('string(/rss/channel/lastBuildDate)'); } if ($dateModified) { @@ -217,7 +217,8 @@ 'Could not load date due to unrecognised' .' format (should follow RFC 822 or 2822):' . $e->getMessage(), - 0, $e + 0, + $e ); } } @@ -226,15 +227,15 @@ } } - if (!$date) { + if (! $date) { $date = $this->getExtension('DublinCore')->getDate(); } - if (!$date) { + if (! $date) { $date = $this->getExtension('Atom')->getDateModified(); } - if (!$date) { + if (! $date) { $date = null; } @@ -277,7 +278,8 @@ 'Could not load date due to unrecognised' .' format (should follow RFC 822 or 2822):' . $e->getMessage(), - 0, $e + 0, + $e ); } } @@ -286,7 +288,7 @@ } } - if (!$date) { + if (! $date) { $date = null; } @@ -313,7 +315,7 @@ $description = $this->xpath->evaluate('string(/rdf:RDF/rss:channel/rss:description)'); } - if (!$description && $this->getExtension('DublinCore') !== null) { + if (! $description && $this->getExtension('DublinCore') !== null) { $description = $this->getExtension('DublinCore')->getDescription(); } @@ -321,7 +323,7 @@ $description = $this->getExtension('Atom')->getDescription(); } - if (!$description) { + if (! $description) { $description = null; } @@ -348,7 +350,7 @@ $id = $this->xpath->evaluate('string(/rss/channel/guid)'); } - if (!$id && $this->getExtension('DublinCore') !== null) { + if (! $id && $this->getExtension('DublinCore') !== null) { $id = $this->getExtension('DublinCore')->getId(); } @@ -356,7 +358,7 @@ $id = $this->getExtension('Atom')->getId(); } - if (!$id) { + if (! $id) { if ($this->getLink()) { $id = $this->getLink(); } elseif ($this->getTitle()) { @@ -443,7 +445,7 @@ $language = $this->xpath->evaluate('string(/rss/channel/language)'); } - if (!$language && $this->getExtension('DublinCore') !== null) { + if (! $language && $this->getExtension('DublinCore') !== null) { $language = $this->getExtension('DublinCore')->getLanguage(); } @@ -451,11 +453,11 @@ $language = $this->getExtension('Atom')->getLanguage(); } - if (!$language) { + if (! $language) { $language = $this->xpath->evaluate('string(//@xml:lang[1])'); } - if (!$language) { + if (! $language) { $language = null; } @@ -486,7 +488,7 @@ $link = $this->getExtension('Atom')->getLink(); } - if (!$link) { + if (! $link) { $link = null; } @@ -535,7 +537,7 @@ $generator = $this->xpath->evaluate('string(/rss/channel/generator)'); } - if (!$generator) { + if (! $generator) { if ($this->getType() !== Reader\Reader::TYPE_RSS_10 && $this->getType() !== Reader\Reader::TYPE_RSS_090) { $generator = $this->xpath->evaluate('string(/rss/channel/atom:generator)'); @@ -548,7 +550,7 @@ $generator = $this->getExtension('Atom')->getGenerator(); } - if (!$generator) { + if (! $generator) { $generator = null; } @@ -575,15 +577,15 @@ $title = $this->xpath->evaluate('string(/rdf:RDF/rss:channel/rss:title)'); } - if (!$title && $this->getExtension('DublinCore') !== null) { + if (! $title && $this->getExtension('DublinCore') !== null) { $title = $this->getExtension('DublinCore')->getTitle(); } - if (!$title) { + if (! $title) { $title = $this->getExtension('Atom')->getTitle(); } - if (!$title) { + if (! $title) { $title = null; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/FeedSet.php --- a/vendor/zendframework/zend-feed/src/Reader/FeedSet.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/FeedSet.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,54 +41,95 @@ { foreach ($links as $link) { if (strtolower($link->getAttribute('rel')) !== 'alternate' - || !$link->getAttribute('type') || !$link->getAttribute('href')) { + || ! $link->getAttribute('type') || ! $link->getAttribute('href')) { continue; } - if (!isset($this->rss) && $link->getAttribute('type') == 'application/rss+xml') { + if (! isset($this->rss) && $link->getAttribute('type') == 'application/rss+xml') { $this->rss = $this->absolutiseUri(trim($link->getAttribute('href')), $uri); - } elseif (!isset($this->atom) && $link->getAttribute('type') == 'application/atom+xml') { + } elseif (! isset($this->atom) && $link->getAttribute('type') == 'application/atom+xml') { $this->atom = $this->absolutiseUri(trim($link->getAttribute('href')), $uri); - } elseif (!isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') { + } elseif (! isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') { $this->rdf = $this->absolutiseUri(trim($link->getAttribute('href')), $uri); } $this[] = new static([ 'rel' => 'alternate', 'type' => $link->getAttribute('type'), 'href' => $this->absolutiseUri(trim($link->getAttribute('href')), $uri), + 'title' => $link->getAttribute('title'), ]); } } /** * Attempt to turn a relative URI into an absolute URI + * + * @param string $link + * @param string $uri OPTIONAL + * @return string|null absolutised link or null if invalid */ protected function absolutiseUri($link, $uri = null) { $linkUri = Uri::factory($link); - if (!$linkUri->isAbsolute() or !$linkUri->isValid()) { - if ($uri !== null) { - $uri = Uri::factory($uri); + if ($linkUri->isAbsolute()) { + // invalid absolute link can not be recovered + return $linkUri->isValid() ? $link : null; + } - if ($link[0] !== '/') { - $link = $uri->getPath() . '/' . $link; - } + $scheme = 'http'; + if ($uri !== null) { + $uri = Uri::factory($uri); + $scheme = $uri->getScheme() ?: $scheme; + } - $link = sprintf( - '%s://%s/%s', - ($uri->getScheme() ?: 'http'), - $uri->getHost(), - $this->canonicalizePath($link) - ); + if ($linkUri->getHost()) { + $link = $this->resolveSchemeRelativeUri($link, $scheme); + } elseif ($uri !== null) { + $link = $this->resolveRelativeUri($link, $scheme, $uri->getHost(), $uri->getPath()); + } - if (!Uri::factory($link)->isValid()) { - $link = null; - } - } + if (! Uri::factory($link)->isValid()) { + return null; } + return $link; } /** + * Resolves scheme relative link to absolute + * + * @param string $link + * @param string $scheme + * @return string + */ + private function resolveSchemeRelativeUri($link, $scheme) + { + $link = ltrim($link, '/'); + return sprintf('%s://%s', $scheme, $link); + } + + /** + * Resolves relative link to absolute + * + * @param string $link + * @param string $scheme + * @param string $host + * @param string $uriPath + * @return string + */ + private function resolveRelativeUri($link, $scheme, $host, $uriPath) + { + if ($link[0] !== '/') { + $link = $uriPath . '/' . $link; + } + return sprintf( + '%s://%s/%s', + $scheme, + $host, + $this->canonicalizePath($link) + ); + } + + /** * Canonicalize relative path */ protected function canonicalizePath($path) @@ -117,8 +158,8 @@ */ public function offsetGet($offset) { - if ($offset == 'feed' && !$this->offsetExists('feed')) { - if (!$this->offsetExists('href')) { + if ($offset == 'feed' && ! $this->offsetExists('feed')) { + if (! $this->offsetExists('href')) { return; } $feed = Reader::import($this->offsetGet('href')); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Http/ZendHttpClientDecorator.php --- a/vendor/zendframework/zend-feed/src/Reader/Http/ZendHttpClientDecorator.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Http/ZendHttpClientDecorator.php Fri Feb 23 15:52:07 2018 +0000 @@ -9,9 +9,9 @@ namespace Zend\Feed\Reader\Http; +use Zend\Feed\Reader\Exception; use Zend\Http\Client as ZendHttpClient; use Zend\Http\Headers; -use Zend\Feed\Reader\Exception; class ZendHttpClientDecorator implements HeaderAwareClientInterface { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/Reader.php --- a/vendor/zendframework/zend-feed/src/Reader/Reader.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/Reader.php Fri Feb 23 15:52:07 2018 +0000 @@ -12,9 +12,9 @@ use DOMDocument; use DOMXPath; use Zend\Cache\Storage\StorageInterface as CacheStorage; +use Zend\Feed\Reader\Exception\InvalidHttpClientException; use Zend\Http as ZendHttp; use Zend\Stdlib\ErrorHandler; -use Zend\Feed\Reader\Exception\InvalidHttpClientException; /** */ @@ -222,7 +222,9 @@ } $response = $client->get($uri, $headers); if ($response->getStatusCode() !== 200 && $response->getStatusCode() !== 304) { - throw new Exception\RuntimeException('Feed failed to load, got response code ' . $response->getStatusCode()); + throw new Exception\RuntimeException( + 'Feed failed to load, got response code ' . $response->getStatusCode() + ); } if ($response->getStatusCode() == 304) { $responseXml = $data; @@ -247,7 +249,9 @@ } $response = $client->get($uri); if ((int) $response->getStatusCode() !== 200) { - throw new Exception\RuntimeException('Feed failed to load, got response code ' . $response->getStatusCode()); + throw new Exception\RuntimeException( + 'Feed failed to load, got response code ' . $response->getStatusCode() + ); } $responseXml = $response->getBody(); $cache->setItem($cacheId, $responseXml); @@ -255,7 +259,9 @@ } else { $response = $client->get($uri); if ((int) $response->getStatusCode() !== 200) { - throw new Exception\RuntimeException('Feed failed to load, got response code ' . $response->getStatusCode()); + throw new Exception\RuntimeException( + 'Feed failed to load, got response code ' . $response->getStatusCode() + ); } $reader = static::importString($response->getBody()); $reader->setOriginalSourceUri($uri); @@ -289,7 +295,9 @@ } if ((int) $response->getStatusCode() !== 200) { - throw new Exception\RuntimeException('Feed failed to load, got response code ' . $response->getStatusCode()); + throw new Exception\RuntimeException( + 'Feed failed to load, got response code ' . $response->getStatusCode() + ); } $reader = static::importString($response->getBody()); $reader->setOriginalSourceUri($uri); @@ -307,7 +315,7 @@ public static function importString($string) { $trimmed = trim($string); - if (!is_string($string) || empty($trimmed)) { + if (! is_string($string) || empty($trimmed)) { throw new Exception\InvalidArgumentException('Only non empty strings are allowed as input'); } @@ -325,7 +333,7 @@ libxml_disable_entity_loader($oldValue); libxml_use_internal_errors($libxmlErrflag); - if (!$status) { + if (! $status) { // Build error message $error = libxml_get_last_error(); if ($error && $error->message) { @@ -384,7 +392,9 @@ $client = static::getHttpClient(); $response = $client->get($uri); if ($response->getStatusCode() !== 200) { - throw new Exception\RuntimeException("Failed to access $uri, got response code " . $response->getStatusCode()); + throw new Exception\RuntimeException( + "Failed to access $uri, got response code " . $response->getStatusCode() + ); } $responseHtml = $response->getBody(); $libxmlErrflag = libxml_use_internal_errors(true); @@ -393,7 +403,7 @@ $status = $dom->loadHTML(trim($responseHtml)); libxml_disable_entity_loader($oldValue); libxml_use_internal_errors($libxmlErrflag); - if (!$status) { + if (! $status) { // Build error message $error = libxml_get_last_error(); if ($error && $error->message) { @@ -425,8 +435,8 @@ $dom = $feed->getDomDocument(); } elseif ($feed instanceof DOMDocument) { $dom = $feed; - } elseif (is_string($feed) && !empty($feed)) { - ErrorHandler::start(E_NOTICE|E_WARNING); + } elseif (is_string($feed) && ! empty($feed)) { + ErrorHandler::start(E_NOTICE | E_WARNING); ini_set('track_errors', 1); $oldValue = libxml_disable_entity_loader(true); $dom = new DOMDocument; @@ -441,8 +451,8 @@ libxml_disable_entity_loader($oldValue); ini_restore('track_errors'); ErrorHandler::stop(); - if (!$status) { - if (!isset($phpErrormsg)) { + if (! $status) { + if (! isset($phpErrormsg)) { if (function_exists('xdebug_is_enabled')) { $phpErrormsg = '(error message not available, when XDebug is running)'; } else { @@ -552,7 +562,7 @@ */ public static function getExtensionManager() { - if (!isset(static::$extensionManager)) { + if (! isset(static::$extensionManager)) { static::setExtensionManager(new StandaloneExtensionManager()); } return static::$extensionManager; @@ -576,7 +586,7 @@ } } - if (!$manager->has($feedName) && !$manager->has($entryName)) { + if (! $manager->has($feedName) && ! $manager->has($entryName)) { throw new Exception\RuntimeException('Could not load extension: ' . $name . ' using Plugin Loader. Check prefix paths are configured and extension exists.'); } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Reader/StandaloneExtensionManager.php --- a/vendor/zendframework/zend-feed/src/Reader/StandaloneExtensionManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Reader/StandaloneExtensionManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -9,22 +9,24 @@ namespace Zend\Feed\Reader; +use Zend\Feed\Reader\Exception\InvalidArgumentException; + class StandaloneExtensionManager implements ExtensionManagerInterface { private $extensions = [ - 'Atom\Entry' => 'Zend\Feed\Reader\Extension\Atom\Entry', - 'Atom\Feed' => 'Zend\Feed\Reader\Extension\Atom\Feed', - 'Content\Entry' => 'Zend\Feed\Reader\Extension\Content\Entry', - 'CreativeCommons\Entry' => 'Zend\Feed\Reader\Extension\CreativeCommons\Entry', - 'CreativeCommons\Feed' => 'Zend\Feed\Reader\Extension\CreativeCommons\Feed', - 'DublinCore\Entry' => 'Zend\Feed\Reader\Extension\DublinCore\Entry', - 'DublinCore\Feed' => 'Zend\Feed\Reader\Extension\DublinCore\Feed', - 'Podcast\Entry' => 'Zend\Feed\Reader\Extension\Podcast\Entry', - 'Podcast\Feed' => 'Zend\Feed\Reader\Extension\Podcast\Feed', - 'Slash\Entry' => 'Zend\Feed\Reader\Extension\Slash\Entry', - 'Syndication\Feed' => 'Zend\Feed\Reader\Extension\Syndication\Feed', - 'Thread\Entry' => 'Zend\Feed\Reader\Extension\Thread\Entry', - 'WellFormedWeb\Entry' => 'Zend\Feed\Reader\Extension\WellFormedWeb\Entry', + 'Atom\Entry' => Extension\Atom\Entry::class, + 'Atom\Feed' => Extension\Atom\Feed::class, + 'Content\Entry' => Extension\Content\Entry::class, + 'CreativeCommons\Entry' => Extension\CreativeCommons\Entry::class, + 'CreativeCommons\Feed' => Extension\CreativeCommons\Feed::class, + 'DublinCore\Entry' => Extension\DublinCore\Entry::class, + 'DublinCore\Feed' => Extension\DublinCore\Feed::class, + 'Podcast\Entry' => Extension\Podcast\Entry::class, + 'Podcast\Feed' => Extension\Podcast\Feed::class, + 'Slash\Entry' => Extension\Slash\Entry::class, + 'Syndication\Feed' => Extension\Syndication\Feed::class, + 'Thread\Entry' => Extension\Thread\Entry::class, + 'WellFormedWeb\Entry' => Extension\WellFormedWeb\Entry::class, ]; /** @@ -49,4 +51,40 @@ $class = $this->extensions[$extension]; return new $class(); } + + /** + * Add an extension. + * + * @param string $name + * @param string $class + */ + public function add($name, $class) + { + if (is_string($class) + && ( + is_a($class, Extension\AbstractEntry::class, true) + || is_a($class, Extension\AbstractFeed::class, true) + ) + ) { + $this->extensions[$name] = $class; + return; + } + + throw new InvalidArgumentException(sprintf( + 'Plugin of type %s is invalid; must implement %2$s\Extension\AbstractFeed ' + . 'or %2$s\Extension\AbstractEntry', + $class, + __NAMESPACE__ + )); + } + + /** + * Remove an extension. + * + * @param string $name + */ + public function remove($name) + { + unset($this->extensions[$name]); + } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Uri.php --- a/vendor/zendframework/zend-feed/src/Uri.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Uri.php Fri Feb 23 15:52:07 2018 +0000 @@ -76,13 +76,13 @@ return; } - $this->scheme = isset($parsed['scheme']) ? $parsed['scheme'] : null; - $this->host = isset($parsed['host']) ? $parsed['host'] : null; - $this->port = isset($parsed['port']) ? $parsed['port'] : null; - $this->user = isset($parsed['user']) ? $parsed['user'] : null; - $this->pass = isset($parsed['pass']) ? $parsed['pass'] : null; - $this->path = isset($parsed['path']) ? $parsed['path'] : null; - $this->query = isset($parsed['query']) ? $parsed['query'] : null; + $this->scheme = isset($parsed['scheme']) ? $parsed['scheme'] : null; + $this->host = isset($parsed['host']) ? $parsed['host'] : null; + $this->port = isset($parsed['port']) ? $parsed['port'] : null; + $this->user = isset($parsed['user']) ? $parsed['user'] : null; + $this->pass = isset($parsed['pass']) ? $parsed['pass'] : null; + $this->path = isset($parsed['path']) ? $parsed['path'] : null; + $this->query = isset($parsed['query']) ? $parsed['query'] : null; $this->fragment = isset($parsed['fragment']) ? $parsed['fragment'] : null; } @@ -140,7 +140,7 @@ return false; } - if ($this->scheme && !in_array($this->scheme, $this->validSchemes)) { + if ($this->scheme && ! in_array($this->scheme, $this->validSchemes)) { return false; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/AbstractFeed.php --- a/vendor/zendframework/zend-feed/src/Writer/AbstractFeed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/AbstractFeed.php Fri Feb 23 15:52:07 2018 +0000 @@ -61,26 +61,29 @@ public function addAuthor(array $author) { // Check array values - if (!array_key_exists('name', $author) + if (! array_key_exists('name', $author) || empty($author['name']) - || !is_string($author['name']) + || ! is_string($author['name']) ) { throw new Exception\InvalidArgumentException( - 'Invalid parameter: author array must include a "name" key with a non-empty string value'); + 'Invalid parameter: author array must include a "name" key with a non-empty string value' + ); } if (isset($author['email'])) { - if (empty($author['email']) || !is_string($author['email'])) { + if (empty($author['email']) || ! is_string($author['email'])) { throw new Exception\InvalidArgumentException( - 'Invalid parameter: "email" array value must be a non-empty string'); + 'Invalid parameter: "email" array value must be a non-empty string' + ); } } if (isset($author['uri'])) { - if (empty($author['uri']) || !is_string($author['uri']) || - !Uri::factory($author['uri'])->isValid() + if (empty($author['uri']) || ! is_string($author['uri']) || + ! Uri::factory($author['uri'])->isValid() ) { throw new Exception\InvalidArgumentException( - 'Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI'); + 'Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI' + ); } } @@ -114,7 +117,7 @@ */ public function setCopyright($copyright) { - if (empty($copyright) || !is_string($copyright)) { + if (empty($copyright) || ! is_string($copyright)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['copyright'] = $copyright; @@ -135,7 +138,7 @@ $date = new DateTime(); } elseif (is_int($date)) { $date = new DateTime('@' . $date); - } elseif (!$date instanceof DateTime) { + } elseif (! $date instanceof DateTime) { throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp' . ' passed as parameter'); } @@ -157,7 +160,7 @@ $date = new DateTime(); } elseif (is_int($date)) { $date = new DateTime('@' . $date); - } elseif (!$date instanceof DateTime) { + } elseif (! $date instanceof DateTime) { throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp' . ' passed as parameter'); } @@ -179,7 +182,7 @@ $date = new DateTime(); } elseif (is_int($date)) { $date = new DateTime('@' . $date); - } elseif (!$date instanceof DateTime) { + } elseif (! $date instanceof DateTime) { throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp' . ' passed as parameter'); } @@ -197,7 +200,7 @@ */ public function setDescription($description) { - if (empty($description) || !is_string($description)) { + if (empty($description) || ! is_string($description)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['description'] = $description; @@ -218,36 +221,44 @@ { if (is_array($name)) { $data = $name; - if (empty($data['name']) || !is_string($data['name'])) { + if (empty($data['name']) || ! is_string($data['name'])) { throw new Exception\InvalidArgumentException('Invalid parameter: "name" must be a non-empty string'); } $generator = ['name' => $data['name']]; if (isset($data['version'])) { - if (empty($data['version']) || !is_string($data['version'])) { - throw new Exception\InvalidArgumentException('Invalid parameter: "version" must be a non-empty string'); + if (empty($data['version']) || ! is_string($data['version'])) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "version" must be a non-empty string' + ); } $generator['version'] = $data['version']; } if (isset($data['uri'])) { - if (empty($data['uri']) || !is_string($data['uri']) || !Uri::factory($data['uri'])->isValid()) { - throw new Exception\InvalidArgumentException('Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI'); + if (empty($data['uri']) || ! is_string($data['uri']) || ! Uri::factory($data['uri'])->isValid()) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI' + ); } $generator['uri'] = $data['uri']; } } else { - if (empty($name) || !is_string($name)) { + if (empty($name) || ! is_string($name)) { throw new Exception\InvalidArgumentException('Invalid parameter: "name" must be a non-empty string'); } $generator = ['name' => $name]; if (isset($version)) { - if (empty($version) || !is_string($version)) { - throw new Exception\InvalidArgumentException('Invalid parameter: "version" must be a non-empty string'); + if (empty($version) || ! is_string($version)) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "version" must be a non-empty string' + ); } $generator['version'] = $version; } if (isset($uri)) { - if (empty($uri) || !is_string($uri) || !Uri::factory($uri)->isValid()) { - throw new Exception\InvalidArgumentException('Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI'); + if (empty($uri) || ! is_string($uri) || ! Uri::factory($uri)->isValid()) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI' + ); } $generator['uri'] = $uri; } @@ -266,11 +277,15 @@ */ public function setId($id) { - if ((empty($id) || !is_string($id) || !Uri::factory($id)->isValid()) - && !preg_match("#^urn:[a-zA-Z0-9][a-zA-Z0-9\-]{1,31}:([a-zA-Z0-9\(\)\+\,\.\:\=\@\;\$\_\!\*\-]|%[0-9a-fA-F]{2})*#", $id) - && !$this->_validateTagUri($id) + // @codingStandardsIgnoreStart + if ((empty($id) || ! is_string($id) || ! Uri::factory($id)->isValid()) + && ! preg_match("#^urn:[a-zA-Z0-9][a-zA-Z0-9\-]{1,31}:([a-zA-Z0-9\(\)\+\,\.\:\=\@\;\$\_\!\*\-]|%[0-9a-fA-F]{2})*#", $id) + && ! $this->_validateTagUri($id) ) { - throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string and valid URI/IRI'); + // @codingStandardsIgnoreEnd + throw new Exception\InvalidArgumentException( + 'Invalid parameter: parameter must be a non-empty string and valid URI/IRI' + ); } $this->data['id'] = $id; @@ -283,9 +298,15 @@ * @param string $id * @return bool */ + // @codingStandardsIgnoreStart protected function _validateTagUri($id) { - if (preg_match('/^tag:(?P.*),(?P\d{4}-?\d{0,2}-?\d{0,2}):(?P.*)(.*:)*$/', $id, $matches)) { + // @codingStandardsIgnoreEnd + if (preg_match( + '/^tag:(?P.*),(?P\d{4}-?\d{0,2}-?\d{0,2}):(?P.*)(.*:)*$/', + $id, + $matches + )) { $dvalid = false; $date = $matches['date']; $d6 = strtotime($date); @@ -319,8 +340,8 @@ */ public function setImage(array $data) { - if (empty($data['uri']) || !is_string($data['uri']) - || !Uri::factory($data['uri'])->isValid() + if (empty($data['uri']) || ! is_string($data['uri']) + || ! Uri::factory($data['uri'])->isValid() ) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter \'uri\'' . ' must be a non-empty string and valid URI/IRI'); @@ -339,7 +360,7 @@ */ public function setLanguage($language) { - if (empty($language) || !is_string($language)) { + if (empty($language) || ! is_string($language)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['language'] = $language; @@ -356,8 +377,10 @@ */ public function setLink($link) { - if (empty($link) || !is_string($link) || !Uri::factory($link)->isValid()) { - throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string and valid URI/IRI'); + if (empty($link) || ! is_string($link) || ! Uri::factory($link)->isValid()) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: parameter must be a non-empty string and valid URI/IRI' + ); } $this->data['link'] = $link; @@ -374,11 +397,15 @@ */ public function setFeedLink($link, $type) { - if (empty($link) || !is_string($link) || !Uri::factory($link)->isValid()) { - throw new Exception\InvalidArgumentException('Invalid parameter: "link"" must be a non-empty string and valid URI/IRI'); + if (empty($link) || ! is_string($link) || ! Uri::factory($link)->isValid()) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "link"" must be a non-empty string and valid URI/IRI' + ); } - if (!in_array(strtolower($type), ['rss', 'rdf', 'atom'])) { - throw new Exception\InvalidArgumentException('Invalid parameter: "type"; You must declare the type of feed the link points to, i.e. RSS, RDF or Atom'); + if (! in_array(strtolower($type), ['rss', 'rdf', 'atom'])) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "type"; You must declare the type of feed the link points to, i.e. RSS, RDF or Atom' + ); } $this->data['feedLinks'][strtolower($type)] = $link; @@ -394,7 +421,7 @@ */ public function setTitle($title) { - if (empty($title) || !is_string($title)) { + if (empty($title) || ! is_string($title)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['title'] = $title; @@ -411,7 +438,7 @@ */ public function setEncoding($encoding) { - if (empty($encoding) || !is_string($encoding)) { + if (empty($encoding) || ! is_string($encoding)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['encoding'] = $encoding; @@ -428,7 +455,7 @@ */ public function setBaseUrl($url) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter: "url" array value' . ' must be a non-empty string and valid URI/IRI'); } @@ -446,11 +473,11 @@ */ public function addHub($url) { - if (empty($url) || !is_string($url) || !Uri::factory($url)->isValid()) { + if (empty($url) || ! is_string($url) || ! Uri::factory($url)->isValid()) { throw new Exception\InvalidArgumentException('Invalid parameter: "url" array value' . ' must be a non-empty string and valid URI/IRI'); } - if (!isset($this->data['hubs'])) { + if (! isset($this->data['hubs'])) { $this->data['hubs'] = []; } $this->data['hubs'][] = $url; @@ -482,21 +509,21 @@ */ public function addCategory(array $category) { - if (!isset($category['term'])) { + if (! isset($category['term'])) { throw new Exception\InvalidArgumentException('Each category must be an array and ' . 'contain at least a "term" element containing the machine ' . ' readable category name'); } if (isset($category['scheme'])) { if (empty($category['scheme']) - || !is_string($category['scheme']) - || !Uri::factory($category['scheme'])->isValid() + || ! is_string($category['scheme']) + || ! Uri::factory($category['scheme'])->isValid() ) { throw new Exception\InvalidArgumentException('The Atom scheme or RSS domain of' . ' a category must be a valid URI'); } } - if (!isset($this->data['categories'])) { + if (! isset($this->data['categories'])) { $this->data['categories'] = []; } $this->data['categories'][] = $category; @@ -541,7 +568,7 @@ */ public function getAuthors() { - if (!array_key_exists('authors', $this->data)) { + if (! array_key_exists('authors', $this->data)) { return; } return $this->data['authors']; @@ -554,7 +581,7 @@ */ public function getCopyright() { - if (!array_key_exists('copyright', $this->data)) { + if (! array_key_exists('copyright', $this->data)) { return; } return $this->data['copyright']; @@ -567,7 +594,7 @@ */ public function getDateCreated() { - if (!array_key_exists('dateCreated', $this->data)) { + if (! array_key_exists('dateCreated', $this->data)) { return; } return $this->data['dateCreated']; @@ -580,7 +607,7 @@ */ public function getDateModified() { - if (!array_key_exists('dateModified', $this->data)) { + if (! array_key_exists('dateModified', $this->data)) { return; } return $this->data['dateModified']; @@ -593,7 +620,7 @@ */ public function getLastBuildDate() { - if (!array_key_exists('lastBuildDate', $this->data)) { + if (! array_key_exists('lastBuildDate', $this->data)) { return; } return $this->data['lastBuildDate']; @@ -606,7 +633,7 @@ */ public function getDescription() { - if (!array_key_exists('description', $this->data)) { + if (! array_key_exists('description', $this->data)) { return; } return $this->data['description']; @@ -619,7 +646,7 @@ */ public function getGenerator() { - if (!array_key_exists('generator', $this->data)) { + if (! array_key_exists('generator', $this->data)) { return; } return $this->data['generator']; @@ -632,7 +659,7 @@ */ public function getId() { - if (!array_key_exists('id', $this->data)) { + if (! array_key_exists('id', $this->data)) { return; } return $this->data['id']; @@ -645,7 +672,7 @@ */ public function getImage() { - if (!array_key_exists('image', $this->data)) { + if (! array_key_exists('image', $this->data)) { return; } return $this->data['image']; @@ -658,7 +685,7 @@ */ public function getLanguage() { - if (!array_key_exists('language', $this->data)) { + if (! array_key_exists('language', $this->data)) { return; } return $this->data['language']; @@ -671,7 +698,7 @@ */ public function getLink() { - if (!array_key_exists('link', $this->data)) { + if (! array_key_exists('link', $this->data)) { return; } return $this->data['link']; @@ -684,7 +711,7 @@ */ public function getFeedLinks() { - if (!array_key_exists('feedLinks', $this->data)) { + if (! array_key_exists('feedLinks', $this->data)) { return; } return $this->data['feedLinks']; @@ -697,7 +724,7 @@ */ public function getTitle() { - if (!array_key_exists('title', $this->data)) { + if (! array_key_exists('title', $this->data)) { return; } return $this->data['title']; @@ -710,7 +737,7 @@ */ public function getEncoding() { - if (!array_key_exists('encoding', $this->data)) { + if (! array_key_exists('encoding', $this->data)) { return 'UTF-8'; } return $this->data['encoding']; @@ -723,7 +750,7 @@ */ public function getBaseUrl() { - if (!array_key_exists('baseUrl', $this->data)) { + if (! array_key_exists('baseUrl', $this->data)) { return; } return $this->data['baseUrl']; @@ -736,7 +763,7 @@ */ public function getHubs() { - if (!array_key_exists('hubs', $this->data)) { + if (! array_key_exists('hubs', $this->data)) { return; } return $this->data['hubs']; @@ -749,7 +776,7 @@ */ public function getCategories() { - if (!array_key_exists('categories', $this->data)) { + if (! array_key_exists('categories', $this->data)) { return; } return $this->data['categories']; @@ -830,14 +857,18 @@ * @throws Exception\RuntimeException * @return void */ + // @codingStandardsIgnoreStart protected function _loadExtensions() { + // @codingStandardsIgnoreEnd $all = Writer::getExtensions(); $manager = Writer::getExtensionManager(); $exts = $all['feed']; foreach ($exts as $ext) { - if (!$manager->has($ext)) { - throw new Exception\RuntimeException(sprintf('Unable to load extension "%s"; could not resolve to class', $ext)); + if (! $manager->has($ext)) { + throw new Exception\RuntimeException( + sprintf('Unable to load extension "%s"; could not resolve to class', $ext) + ); } $this->extensions[$ext] = $manager->get($ext); $this->extensions[$ext]->setEncoding($this->getEncoding()); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Deleted.php --- a/vendor/zendframework/zend-feed/src/Writer/Deleted.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Deleted.php Fri Feb 23 15:52:07 2018 +0000 @@ -41,7 +41,7 @@ */ public function setEncoding($encoding) { - if (empty($encoding) || !is_string($encoding)) { + if (empty($encoding) || ! is_string($encoding)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['encoding'] = $encoding; @@ -56,7 +56,7 @@ */ public function getEncoding() { - if (!array_key_exists('encoding', $this->data)) { + if (! array_key_exists('encoding', $this->data)) { return 'UTF-8'; } return $this->data['encoding']; @@ -110,7 +110,7 @@ */ public function setReference($reference) { - if (empty($reference) || !is_string($reference)) { + if (empty($reference) || ! is_string($reference)) { throw new Exception\InvalidArgumentException('Invalid parameter: reference must be a non-empty string'); } $this->data['reference'] = $reference; @@ -123,7 +123,7 @@ */ public function getReference() { - if (!array_key_exists('reference', $this->data)) { + if (! array_key_exists('reference', $this->data)) { return; } return $this->data['reference']; @@ -142,7 +142,7 @@ $date = new DateTime(); } elseif (is_int($date)) { $date = new DateTime('@' . $date); - } elseif (!$date instanceof DateTime) { + } elseif (! $date instanceof DateTime) { throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp' . ' passed as parameter'); } @@ -156,7 +156,7 @@ */ public function getWhen() { - if (!array_key_exists('when', $this->data)) { + if (! array_key_exists('when', $this->data)) { return; } return $this->data['when']; @@ -172,16 +172,16 @@ public function setBy(array $by) { $author = []; - if (!array_key_exists('name', $by) + if (! array_key_exists('name', $by) || empty($by['name']) - || !is_string($by['name']) + || ! is_string($by['name']) ) { throw new Exception\InvalidArgumentException('Invalid parameter: author array must include a' . ' "name" key with a non-empty string value'); } $author['name'] = $by['name']; if (isset($by['email'])) { - if (empty($by['email']) || !is_string($by['email'])) { + if (empty($by['email']) || ! is_string($by['email'])) { throw new Exception\InvalidArgumentException('Invalid parameter: "email" array' . ' value must be a non-empty string'); } @@ -189,8 +189,8 @@ } if (isset($by['uri'])) { if (empty($by['uri']) - || !is_string($by['uri']) - || !Uri::factory($by['uri'])->isValid() + || ! is_string($by['uri']) + || ! Uri::factory($by['uri'])->isValid() ) { throw new Exception\InvalidArgumentException('Invalid parameter: "uri" array value must' . ' be a non-empty string and valid URI/IRI'); @@ -207,7 +207,7 @@ */ public function getBy() { - if (!array_key_exists('by', $this->data)) { + if (! array_key_exists('by', $this->data)) { return; } return $this->data['by']; @@ -228,7 +228,7 @@ */ public function getComment() { - if (!array_key_exists('comment', $this->data)) { + if (! array_key_exists('comment', $this->data)) { return; } return $this->data['comment']; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -64,26 +64,29 @@ public function addAuthor(array $author) { // Check array values - if (!array_key_exists('name', $author) + if (! array_key_exists('name', $author) || empty($author['name']) - || !is_string($author['name']) + || ! is_string($author['name']) ) { throw new Exception\InvalidArgumentException( - 'Invalid parameter: author array must include a "name" key with a non-empty string value'); + 'Invalid parameter: author array must include a "name" key with a non-empty string value' + ); } if (isset($author['email'])) { - if (empty($author['email']) || !is_string($author['email'])) { + if (empty($author['email']) || ! is_string($author['email'])) { throw new Exception\InvalidArgumentException( - 'Invalid parameter: "email" array value must be a non-empty string'); + 'Invalid parameter: "email" array value must be a non-empty string' + ); } } if (isset($author['uri'])) { - if (empty($author['uri']) || !is_string($author['uri']) || - !Uri::factory($author['uri'])->isValid() + if (empty($author['uri']) || ! is_string($author['uri']) || + ! Uri::factory($author['uri'])->isValid() ) { throw new Exception\InvalidArgumentException( - 'Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI'); + 'Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI' + ); } } @@ -117,7 +120,7 @@ */ public function setEncoding($encoding) { - if (empty($encoding) || !is_string($encoding)) { + if (empty($encoding) || ! is_string($encoding)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['encoding'] = $encoding; @@ -132,7 +135,7 @@ */ public function getEncoding() { - if (!array_key_exists('encoding', $this->data)) { + if (! array_key_exists('encoding', $this->data)) { return 'UTF-8'; } return $this->data['encoding']; @@ -147,7 +150,7 @@ */ public function setCopyright($copyright) { - if (empty($copyright) || !is_string($copyright)) { + if (empty($copyright) || ! is_string($copyright)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['copyright'] = $copyright; @@ -164,7 +167,7 @@ */ public function setContent($content) { - if (empty($content) || !is_string($content)) { + if (empty($content) || ! is_string($content)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['content'] = $content; @@ -185,8 +188,10 @@ $date = new DateTime(); } elseif (is_int($date)) { $date = new DateTime('@' . $date); - } elseif (!$date instanceof DateTime) { - throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp passed as parameter'); + } elseif (! $date instanceof DateTime) { + throw new Exception\InvalidArgumentException( + 'Invalid DateTime object or UNIX Timestamp passed as parameter' + ); } $this->data['dateCreated'] = $date; @@ -206,8 +211,10 @@ $date = new DateTime(); } elseif (is_int($date)) { $date = new DateTime('@' . $date); - } elseif (!$date instanceof DateTime) { - throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp passed as parameter'); + } elseif (! $date instanceof DateTime) { + throw new Exception\InvalidArgumentException( + 'Invalid DateTime object or UNIX Timestamp passed as parameter' + ); } $this->data['dateModified'] = $date; @@ -223,7 +230,7 @@ */ public function setDescription($description) { - if (empty($description) || !is_string($description)) { + if (empty($description) || ! is_string($description)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['description'] = $description; @@ -240,7 +247,7 @@ */ public function setId($id) { - if (empty($id) || !is_string($id)) { + if (empty($id) || ! is_string($id)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['id'] = $id; @@ -257,8 +264,10 @@ */ public function setLink($link) { - if (empty($link) || !is_string($link) || !Uri::factory($link)->isValid()) { - throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string and valid URI/IRI'); + if (empty($link) || ! is_string($link) || ! Uri::factory($link)->isValid()) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: parameter must be a non-empty string and valid URI/IRI' + ); } $this->data['link'] = $link; @@ -274,8 +283,10 @@ */ public function setCommentCount($count) { - if (!is_numeric($count) || (int) $count != $count || (int) $count < 0) { - throw new Exception\InvalidArgumentException('Invalid parameter: "count" must be a positive integer number or zero'); + if (! is_numeric($count) || (int) $count != $count || (int) $count < 0) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "count" must be a positive integer number or zero' + ); } $this->data['commentCount'] = (int) $count; @@ -291,8 +302,10 @@ */ public function setCommentLink($link) { - if (empty($link) || !is_string($link) || !Uri::factory($link)->isValid()) { - throw new Exception\InvalidArgumentException('Invalid parameter: "link" must be a non-empty string and valid URI/IRI'); + if (empty($link) || ! is_string($link) || ! Uri::factory($link)->isValid()) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "link" must be a non-empty string and valid URI/IRI' + ); } $this->data['commentLink'] = $link; @@ -308,14 +321,16 @@ */ public function setCommentFeedLink(array $link) { - if (!isset($link['uri']) || !is_string($link['uri']) || !Uri::factory($link['uri'])->isValid()) { - throw new Exception\InvalidArgumentException('Invalid parameter: "link" must be a non-empty string and valid URI/IRI'); + if (! isset($link['uri']) || ! is_string($link['uri']) || ! Uri::factory($link['uri'])->isValid()) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter: "link" must be a non-empty string and valid URI/IRI' + ); } - if (!isset($link['type']) || !in_array($link['type'], ['atom', 'rss', 'rdf'])) { + if (! isset($link['type']) || ! in_array($link['type'], ['atom', 'rss', 'rdf'])) { throw new Exception\InvalidArgumentException('Invalid parameter: "type" must be one' . ' of "atom", "rss" or "rdf"'); } - if (!isset($this->data['commentFeedLinks'])) { + if (! isset($this->data['commentFeedLinks'])) { $this->data['commentFeedLinks'] = []; } $this->data['commentFeedLinks'][] = $link; @@ -349,7 +364,7 @@ */ public function setTitle($title) { - if (empty($title) || !is_string($title)) { + if (empty($title) || ! is_string($title)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); } $this->data['title'] = $title; @@ -364,7 +379,7 @@ */ public function getAuthors() { - if (!array_key_exists('authors', $this->data)) { + if (! array_key_exists('authors', $this->data)) { return; } return $this->data['authors']; @@ -377,7 +392,7 @@ */ public function getContent() { - if (!array_key_exists('content', $this->data)) { + if (! array_key_exists('content', $this->data)) { return; } return $this->data['content']; @@ -390,7 +405,7 @@ */ public function getCopyright() { - if (!array_key_exists('copyright', $this->data)) { + if (! array_key_exists('copyright', $this->data)) { return; } return $this->data['copyright']; @@ -403,7 +418,7 @@ */ public function getDateCreated() { - if (!array_key_exists('dateCreated', $this->data)) { + if (! array_key_exists('dateCreated', $this->data)) { return; } return $this->data['dateCreated']; @@ -416,7 +431,7 @@ */ public function getDateModified() { - if (!array_key_exists('dateModified', $this->data)) { + if (! array_key_exists('dateModified', $this->data)) { return; } return $this->data['dateModified']; @@ -429,7 +444,7 @@ */ public function getDescription() { - if (!array_key_exists('description', $this->data)) { + if (! array_key_exists('description', $this->data)) { return; } return $this->data['description']; @@ -442,7 +457,7 @@ */ public function getId() { - if (!array_key_exists('id', $this->data)) { + if (! array_key_exists('id', $this->data)) { return; } return $this->data['id']; @@ -455,7 +470,7 @@ */ public function getLink() { - if (!array_key_exists('link', $this->data)) { + if (! array_key_exists('link', $this->data)) { return; } return $this->data['link']; @@ -469,7 +484,7 @@ */ public function getLinks() { - if (!array_key_exists('links', $this->data)) { + if (! array_key_exists('links', $this->data)) { return; } return $this->data['links']; @@ -482,7 +497,7 @@ */ public function getTitle() { - if (!array_key_exists('title', $this->data)) { + if (! array_key_exists('title', $this->data)) { return; } return $this->data['title']; @@ -495,7 +510,7 @@ */ public function getCommentCount() { - if (!array_key_exists('commentCount', $this->data)) { + if (! array_key_exists('commentCount', $this->data)) { return; } return $this->data['commentCount']; @@ -508,7 +523,7 @@ */ public function getCommentLink() { - if (!array_key_exists('commentLink', $this->data)) { + if (! array_key_exists('commentLink', $this->data)) { return; } return $this->data['commentLink']; @@ -522,7 +537,7 @@ */ public function getCommentFeedLinks() { - if (!array_key_exists('commentFeedLinks', $this->data)) { + if (! array_key_exists('commentFeedLinks', $this->data)) { return; } return $this->data['commentFeedLinks']; @@ -537,21 +552,21 @@ */ public function addCategory(array $category) { - if (!isset($category['term'])) { + if (! isset($category['term'])) { throw new Exception\InvalidArgumentException('Each category must be an array and ' . 'contain at least a "term" element containing the machine ' . ' readable category name'); } if (isset($category['scheme'])) { if (empty($category['scheme']) - || !is_string($category['scheme']) - || !Uri::factory($category['scheme'])->isValid() + || ! is_string($category['scheme']) + || ! Uri::factory($category['scheme'])->isValid() ) { throw new Exception\InvalidArgumentException('The Atom scheme or RSS domain of' . ' a category must be a valid URI'); } } - if (!isset($this->data['categories'])) { + if (! isset($this->data['categories'])) { $this->data['categories'] = []; } $this->data['categories'][] = $category; @@ -581,7 +596,7 @@ */ public function getCategories() { - if (!array_key_exists('categories', $this->data)) { + if (! array_key_exists('categories', $this->data)) { return; } return $this->data['categories']; @@ -599,10 +614,10 @@ */ public function setEnclosure(array $enclosure) { - if (!isset($enclosure['uri'])) { + if (! isset($enclosure['uri'])) { throw new Exception\InvalidArgumentException('Enclosure "uri" is not set'); } - if (!Uri::factory($enclosure['uri'])->isValid()) { + if (! Uri::factory($enclosure['uri'])->isValid()) { throw new Exception\InvalidArgumentException('Enclosure "uri" is not a valid URI/IRI'); } $this->data['enclosure'] = $enclosure; @@ -617,7 +632,7 @@ */ public function getEnclosure() { - if (!array_key_exists('enclosure', $this->data)) { + if (! array_key_exists('enclosure', $this->data)) { return; } return $this->data['enclosure']; @@ -752,8 +767,10 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _loadExtensions() { + // @codingStandardsIgnoreEnd $all = Writer::getExtensions(); $manager = Writer::getExtensionManager(); $exts = $all['entry']; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/AbstractRenderer.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/AbstractRenderer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/AbstractRenderer.php Fri Feb 23 15:52:07 2018 +0000 @@ -160,5 +160,7 @@ * * @return void */ + // @codingStandardsIgnoreStart abstract protected function _appendNamespaces(); + // @codingStandardsIgnoreEnd } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/Atom/Renderer/Feed.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/Atom/Renderer/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/Atom/Renderer/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -52,10 +52,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:atom', - 'http://www.w3.org/2005/Atom'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:atom', + 'http://www.w3.org/2005/Atom' + ); } /** @@ -65,10 +69,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $flinks = $this->getDataContainer()->getFeedLinks(); - if (!$flinks || empty($flinks)) { + if (! $flinks || empty($flinks)) { return; } foreach ($flinks as $type => $href) { @@ -91,10 +97,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setHubs(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $hubs = $this->getDataContainer()->getHubs(); - if (!$hubs || empty($hubs)) { + if (! $hubs || empty($hubs)) { return; } foreach ($hubs as $hubUrl) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/Content/Renderer/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/Content/Renderer/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/Content/Renderer/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,10 +47,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:content', - 'http://purl.org/rss/1.0/modules/content/'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:content', + 'http://purl.org/rss/1.0/modules/content/' + ); } /** @@ -60,10 +64,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setContent(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $content = $this->getDataContainer()->getContent(); - if (!$content) { + if (! $content) { return; } $element = $dom->createElement('content:encoded'); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/DublinCore/Renderer/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/DublinCore/Renderer/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/DublinCore/Renderer/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,10 +47,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:dc', - 'http://purl.org/dc/elements/1.1/'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:dc', + 'http://purl.org/dc/elements/1.1/' + ); } /** @@ -60,10 +64,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->getDataContainer()->getAuthors(); - if (!$authors || empty($authors)) { + if (! $authors || empty($authors)) { return; } foreach ($authors as $data) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/DublinCore/Renderer/Feed.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/DublinCore/Renderer/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/DublinCore/Renderer/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,10 +47,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:dc', - 'http://purl.org/dc/elements/1.1/'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:dc', + 'http://purl.org/dc/elements/1.1/' + ); } /** @@ -60,10 +64,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->getDataContainer()->getAuthors(); - if (!$authors || empty($authors)) { + if (! $authors || empty($authors)) { return; } foreach ($authors as $data) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -10,7 +10,6 @@ namespace Zend\Feed\Writer\Extension\ITunes; use Zend\Feed\Writer; -use Zend\Feed\Writer\Extension; use Zend\Stdlib\StringUtils; use Zend\Stdlib\StringWrapper\StringWrapperInterface; @@ -76,7 +75,7 @@ */ public function setItunesBlock($value) { - if (!ctype_alpha($value) && strlen($value) > 0) { + if (! ctype_alpha($value) && strlen($value) > 0) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "block" may only' . ' contain alphabetic characters'); } @@ -115,7 +114,7 @@ throw new Writer\Exception\InvalidArgumentException('invalid parameter: any "author" may only' . ' contain a maximum of 255 characters each'); } - if (!isset($this->data['authors'])) { + if (! isset($this->data['authors'])) { $this->data['authors'] = []; } $this->data['authors'][] = $value; @@ -132,9 +131,9 @@ public function setItunesDuration($value) { $value = (string) $value; - if (!ctype_digit($value) - && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value) - && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value) + if (! ctype_digit($value) + && ! preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value) + && ! preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value) ) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "duration" may only' . ' be of a specified [[HH:]MM:]SS format'); @@ -152,7 +151,7 @@ */ public function setItunesExplicit($value) { - if (!in_array($value, ['yes', 'no', 'clean'])) { + if (! in_array($value, ['yes', 'no', 'clean'])) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "explicit" may only' . ' be one of "yes", "no" or "clean"'); } @@ -229,14 +228,14 @@ public function __call($method, array $params) { $point = lcfirst(substr($method, 9)); - if (!method_exists($this, 'setItunes' . ucfirst($point)) - && !method_exists($this, 'addItunes' . ucfirst($point)) + if (! method_exists($this, 'setItunes' . ucfirst($point)) + && ! method_exists($this, 'addItunes' . ucfirst($point)) ) { throw new Writer\Exception\BadMethodCallException( 'invalid method: ' . $method ); } - if (!array_key_exists($point, $this->data) + if (! array_key_exists($point, $this->data) || empty($this->data[$point]) ) { return; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Feed.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -77,7 +77,7 @@ */ public function setItunesBlock($value) { - if (!ctype_alpha($value) && strlen($value) > 0) { + if (! ctype_alpha($value) && strlen($value) > 0) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "block" may only' . ' contain alphabetic characters'); } @@ -116,7 +116,7 @@ throw new Writer\Exception\InvalidArgumentException('invalid parameter: any "author" may only' . ' contain a maximum of 255 characters each'); } - if (!isset($this->data['authors'])) { + if (! isset($this->data['authors'])) { $this->data['authors'] = []; } $this->data['authors'][] = $value; @@ -132,11 +132,11 @@ */ public function setItunesCategories(array $values) { - if (!isset($this->data['categories'])) { + if (! isset($this->data['categories'])) { $this->data['categories'] = []; } foreach ($values as $key => $value) { - if (!is_array($value)) { + if (! is_array($value)) { if ($this->stringWrapper->strlen($value) > 255) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: any "category" may only' . ' contain a maximum of 255 characters each'); @@ -169,11 +169,11 @@ */ public function setItunesImage($value) { - if (!Uri::factory($value)->isValid()) { + if (! Uri::factory($value)->isValid()) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "image" may only' . ' be a valid URI/IRI'); } - if (!in_array(substr($value, -3), ['jpg', 'png'])) { + if (! in_array(substr($value, -3), ['jpg', 'png'])) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "image" may only' . ' use file extension "jpg" or "png" which must be the last three' . ' characters of the URI (i.e. no query string or fragment)'); @@ -192,9 +192,9 @@ public function setItunesDuration($value) { $value = (string) $value; - if (!ctype_digit($value) - && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value) - && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value) + if (! ctype_digit($value) + && ! preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value) + && ! preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value) ) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "duration" may only' . ' be of a specified [[HH:]MM:]SS format'); @@ -212,7 +212,7 @@ */ public function setItunesExplicit($value) { - if (!in_array($value, ['yes', 'no', 'clean'])) { + if (! in_array($value, ['yes', 'no', 'clean'])) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "explicit" may only' . ' be one of "yes", "no" or "clean"'); } @@ -252,7 +252,7 @@ */ public function setItunesNewFeedUrl($value) { - if (!Uri::factory($value)->isValid()) { + if (! Uri::factory($value)->isValid()) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: "newFeedUrl" may only' . ' be a valid URI/IRI'); } @@ -283,7 +283,7 @@ */ public function addItunesOwner(array $value) { - if (!isset($value['name']) || !isset($value['email'])) { + if (! isset($value['name']) || ! isset($value['email'])) { throw new Writer\Exception\InvalidArgumentException('invalid parameter: any "owner" must' . ' be an array containing keys "name" and "email"'); } @@ -293,7 +293,7 @@ throw new Writer\Exception\InvalidArgumentException('invalid parameter: any "owner" may only' . ' contain a maximum of 255 characters each for "name" and "email"'); } - if (!isset($this->data['owners'])) { + if (! isset($this->data['owners'])) { $this->data['owners'] = []; } $this->data['owners'][] = $value; @@ -345,14 +345,14 @@ public function __call($method, array $params) { $point = lcfirst(substr($method, 9)); - if (!method_exists($this, 'setItunes' . ucfirst($point)) - && !method_exists($this, 'addItunes' . ucfirst($point)) + if (! method_exists($this, 'setItunes' . ucfirst($point)) + && ! method_exists($this, 'addItunes' . ucfirst($point)) ) { throw new Writer\Exception\BadMethodCallException( 'invalid method: ' . $method ); } - if (!array_key_exists($point, $this->data) || empty($this->data[$point])) { + if (! array_key_exists($point, $this->data) || empty($this->data[$point])) { return; } return $this->data[$point]; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -50,10 +50,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:itunes', - 'http://www.itunes.com/dtds/podcast-1.0.dtd'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:itunes', + 'http://www.itunes.com/dtds/podcast-1.0.dtd' + ); } /** @@ -63,10 +67,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->getDataContainer()->getItunesAuthors(); - if (!$authors || empty($authors)) { + if (! $authors || empty($authors)) { return; } foreach ($authors as $author) { @@ -85,8 +91,10 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setBlock(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $block = $this->getDataContainer()->getItunesBlock(); if ($block === null) { return; @@ -105,10 +113,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDuration(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $duration = $this->getDataContainer()->getItunesDuration(); - if (!$duration) { + if (! $duration) { return; } $el = $dom->createElement('itunes:duration'); @@ -125,8 +135,10 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setExplicit(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $explicit = $this->getDataContainer()->getItunesExplicit(); if ($explicit === null) { return; @@ -145,10 +157,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setKeywords(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $keywords = $this->getDataContainer()->getItunesKeywords(); - if (!$keywords || empty($keywords)) { + if (! $keywords || empty($keywords)) { return; } $el = $dom->createElement('itunes:keywords'); @@ -165,10 +179,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setSubtitle(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $subtitle = $this->getDataContainer()->getItunesSubtitle(); - if (!$subtitle) { + if (! $subtitle) { return; } $el = $dom->createElement('itunes:subtitle'); @@ -185,10 +201,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setSummary(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $summary = $this->getDataContainer()->getItunesSummary(); - if (!$summary) { + if (! $summary) { return; } $el = $dom->createElement('itunes:summary'); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Feed.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Renderer/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -54,10 +54,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:itunes', - 'http://www.itunes.com/dtds/podcast-1.0.dtd'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:itunes', + 'http://www.itunes.com/dtds/podcast-1.0.dtd' + ); } /** @@ -67,10 +71,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->getDataContainer()->getItunesAuthors(); - if (!$authors || empty($authors)) { + if (! $authors || empty($authors)) { return; } foreach ($authors as $author) { @@ -89,8 +95,10 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setBlock(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $block = $this->getDataContainer()->getItunesBlock(); if ($block === null) { return; @@ -109,14 +117,16 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCategories(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $cats = $this->getDataContainer()->getItunesCategories(); - if (!$cats || empty($cats)) { + if (! $cats || empty($cats)) { return; } foreach ($cats as $key => $cat) { - if (!is_array($cat)) { + if (! is_array($cat)) { $el = $dom->createElement('itunes:category'); $el->setAttribute('text', $cat); $root->appendChild($el); @@ -141,10 +151,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setImage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $image = $this->getDataContainer()->getItunesImage(); - if (!$image) { + if (! $image) { return; } $el = $dom->createElement('itunes:image'); @@ -160,10 +172,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDuration(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $duration = $this->getDataContainer()->getItunesDuration(); - if (!$duration) { + if (! $duration) { return; } $el = $dom->createElement('itunes:duration'); @@ -180,8 +194,10 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setExplicit(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $explicit = $this->getDataContainer()->getItunesExplicit(); if ($explicit === null) { return; @@ -200,10 +216,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setKeywords(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $keywords = $this->getDataContainer()->getItunesKeywords(); - if (!$keywords || empty($keywords)) { + if (! $keywords || empty($keywords)) { return; } $el = $dom->createElement('itunes:keywords'); @@ -220,10 +238,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setNewFeedUrl(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $url = $this->getDataContainer()->getItunesNewFeedUrl(); - if (!$url) { + if (! $url) { return; } $el = $dom->createElement('itunes:new-feed-url'); @@ -240,10 +260,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setOwners(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $owners = $this->getDataContainer()->getItunesOwners(); - if (!$owners || empty($owners)) { + if (! $owners || empty($owners)) { return; } foreach ($owners as $owner) { @@ -268,10 +290,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setSubtitle(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $subtitle = $this->getDataContainer()->getItunesSubtitle(); - if (!$subtitle) { + if (! $subtitle) { return; } $el = $dom->createElement('itunes:subtitle'); @@ -288,10 +312,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setSummary(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $summary = $this->getDataContainer()->getItunesSummary(); - if (!$summary) { + if (! $summary) { return; } $el = $dom->createElement('itunes:summary'); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/Slash/Renderer/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/Slash/Renderer/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/Slash/Renderer/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,10 +47,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:slash', - 'http://purl.org/rss/1.0/modules/slash/'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:slash', + 'http://purl.org/rss/1.0/modules/slash/' + ); } /** @@ -60,10 +64,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCommentCount(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $count = $this->getDataContainer()->getCommentCount(); - if (!$count) { + if (! $count) { $count = 0; } $tcount = $this->dom->createElement('slash:comments'); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/Threading/Renderer/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/Threading/Renderer/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/Threading/Renderer/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -49,10 +49,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:thr', - 'http://purl.org/syndication/thread/1.0'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:thr', + 'http://purl.org/syndication/thread/1.0' + ); } /** @@ -62,10 +66,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCommentLink(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $link = $this->getDataContainer()->getCommentLink(); - if (!$link) { + if (! $link) { return; } $clink = $this->dom->createElement('link'); @@ -87,10 +93,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $links = $this->getDataContainer()->getCommentFeedLinks(); - if (!$links || empty($links)) { + if (! $links || empty($links)) { return; } foreach ($links as $link) { @@ -114,8 +122,10 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCommentCount(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $count = $this->getDataContainer()->getCommentCount(); if ($count === null) { return; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Extension/WellFormedWeb/Renderer/Entry.php --- a/vendor/zendframework/zend-feed/src/Writer/Extension/WellFormedWeb/Renderer/Entry.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/WellFormedWeb/Renderer/Entry.php Fri Feb 23 15:52:07 2018 +0000 @@ -47,10 +47,14 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _appendNamespaces() { - $this->getRootElement()->setAttribute('xmlns:wfw', - 'http://wellformedweb.org/CommentAPI/'); + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:wfw', + 'http://wellformedweb.org/CommentAPI/' + ); } /** @@ -60,10 +64,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $links = $this->getDataContainer()->getCommentFeedLinks(); - if (!$links || empty($links)) { + if (! $links || empty($links)) { return; } foreach ($links as $link) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/ExtensionManager.php --- a/vendor/zendframework/zend-feed/src/Writer/ExtensionManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/ExtensionManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -46,7 +46,7 @@ */ public function __call($method, $args) { - if (!method_exists($this->pluginManager, $method)) { + if (! method_exists($this->pluginManager, $method)) { throw new Exception\BadMethodCallException(sprintf( 'Method by name of %s does not exist in %s', $method, diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/ExtensionPluginManager.php --- a/vendor/zendframework/zend-feed/src/Writer/ExtensionPluginManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/ExtensionPluginManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -18,7 +18,7 @@ * * Validation checks that we have an Entry, Feed, or Extension\AbstractRenderer. */ -class ExtensionPluginManager extends AbstractPluginManager +class ExtensionPluginManager extends AbstractPluginManager implements ExtensionManagerInterface { /** * Aliases for default set of extension classes @@ -29,40 +29,62 @@ 'atomrendererfeed' => Extension\Atom\Renderer\Feed::class, 'atomRendererFeed' => Extension\Atom\Renderer\Feed::class, 'AtomRendererFeed' => Extension\Atom\Renderer\Feed::class, + 'AtomRenderer\Feed' => Extension\Atom\Renderer\Feed::class, + 'Atom\Renderer\Feed' => Extension\Atom\Renderer\Feed::class, 'contentrendererentry' => Extension\Content\Renderer\Entry::class, 'contentRendererEntry' => Extension\Content\Renderer\Entry::class, 'ContentRendererEntry' => Extension\Content\Renderer\Entry::class, + 'ContentRenderer\Entry' => Extension\Content\Renderer\Entry::class, + 'Content\Renderer\Entry' => Extension\Content\Renderer\Entry::class, 'dublincorerendererentry' => Extension\DublinCore\Renderer\Entry::class, 'dublinCoreRendererEntry' => Extension\DublinCore\Renderer\Entry::class, 'DublinCoreRendererEntry' => Extension\DublinCore\Renderer\Entry::class, + 'DublinCoreRenderer\Entry' => Extension\DublinCore\Renderer\Entry::class, + 'DublinCore\Renderer\Entry' => Extension\DublinCore\Renderer\Entry::class, 'dublincorerendererfeed' => Extension\DublinCore\Renderer\Feed::class, 'dublinCoreRendererFeed' => Extension\DublinCore\Renderer\Feed::class, 'DublinCoreRendererFeed' => Extension\DublinCore\Renderer\Feed::class, + 'DublinCoreRenderer\Feed' => Extension\DublinCore\Renderer\Feed::class, + 'DublinCore\Renderer\Feed' => Extension\DublinCore\Renderer\Feed::class, 'itunesentry' => Extension\ITunes\Entry::class, 'itunesEntry' => Extension\ITunes\Entry::class, 'iTunesEntry' => Extension\ITunes\Entry::class, 'ItunesEntry' => Extension\ITunes\Entry::class, + 'Itunes\Entry' => Extension\ITunes\Entry::class, + 'ITunes\Entry' => Extension\ITunes\Entry::class, 'itunesfeed' => Extension\ITunes\Feed::class, 'itunesFeed' => Extension\ITunes\Feed::class, 'iTunesFeed' => Extension\ITunes\Feed::class, 'ItunesFeed' => Extension\ITunes\Feed::class, + 'Itunes\Feed' => Extension\ITunes\Feed::class, + 'ITunes\Feed' => Extension\ITunes\Feed::class, 'itunesrendererentry' => Extension\ITunes\Renderer\Entry::class, 'itunesRendererEntry' => Extension\ITunes\Renderer\Entry::class, 'iTunesRendererEntry' => Extension\ITunes\Renderer\Entry::class, 'ItunesRendererEntry' => Extension\ITunes\Renderer\Entry::class, + 'ItunesRenderer\Entry' => Extension\ITunes\Renderer\Entry::class, + 'ITunes\Renderer\Entry' => Extension\ITunes\Renderer\Entry::class, 'itunesrendererfeed' => Extension\ITunes\Renderer\Feed::class, 'itunesRendererFeed' => Extension\ITunes\Renderer\Feed::class, 'iTunesRendererFeed' => Extension\ITunes\Renderer\Feed::class, 'ItunesRendererFeed' => Extension\ITunes\Renderer\Feed::class, + 'ItunesRenderer\Feed' => Extension\ITunes\Renderer\Feed::class, + 'ITunes\Renderer\Feed' => Extension\ITunes\Renderer\Feed::class, 'slashrendererentry' => Extension\Slash\Renderer\Entry::class, 'slashRendererEntry' => Extension\Slash\Renderer\Entry::class, 'SlashRendererEntry' => Extension\Slash\Renderer\Entry::class, + 'SlashRenderer\Entry' => Extension\Slash\Renderer\Entry::class, + 'Slash\Renderer\Entry' => Extension\Slash\Renderer\Entry::class, 'threadingrendererentry' => Extension\Threading\Renderer\Entry::class, 'threadingRendererEntry' => Extension\Threading\Renderer\Entry::class, 'ThreadingRendererEntry' => Extension\Threading\Renderer\Entry::class, + 'ThreadingRenderer\Entry' => Extension\Threading\Renderer\Entry::class, + 'Threading\Renderer\Entry' => Extension\Threading\Renderer\Entry::class, 'wellformedwebrendererentry' => Extension\WellFormedWeb\Renderer\Entry::class, 'wellFormedWebRendererEntry' => Extension\WellFormedWeb\Renderer\Entry::class, 'WellFormedWebRendererEntry' => Extension\WellFormedWeb\Renderer\Entry::class, + 'WellFormedWebRenderer\Entry' => Extension\WellFormedWeb\Renderer\Entry::class, + 'WellFormedWeb\Renderer\Entry' => Extension\WellFormedWeb\Renderer\Entry::class, ]; /** diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Feed.php --- a/vendor/zendframework/zend-feed/src/Writer/Feed.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Feed.php Fri Feb 23 15:52:07 2018 +0000 @@ -99,7 +99,7 @@ */ public function removeEntry($index) { - if (!isset($this->entries[$index])) { + if (! isset($this->entries[$index])) { throw new Exception\InvalidArgumentException('Undefined index: ' . $index . '. Entry does not exist.'); } unset($this->entries[$index]); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/FeedFactory.php --- a/vendor/zendframework/zend-feed/src/Writer/FeedFactory.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/FeedFactory.php Fri Feb 23 15:52:07 2018 +0000 @@ -22,7 +22,7 @@ */ public static function factory($data) { - if (!is_array($data) && !$data instanceof Traversable) { + if (! is_array($data) && ! $data instanceof Traversable) { throw new Exception\InvalidArgumentException(sprintf( '%s expects an array or Traversable argument; received "%s"', __METHOD__, @@ -39,11 +39,11 @@ if (method_exists($feed, $method)) { switch ($method) { case 'setfeedlink': - if (!is_array($value)) { + if (! is_array($value)) { // Need an array break; } - if (!array_key_exists('link', $value) || !array_key_exists('type', $value)) { + if (! array_key_exists('link', $value) || ! array_key_exists('type', $value)) { // Need both keys to set this correctly break; } @@ -88,7 +88,7 @@ */ protected static function createEntries($entries, Feed $feed) { - if (!is_array($entries) && !$entries instanceof Traversable) { + if (! is_array($entries) && ! $entries instanceof Traversable) { throw new Exception\InvalidArgumentException(sprintf( '%s::factory expects the "entries" value to be an array or Traversable; received "%s"', get_called_class(), @@ -97,7 +97,7 @@ } foreach ($entries as $data) { - if (!is_array($data) && !$data instanceof Traversable && !$data instanceof Entry) { + if (! is_array($data) && ! $data instanceof Traversable && ! $data instanceof Entry) { throw new Exception\InvalidArgumentException(sprintf( '%s expects an array, Traversable, or Zend\Feed\Writer\Entry argument; received "%s"', __METHOD__, @@ -116,7 +116,7 @@ foreach ($data as $key => $value) { $key = static::convertKey($key); $method = 'set' . $key; - if (!method_exists($entry, $method)) { + if (! method_exists($entry, $method)) { continue; } $entry->$method($value); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/AbstractRenderer.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/AbstractRenderer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/AbstractRenderer.php Fri Feb 23 15:52:07 2018 +0000 @@ -82,7 +82,7 @@ */ public function saveXml() { - return $this->getDomDocument()->saveXml(); + return $this->getDomDocument()->saveXML(); } /** @@ -146,8 +146,10 @@ */ public function ignoreExceptions($bool = true) { - if (!is_bool($bool)) { - throw new Writer\Exception\InvalidArgumentException('Invalid parameter: $bool. Should be TRUE or FALSE (defaults to TRUE if null)'); + if (! is_bool($bool)) { + throw new Writer\Exception\InvalidArgumentException( + 'Invalid parameter: $bool. Should be TRUE or FALSE (defaults to TRUE if null)' + ); } $this->ignoreExceptions = $bool; return $this; @@ -213,8 +215,10 @@ * * @return void */ + // @codingStandardsIgnoreStart protected function _loadExtensions() { + // @codingStandardsIgnoreEnd Writer\Writer::registerCoreExtensions(); $manager = Writer\Writer::getExtensionManager(); $all = Writer\Writer::getExtensions(); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom.php Fri Feb 23 15:52:07 2018 +0000 @@ -56,7 +56,7 @@ foreach ($this->extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); - $ext->setDOMDocument($this->getDOMDocument(), $entry); + $ext->setDomDocument($this->getDomDocument(), $entry); $ext->render(); } @@ -71,13 +71,15 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setTitle(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getTitle()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getTitle()) { $message = 'Atom 1.0 entry elements MUST contain exactly one' . ' atom:title element but a title has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -98,9 +100,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDescription(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDescription()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDescription()) { return; // unless src content or base64 } $subtitle = $dom->createElement('summary'); @@ -120,13 +124,15 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setDateModified(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateModified()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateModified()) { $message = 'Atom 1.0 entry elements MUST contain exactly one' . ' atom:updated element but a modification date has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -149,9 +155,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDateCreated(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateCreated()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateCreated()) { return; } $el = $dom->createElement('published'); @@ -169,10 +177,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->container->getAuthors(); - if ((!$authors || empty($authors))) { + if ((! $authors || empty($authors))) { /** * This will actually trigger an Exception at the feed level if * a feed level author is not set. @@ -208,10 +218,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setEnclosure(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $data = $this->container->getEnclosure(); - if ((!$data || empty($data))) { + if ((! $data || empty($data))) { return; } $enclosure = $this->dom->createElement('link'); @@ -226,9 +238,11 @@ $root->appendChild($enclosure); } + // @codingStandardsIgnoreStart protected function _setLink(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getLink()) { return; } $link = $dom->createElement('link'); @@ -246,16 +260,18 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setId(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getId() - && !$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getId() + && ! $this->getDataContainer()->getLink()) { $message = 'Atom 1.0 entry elements MUST contain exactly one ' . 'atom:id element, or as an alternative, we can use the same ' . 'value as atom:link however neither a suitable link nor an ' . 'id have been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -263,17 +279,17 @@ } } - if (!$this->getDataContainer()->getId()) { + if (! $this->getDataContainer()->getId()) { $this->getDataContainer()->setId( $this->getDataContainer()->getLink() ); } - if (!Uri::factory($this->getDataContainer()->getId())->isValid() - && !preg_match( + if (! Uri::factory($this->getDataContainer()->getId())->isValid() + && ! preg_match( "#^urn:[a-zA-Z0-9][a-zA-Z0-9\-]{1,31}:([a-zA-Z0-9\(\)\+\,\.\:\=\@\;\$\_\!\*\-]|%[0-9a-fA-F]{2})*#", $this->getDataContainer()->getId() ) - && !$this->_validateTagUri($this->getDataContainer()->getId()) + && ! $this->_validateTagUri($this->getDataContainer()->getId()) ) { throw new Writer\Exception\InvalidArgumentException('Atom 1.0 IDs must be a valid URI/IRI'); } @@ -289,8 +305,10 @@ * @param string $id * @return bool */ + // @codingStandardsIgnoreStart protected function _validateTagUri($id) { + // @codingStandardsIgnoreEnd if (preg_match( '/^tag:(?P.*),(?P\d{4}-?\d{0,2}-?\d{0,2}):(?P.*)(.*:)*$/', $id, @@ -325,23 +343,25 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setContent(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $content = $this->getDataContainer()->getContent(); - if (!$content && !$this->getDataContainer()->getLink()) { + if (! $content && ! $this->getDataContainer()->getLink()) { $message = 'Atom 1.0 entry elements MUST contain exactly one ' . 'atom:content element, or as an alternative, at least one link ' . 'with a rel attribute of "alternate" to indicate an alternate ' . 'method to consume the content.'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; return; } } - if (!$content) { + if (! $content) { return; } $element = $dom->createElement('content'); @@ -356,8 +376,10 @@ /** * Load a HTML string and attempt to normalise to XML */ + // @codingStandardsIgnoreStart protected function _loadXhtml($content) { + // @codingStandardsIgnoreEnd if (class_exists('tidy', false)) { $tidy = new \tidy; $config = [ @@ -391,10 +413,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCategories(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $categories = $this->getDataContainer()->getCategories(); - if (!$categories) { + if (! $categories) { return; } foreach ($categories as $cat) { @@ -419,10 +443,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setSource(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $source = $this->getDataContainer()->getSource(); - if (!$source) { + if (! $source) { return; } $renderer = new Renderer\Feed\AtomSource($source); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom/Deleted.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom/Deleted.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom/Deleted.php Fri Feb 23 15:52:07 2018 +0000 @@ -55,9 +55,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setComment(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getComment()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getComment()) { return; } $c = $dom->createElement('at:comment'); @@ -74,10 +76,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setBy(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $data = $this->container->getBy(); - if ((!$data || empty($data))) { + if ((! $data || empty($data))) { return; } $author = $this->dom->createElement('at:by'); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/AtomDeleted.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/AtomDeleted.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/AtomDeleted.php Fri Feb 23 15:52:07 2018 +0000 @@ -57,9 +57,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setComment(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getComment()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getComment()) { return; } $c = $dom->createElement('at:comment'); @@ -76,10 +78,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setBy(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $data = $this->container->getBy(); - if ((!$data || empty($data))) { + if ((! $data || empty($data))) { return; } $author = $this->dom->createElement('at:by'); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php Fri Feb 23 15:52:07 2018 +0000 @@ -56,7 +56,7 @@ foreach ($this->extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); - $ext->setDOMDocument($this->getDOMDocument(), $entry); + $ext->setDomDocument($this->getDomDocument(), $entry); $ext->render(); } @@ -71,15 +71,17 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setTitle(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDescription() - && !$this->getDataContainer()->getTitle()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDescription() + && ! $this->getDataContainer()->getTitle()) { $message = 'RSS 2.0 entry elements SHOULD contain exactly one' . ' title element but a title has not been set. In addition, there' . ' is no description as required in the absence of a title.'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -100,23 +102,25 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setDescription(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDescription() - && !$this->getDataContainer()->getTitle()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDescription() + && ! $this->getDataContainer()->getTitle()) { $message = 'RSS 2.0 entry elements SHOULD contain exactly one' . ' description element but a description has not been set. In' . ' addition, there is no title element as required in the absence' . ' of a description.'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; return; } } - if (!$this->getDataContainer()->getDescription()) { + if (! $this->getDataContainer()->getDescription()) { return; } $subtitle = $dom->createElement('description'); @@ -132,9 +136,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDateModified(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateModified()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateModified()) { return; } @@ -153,12 +159,14 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDateCreated(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateCreated()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateCreated()) { return; } - if (!$this->getDataContainer()->getDateModified()) { + if (! $this->getDataContainer()->getDateModified()) { $this->getDataContainer()->setDateModified( $this->getDataContainer()->getDateCreated() ); @@ -172,10 +180,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->container->getAuthors(); - if ((!$authors || empty($authors))) { + if ((! $authors || empty($authors))) { return; } foreach ($authors as $data) { @@ -198,34 +208,36 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setEnclosure(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $data = $this->container->getEnclosure(); - if ((!$data || empty($data))) { + if ((! $data || empty($data))) { return; } - if (!isset($data['type'])) { + if (! isset($data['type'])) { $exception = new Writer\Exception\InvalidArgumentException('Enclosure "type" is not set'); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; return; } } - if (!isset($data['length'])) { + if (! isset($data['length'])) { $exception = new Writer\Exception\InvalidArgumentException('Enclosure "length" is not set'); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; return; } } - if ((int) $data['length'] < 0 || !ctype_digit((string) $data['length'])) { + if ((int) $data['length'] < 0 || ! ctype_digit((string) $data['length'])) { $exception = new Writer\Exception\InvalidArgumentException('Enclosure "length" must be an integer' . ' indicating the content\'s length in bytes'); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -246,9 +258,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLink(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getLink()) { return; } $link = $dom->createElement('link'); @@ -264,22 +278,25 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setId(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getId() - && !$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getId() + && ! $this->getDataContainer()->getLink()) { return; } $id = $dom->createElement('guid'); $root->appendChild($id); - if (!$this->getDataContainer()->getId()) { + if (! $this->getDataContainer()->getId()) { $this->getDataContainer()->setId( - $this->getDataContainer()->getLink()); + $this->getDataContainer()->getLink() + ); } $text = $dom->createTextNode($this->getDataContainer()->getId()); $id->appendChild($text); - if (!Uri::factory($this->getDataContainer()->getId())->isValid()) { + if (! Uri::factory($this->getDataContainer()->getId())->isValid()) { $id->setAttribute('isPermaLink', 'false'); } } @@ -291,10 +308,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCommentLink(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $link = $this->getDataContainer()->getCommentLink(); - if (!$link) { + if (! $link) { return; } $clink = $this->dom->createElement('comments'); @@ -310,10 +329,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCategories(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $categories = $this->getDataContainer()->getCategories(); - if (!$categories) { + if (! $categories) { return; } foreach ($categories as $cat) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,8 +37,10 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLanguage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd if ($this->getDataContainer()->getLanguage()) { $root->setAttribute('xml:lang', $this->getDataContainer() ->getLanguage()); @@ -53,13 +55,15 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setTitle(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getTitle()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getTitle()) { $message = 'Atom 1.0 feed elements MUST contain exactly one' . ' atom:title element but a title has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -81,9 +85,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDescription(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDescription()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDescription()) { return; } $subtitle = $dom->createElement('subtitle'); @@ -101,13 +107,15 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setDateModified(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateModified()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateModified()) { $message = 'Atom 1.0 feed elements MUST contain exactly one' . ' atom:updated element but a modification date has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -130,11 +138,16 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setGenerator(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getGenerator()) { - $this->getDataContainer()->setGenerator('Zend_Feed_Writer', - Version::VERSION, 'http://framework.zend.com'); + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getGenerator()) { + $this->getDataContainer()->setGenerator( + 'Zend_Feed_Writer', + Version::VERSION, + 'http://framework.zend.com' + ); } $gdata = $this->getDataContainer()->getGenerator(); @@ -157,9 +170,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLink(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getLink()) { return; } $link = $dom->createElement('link'); @@ -177,16 +192,18 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $flinks = $this->getDataContainer()->getFeedLinks(); - if (!$flinks || !array_key_exists('atom', $flinks)) { + if (! $flinks || ! array_key_exists('atom', $flinks)) { $message = 'Atom 1.0 feed elements SHOULD contain one atom:link ' . 'element with a rel attribute value of "self". This is the ' . 'preferred URI for retrieving Atom Feed Documents representing ' . 'this Atom feed but a feed link has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -211,10 +228,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->container->getAuthors(); - if (!$authors || empty($authors)) { + if (! $authors || empty($authors)) { /** * Technically we should defer an exception until we can check * that all entries contain an author. If any entry is missing @@ -252,16 +271,18 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setId(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getId() - && !$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getId() + && ! $this->getDataContainer()->getLink()) { $message = 'Atom 1.0 feed elements MUST contain exactly one ' . 'atom:id element, or as an alternative, we can use the same ' . 'value as atom:link however neither a suitable link nor an ' . 'id have been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -269,9 +290,10 @@ } } - if (!$this->getDataContainer()->getId()) { + if (! $this->getDataContainer()->getId()) { $this->getDataContainer()->setId( - $this->getDataContainer()->getLink()); + $this->getDataContainer()->getLink() + ); } $id = $dom->createElement('id'); $root->appendChild($id); @@ -286,10 +308,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCopyright(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $copyright = $this->getDataContainer()->getCopyright(); - if (!$copyright) { + if (! $copyright) { return; } $copy = $dom->createElement('rights'); @@ -305,10 +329,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setImage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $image = $this->getDataContainer()->getImage(); - if (!$image) { + if (! $image) { return; } $img = $dom->createElement('logo'); @@ -324,12 +350,14 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDateCreated(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateCreated()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateCreated()) { return; } - if (!$this->getDataContainer()->getDateModified()) { + if (! $this->getDataContainer()->getDateModified()) { $this->getDataContainer()->setDateModified( $this->getDataContainer()->getDateCreated() ); @@ -343,10 +371,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $baseUrl = $this->getDataContainer()->getBaseUrl(); - if (!$baseUrl) { + if (! $baseUrl) { return; } $root->setAttribute('xml:base', $baseUrl); @@ -359,10 +389,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setHubs(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $hubs = $this->getDataContainer()->getHubs(); - if (!$hubs) { + if (! $hubs) { return; } foreach ($hubs as $hubUrl) { @@ -380,10 +412,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCategories(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $categories = $this->getDataContainer()->getCategories(); - if (!$categories) { + if (! $categories) { return; } foreach ($categories as $cat) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,7 +34,7 @@ */ public function render() { - if (!$this->container->getEncoding()) { + if (! $this->container->getEncoding()) { $this->container->setEncoding('UTF-8'); } $this->dom = new DOMDocument('1.0', $this->container->getEncoding()); @@ -64,7 +64,7 @@ foreach ($this->extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); - $ext->setDOMDocument($this->getDOMDocument(), $root); + $ext->setDomDocument($this->getDomDocument(), $root); $ext->render(); } @@ -75,7 +75,7 @@ if ($entry instanceof Writer\Entry) { $renderer = new Renderer\Entry\Atom($entry); } else { - if (!$this->dom->documentElement->hasAttribute('xmlns:at')) { + if (! $this->dom->documentElement->hasAttribute('xmlns:at')) { $this->dom->documentElement->setAttribute( 'xmlns:at', 'http://purl.org/atompub/tombstones/1.0' diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php Fri Feb 23 15:52:07 2018 +0000 @@ -34,8 +34,10 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLanguage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd if ($this->getDataContainer()->getLanguage()) { $root->setAttribute('xml:lang', $this->getDataContainer() ->getLanguage()); @@ -50,13 +52,15 @@ * @return void * @throws Feed\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setTitle(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getTitle()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getTitle()) { $message = 'Atom 1.0 feed elements MUST contain exactly one' . ' atom:title element but a title has not been set'; $exception = new Feed\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -78,9 +82,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDescription(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDescription()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDescription()) { return; } $subtitle = $dom->createElement('subtitle'); @@ -98,13 +104,15 @@ * @return void * @throws Feed\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setDateModified(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateModified()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateModified()) { $message = 'Atom 1.0 feed elements MUST contain exactly one' . ' atom:updated element but a modification date has not been set'; $exception = new Feed\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -127,11 +135,16 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setGenerator(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getGenerator()) { - $this->getDataContainer()->setGenerator('Zend_Feed_Writer', - Version::VERSION, 'http://framework.zend.com'); + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getGenerator()) { + $this->getDataContainer()->setGenerator( + 'Zend_Feed_Writer', + Version::VERSION, + 'http://framework.zend.com' + ); } $gdata = $this->getDataContainer()->getGenerator(); @@ -154,9 +167,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLink(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getLink()) { return; } $link = $dom->createElement('link'); @@ -174,16 +189,18 @@ * @return void * @throws Feed\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $flinks = $this->getDataContainer()->getFeedLinks(); - if (!$flinks || !array_key_exists('atom', $flinks)) { + if (! $flinks || ! array_key_exists('atom', $flinks)) { $message = 'Atom 1.0 feed elements SHOULD contain one atom:link ' . 'element with a rel attribute value of "self". This is the ' . 'preferred URI for retrieving Atom Feed Documents representing ' . 'this Atom feed but a feed link has not been set'; $exception = new Feed\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -208,10 +225,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->container->getAuthors(); - if (!$authors || empty($authors)) { + if (! $authors || empty($authors)) { /** * Technically we should defer an exception until we can check * that all entries contain an author. If any entry is missing @@ -249,16 +268,18 @@ * @return void * @throws Feed\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setId(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getId() - && !$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getId() + && ! $this->getDataContainer()->getLink()) { $message = 'Atom 1.0 feed elements MUST contain exactly one ' . 'atom:id element, or as an alternative, we can use the same ' . 'value as atom:link however neither a suitable link nor an ' . 'id have been set'; $exception = new Feed\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -266,9 +287,10 @@ } } - if (!$this->getDataContainer()->getId()) { + if (! $this->getDataContainer()->getId()) { $this->getDataContainer()->setId( - $this->getDataContainer()->getLink()); + $this->getDataContainer()->getLink() + ); } $id = $dom->createElement('id'); $root->appendChild($id); @@ -283,10 +305,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCopyright(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $copyright = $this->getDataContainer()->getCopyright(); - if (!$copyright) { + if (! $copyright) { return; } $copy = $dom->createElement('rights'); @@ -294,6 +318,7 @@ $text = $dom->createTextNode($copyright); $copy->appendChild($text); } + /** * Set feed level logo (image) * @@ -301,10 +326,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setImage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $image = $this->getDataContainer()->getImage(); - if (!$image) { + if (! $image) { return; } $img = $dom->createElement('logo'); @@ -320,12 +347,14 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDateCreated(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateCreated()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateCreated()) { return; } - if (!$this->getDataContainer()->getDateModified()) { + if (! $this->getDataContainer()->getDateModified()) { $this->getDataContainer()->setDateModified( $this->getDataContainer()->getDateCreated() ); @@ -339,10 +368,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $baseUrl = $this->getDataContainer()->getBaseUrl(); - if (!$baseUrl) { + if (! $baseUrl) { return; } $root->setAttribute('xml:base', $baseUrl); @@ -355,10 +386,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setHubs(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $hubs = $this->getDataContainer()->getHubs(); - if (!$hubs) { + if (! $hubs) { return; } foreach ($hubs as $hubUrl) { @@ -376,10 +409,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCategories(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $categories = $this->getDataContainer()->getCategories(); - if (!$categories) { + if (! $categories) { return; } foreach ($categories as $cat) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/Source.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/Source.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/Source.php Fri Feb 23 15:52:07 2018 +0000 @@ -33,7 +33,7 @@ */ public function render() { - if (!$this->container->getEncoding()) { + if (! $this->container->getEncoding()) { $this->container->setEncoding('UTF-8'); } $this->dom = new DOMDocument('1.0', $this->container->getEncoding()); @@ -71,9 +71,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setGenerator(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getGenerator()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getGenerator()) { return; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AtomSource.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AtomSource.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AtomSource.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,7 +35,7 @@ */ public function render() { - if (!$this->container->getEncoding()) { + if (! $this->container->getEncoding()) { $this->container->setEncoding('UTF-8'); } $this->dom = new DOMDocument('1.0', $this->container->getEncoding()); @@ -60,7 +60,7 @@ foreach ($this->extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); - $ext->setDOMDocument($this->getDOMDocument(), $root); + $ext->setDomDocument($this->getDomDocument(), $root); $ext->render(); } return $this; @@ -73,9 +73,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setGenerator(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getGenerator()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getGenerator()) { return; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php --- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php Fri Feb 23 15:52:07 2018 +0000 @@ -65,7 +65,7 @@ foreach ($this->extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); - $ext->setDOMDocument($this->getDOMDocument(), $channel); + $ext->setDomDocument($this->getDomDocument(), $channel); $ext->render(); } @@ -99,10 +99,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLanguage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $lang = $this->getDataContainer()->getLanguage(); - if (!$lang) { + if (! $lang) { return; } $language = $dom->createElement('language'); @@ -118,13 +120,15 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setTitle(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getTitle()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getTitle()) { $message = 'RSS 2.0 feed elements MUST contain exactly one' . ' title element but a title has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -146,13 +150,15 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setDescription(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDescription()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDescription()) { $message = 'RSS 2.0 feed elements MUST contain exactly one' . ' description element but one has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -172,9 +178,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDateModified(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateModified()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateModified()) { return; } @@ -193,9 +201,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setGenerator(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getGenerator()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getGenerator()) { $this->getDataContainer()->setGenerator( 'Zend_Feed_Writer', Version::VERSION, @@ -225,14 +235,16 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setLink(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $value = $this->getDataContainer()->getLink(); - if (!$value) { + if (! $value) { $message = 'RSS 2.0 feed elements MUST contain exactly one' . ' link element but one has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -243,7 +255,7 @@ $root->appendChild($link); $text = $dom->createTextNode($value); $link->appendChild($text); - if (!Uri::factory($value)->isValid()) { + if (! Uri::factory($value)->isValid()) { $link->setAttribute('isPermaLink', 'false'); } } @@ -255,10 +267,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->getDataContainer()->getAuthors(); - if (!$authors || empty($authors)) { + if (! $authors || empty($authors)) { return; } foreach ($authors as $data) { @@ -280,10 +294,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCopyright(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $copyright = $this->getDataContainer()->getCopyright(); - if (!$copyright) { + if (! $copyright) { return; } $copy = $dom->createElement('copyright'); @@ -300,19 +316,21 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setImage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $image = $this->getDataContainer()->getImage(); - if (!$image) { + if (! $image) { return; } - if (!isset($image['title']) || empty($image['title']) - || !is_string($image['title']) + if (! isset($image['title']) || empty($image['title']) + || ! is_string($image['title']) ) { $message = 'RSS 2.0 feed images must include a title'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -320,13 +338,13 @@ } } - if (empty($image['link']) || !is_string($image['link']) - || !Uri::factory($image['link'])->isValid() + if (empty($image['link']) || ! is_string($image['link']) + || ! Uri::factory($image['link'])->isValid() ) { $message = 'Invalid parameter: parameter \'link\'' . ' must be a non-empty string and valid URI/IRI'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -354,11 +372,11 @@ $img->appendChild($link); if (isset($image['height'])) { - if (!ctype_digit((string) $image['height']) || $image['height'] > 400) { + if (! ctype_digit((string) $image['height']) || $image['height'] > 400) { $message = 'Invalid parameter: parameter \'height\'' . ' must be an integer not exceeding 400'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -371,11 +389,11 @@ $img->appendChild($height); } if (isset($image['width'])) { - if (!ctype_digit((string) $image['width']) || $image['width'] > 144) { + if (! ctype_digit((string) $image['width']) || $image['width'] > 144) { $message = 'Invalid parameter: parameter \'width\'' . ' must be an integer not exceeding 144'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -388,11 +406,11 @@ $img->appendChild($width); } if (isset($image['description'])) { - if (empty($image['description']) || !is_string($image['description'])) { + if (empty($image['description']) || ! is_string($image['description'])) { $message = 'Invalid parameter: parameter \'description\'' . ' must be a non-empty string'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -413,12 +431,14 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDateCreated(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateCreated()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateCreated()) { return; } - if (!$this->getDataContainer()->getDateModified()) { + if (! $this->getDataContainer()->getDateModified()) { $this->getDataContainer()->setDateModified( $this->getDataContainer()->getDateCreated() ); @@ -432,9 +452,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLastBuildDate(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getLastBuildDate()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getLastBuildDate()) { return; } @@ -453,10 +475,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $baseUrl = $this->getDataContainer()->getBaseUrl(); - if (!$baseUrl) { + if (! $baseUrl) { return; } $root->setAttribute('xml:base', $baseUrl); @@ -469,10 +493,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCategories(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $categories = $this->getDataContainer()->getCategories(); - if (!$categories) { + if (! $categories) { return; } foreach ($categories as $cat) { diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/StandaloneExtensionManager.php --- a/vendor/zendframework/zend-feed/src/Writer/StandaloneExtensionManager.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/StandaloneExtensionManager.php Fri Feb 23 15:52:07 2018 +0000 @@ -9,6 +9,8 @@ namespace Zend\Feed\Writer; +use Zend\Feed\Writer\Exception\InvalidArgumentException; + class StandaloneExtensionManager implements ExtensionManagerInterface { private $extensions = [ @@ -47,4 +49,42 @@ $class = $this->extensions[$extension]; return new $class(); } + + /** + * Add an extension. + * + * @param string $name + * @param string $class + */ + public function add($name, $class) + { + if (is_string($class) + && (( + is_a($class, Extension\AbstractRenderer::class, true) + || 'Feed' === substr($class, -4) + || 'Entry' === substr($class, -5) + )) + ) { + $this->extensions[$name] = $class; + + return; + } + + throw new InvalidArgumentException(sprintf( + 'Plugin of type %s is invalid; must implement %s\Extension\RendererInterface ' + . 'or the classname must end in "Feed" or "Entry"', + $class, + __NAMESPACE__ + )); + } + + /** + * Remove an extension. + * + * @param string $name + */ + public function remove($name) + { + unset($this->extensions[$name]); + } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-feed/src/Writer/Writer.php --- a/vendor/zendframework/zend-feed/src/Writer/Writer.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/Writer/Writer.php Fri Feb 23 15:52:07 2018 +0000 @@ -76,7 +76,7 @@ */ public static function getExtensionManager() { - if (!isset(static::$extensionManager)) { + if (! isset(static::$extensionManager)) { static::setExtensionManager(new ExtensionManager()); } return static::$extensionManager; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/CHANGELOG.md --- a/vendor/zendframework/zend-stdlib/CHANGELOG.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/CHANGELOG.md Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,29 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.1.0 - 2016-09-13 + +### Added + +- [#63](https://github.com/zendframework/zend-stdlib/pull/63) adds a new + `Zend\Stdlib\ConsoleHelper` class, providing minimal support for writing + output to `STDOUT` and `STDERR`, with optional colorization, when the console + supports that feature. + +### Deprecated + +- [#38](https://github.com/zendframework/zend-stdlib/pull/38) deprecates + `Zend\Stdlib\JsonSerializable`, as all supported version of PHP now support + it. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.0.1 - 2016-04-12 ### Added diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/README.md --- a/vendor/zendframework/zend-stdlib/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -7,7 +7,6 @@ class for different scopes like: - array utilities functions; -- json serializable interfaces; - general messaging systems; - string wrappers; - etc. @@ -15,4 +14,4 @@ --- - File issues at https://github.com/zendframework/zend-stdlib/issues -- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-stdlib +- Documentation is at https://docs.zendframework.com/zend-stdlib/ diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/composer.json --- a/vendor/zendframework/zend-stdlib/composer.json Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/composer.json Fri Feb 23 15:52:07 2018 +0000 @@ -13,17 +13,17 @@ } }, "require": { - "php": "^5.5 || ^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", + "athletic/athletic": "~0.1", "phpunit/PHPUnit": "~4.0", - "athletic/athletic": "~0.1" + "squizlabs/php_codesniffer": "^2.6.2" }, "extra": { "branch-alias": { - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" } }, "autoload-dev": { @@ -31,5 +31,12 @@ "ZendTest\\Stdlib\\": "test/", "ZendBench\\Stdlib\\": "benchmark/" } + }, + "scripts": { + "cs-check": "phpcs --colors", + "cs-fix": "phpcbf --colors", + "test": "phpunit --colors=always", + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", + "upload-coverage": "coveralls -v" } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/doc/book/console-helper.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/zendframework/zend-stdlib/doc/book/console-helper.md Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,126 @@ +# Console Helper + +Writing one-off scripts or vendor binaries for a package is often problematic: + +- You need to parse arguments manually. +- You need to send output to the console in a meaningful fashion: + - Using `STDOUT` for meaningful, expected output + - Using `STDERR` for error messages + - Ensuring any line breaks are converted to `PHP_EOL` + - Optionally, using console colors to provide context, which means: + - Detecting whether or not the console supports colors in the first place + - Providing appropriate escape sequences to produce color + +`Zend\Stdlib\ConsoleHelper` helps to address the second major bullet point and +all beneath it in a minimal fashion. + +## Usage + +Typical usage is to instantiate a `ConsoleHelper`, and call one of its methods: + +```php +use Zend\Stdlib\ConsoleHelper; + +$helper = new ConsoleHelper(); +$helper->writeLine('This is output'); +``` + +You can optionally pass a PHP stream resource to the constructor, which will be +used to determine whether or not color support is available: + +```php +$helper = new ConsoleHelper($stream); +``` + +By default, it assumes `STDOUT`, and tests against that. + +## Available methods + +`ConsoleHelper` provides the following methods. + +### colorize + +- `colorize(string $string) : string` + +`colorize()` accepts a formatted string, and will then apply ANSI color +sequences to them, if color support is detected. + +The following sequences are currently supported: + +- `...` will apply a green color sequence around the provided text. +- `...` will apply a red color sequence around the provided text. + +You may mix multiple sequences within the same stream. + +### write + +- `write(string $string, bool $colorize = true, resource $stream = STDOUT) : void` + +Emits the provided `$string` to the provided `$stream` (which defaults to +`STDOUT` if not provided). Any EOL sequences are convered to `PHP_EOL`. If +`$colorize` is `true`, the string is first passed to `colorize()` as well. + +### writeline + +- `writeLine(string $string, bool $colorize = true, resource $stream = STDOUT) : void` + +Same as `write()`, except it also appends a `PHP_EOL` sequence to the `$string`. + +### writeErrorMessage + +- `writeErrorMessage(string $message)` + +Wraps `$message` in an `` sequence, and passes it to +`writeLine()`, using `STDERR` as the `$stream`. + +## Example + +Below is an example class that accepts an argument list, and determines how and +what to emit. + +```php +namespace Foo; + +use Zend\Stdlib\ConsoleHelper; + +class HelloWorld +{ + private $helper; + + public function __construct(ConsoleHelper $helper = null) + { + $this->helper = $helper ?: new ConsoleHelper(); + } + + public function __invoke(array $args) + { + if (! count($args)) { + $this->helper->writeErrorMessage('Missing arguments!'); + return; + } + + if (count($args) > 1) { + $this->helper->writeErrorMessage('Too many arguments!'); + return; + } + + $target = array_shift($args); + + $this->helper->writeLine(sprintf( + 'Hello %s', + $target + )); + } +} +``` + +## When to upgrade + +`ConsoleHelper` is deliberately simple, and assumes that your primary need for +console tooling is for output considerations. + +If you need to parse complex argument strings, we recommend using +[zend-console](https://docs.zendframework.com/zend-console/)/[zf-console](https://github.com/zfcampus/zf-console) +or [symfony/console](http://symfony.com/doc/current/components/console.html), +as these packages provide those capabilities, as well as far more colorization +and console feature detection facilities. diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/mkdocs.yml --- a/vendor/zendframework/zend-stdlib/mkdocs.yml Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/mkdocs.yml Fri Feb 23 15:52:07 2018 +0000 @@ -2,6 +2,8 @@ site_dir: doc/html pages: - index.md + - Reference: + - "Console Helper": console-helper.md - Migration: migration.md site_name: zend-stdlib site_description: Zend\Stdlib diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/phpcs.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/zendframework/zend-stdlib/phpcs.xml Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,27 @@ + + + Zend Framework coding standard + + + + + + + + + + + + + + + + + + + + + + src + test + diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/AbstractOptions.php --- a/vendor/zendframework/zend-stdlib/src/AbstractOptions.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/AbstractOptions.php Fri Feb 23 15:52:07 2018 +0000 @@ -13,6 +13,7 @@ abstract class AbstractOptions implements ParameterObjectInterface { + // @codingStandardsIgnoreStart /** * We use the __ prefix to avoid collisions with properties in * user-implementations. @@ -20,6 +21,7 @@ * @var bool */ protected $__strictMode__ = true; + // @codingStandardsIgnoreEnd /** * Constructor @@ -46,7 +48,7 @@ $options = $options->toArray(); } - if (!is_array($options) && !$options instanceof Traversable) { + if (! is_array($options) && ! $options instanceof Traversable) { throw new Exception\InvalidArgumentException( sprintf( 'Parameter provided to %s must be an %s, %s or %s', diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/ArrayObject.php --- a/vendor/zendframework/zend-stdlib/src/ArrayObject.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/ArrayObject.php Fri Feb 23 15:52:07 2018 +0000 @@ -180,14 +180,16 @@ */ public function exchangeArray($data) { - if (!is_array($data) && !is_object($data)) { - throw new Exception\InvalidArgumentException('Passed variable is not an array or object, using empty array instead'); + if (! is_array($data) && ! is_object($data)) { + throw new Exception\InvalidArgumentException( + 'Passed variable is not an array or object, using empty array instead' + ); } if (is_object($data) && ($data instanceof self || $data instanceof \ArrayObject)) { $data = $data->getArrayCopy(); } - if (!is_array($data)) { + if (! is_array($data)) { $data = (array) $data; } @@ -290,7 +292,7 @@ public function &offsetGet($key) { $ret = null; - if (!$this->offsetExists($key)) { + if (! $this->offsetExists($key)) { return $ret; } $ret =& $this->storage[$key]; diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/ArrayUtils.php --- a/vendor/zendframework/zend-stdlib/src/ArrayUtils.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/ArrayUtils.php Fri Feb 23 15:52:07 2018 +0000 @@ -39,11 +39,11 @@ */ public static function hasStringKeys($value, $allowEmpty = false) { - if (!is_array($value)) { + if (! is_array($value)) { return false; } - if (!$value) { + if (! $value) { return $allowEmpty; } @@ -59,11 +59,11 @@ */ public static function hasIntegerKeys($value, $allowEmpty = false) { - if (!is_array($value)) { + if (! is_array($value)) { return false; } - if (!$value) { + if (! $value) { return $allowEmpty; } @@ -86,11 +86,11 @@ */ public static function hasNumericKeys($value, $allowEmpty = false) { - if (!is_array($value)) { + if (! is_array($value)) { return false; } - if (!$value) { + if (! $value) { return $allowEmpty; } @@ -119,11 +119,11 @@ */ public static function isList($value, $allowEmpty = false) { - if (!is_array($value)) { + if (! is_array($value)) { return false; } - if (!$value) { + if (! $value) { return $allowEmpty; } @@ -161,11 +161,11 @@ */ public static function isHashTable($value, $allowEmpty = false) { - if (!is_array($value)) { + if (! is_array($value)) { return false; } - if (!$value) { + if (! $value) { return $allowEmpty; } @@ -187,7 +187,7 @@ */ public static function inArray($needle, array $haystack, $strict = false) { - if (!$strict) { + if (! $strict) { if (is_int($needle) || is_float($needle)) { $needle = (string) $needle; } @@ -215,11 +215,11 @@ */ public static function iteratorToArray($iterator, $recursive = true) { - if (!is_array($iterator) && !$iterator instanceof Traversable) { + if (! is_array($iterator) && ! $iterator instanceof Traversable) { throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable object'); } - if (!$recursive) { + if (! $recursive) { if (is_array($iterator)) { return $iterator; } @@ -274,7 +274,7 @@ } elseif (isset($a[$key]) || array_key_exists($key, $a)) { if ($value instanceof MergeRemoveKey) { unset($a[$key]); - } elseif (!$preserveNumericKeys && is_int($key)) { + } elseif (! $preserveNumericKeys && is_int($key)) { $a[] = $value; } elseif (is_array($value) && is_array($a[$key])) { $a[$key] = static::merge($a[$key], $value, $preserveNumericKeys); @@ -282,7 +282,7 @@ $a[$key] = $value; } } else { - if (!$value instanceof MergeRemoveKey) { + if (! $value instanceof MergeRemoveKey) { $a[$key] = $value; } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/ConsoleHelper.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/zendframework/zend-stdlib/src/ConsoleHelper.php Fri Feb 23 15:52:07 2018 +0000 @@ -0,0 +1,158 @@ +message`, + * `message`) + * - Write output to a specified stream, optionally with colorization. + * - Write a line of output to a specified stream, optionally with + * colorization, using the system EOL sequence.. + * - Write an error message to STDERR. + * + * Colorization will only occur when expected sequences are discovered, and + * then, only if the console terminal allows it. + * + * Essentially, provides the bare minimum to allow you to provide messages to + * the current console. + */ +class ConsoleHelper +{ + const COLOR_GREEN = "\033[32m"; + const COLOR_RED = "\033[31m"; + const COLOR_RESET = "\033[0m"; + + const HIGHLIGHT_INFO = 'info'; + const HIGHLIGHT_ERROR = 'error'; + + private $highlightMap = [ + self::HIGHLIGHT_INFO => self::COLOR_GREEN, + self::HIGHLIGHT_ERROR => self::COLOR_RED, + ]; + + /** + * @var string Exists only for testing. + */ + private $eol = PHP_EOL; + + /** + * @var resource Exists only for testing. + */ + private $stderr = STDERR; + + /** + * @var bool + */ + private $supportsColor; + + /** + * @param resource $resource + */ + public function __construct($resource = STDOUT) + { + $this->supportsColor = $this->detectColorCapabilities($resource); + } + + /** + * Colorize a string for use with the terminal. + * + * Takes strings formatted as `string` and formats them per the + * $highlightMap; if color support is disabled, simply removes the formatting + * tags. + * + * @param string $string + * @return string + */ + public function colorize($string) + { + $reset = $this->supportsColor ? self::COLOR_RESET : ''; + foreach ($this->highlightMap as $key => $color) { + $pattern = sprintf('#<%s>(.*?)#s', $key, $key); + $color = $this->supportsColor ? $color : ''; + $string = preg_replace($pattern, $color . '$1' . $reset, $string); + } + return $string; + } + + /** + * @param string $string + * @param bool $colorize Whether or not to colorize the string + * @param resource $resource Defaults to STDOUT + * @return void + */ + public function write($string, $colorize = true, $resource = STDOUT) + { + if ($colorize) { + $string = $this->colorize($string); + } + + $string = $this->formatNewlines($string); + + fwrite($resource, $string); + } + + /** + * @param string $string + * @param bool $colorize Whether or not to colorize the line + * @param resource $resource Defaults to STDOUT + * @return void + */ + public function writeLine($string, $colorize = true, $resource = STDOUT) + { + $this->write($string . $this->eol, $colorize, $resource); + } + + /** + * Emit an error message. + * + * Wraps the message in ``, and passes it to `writeLine()`, + * using STDERR as the resource; emits an additional empty line when done, + * also to STDERR. + * + * @param string $message + * @return void + */ + public function writeErrorMessage($message) + { + $this->writeLine(sprintf('%s', $message), true, $this->stderr); + $this->writeLine('', false, $this->stderr); + } + + /** + * @param resource $resource + * @return bool + */ + private function detectColorCapabilities($resource = STDOUT) + { + if ('\\' === DIRECTORY_SEPARATOR) { + // Windows + return false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + || 'xterm' === getenv('TERM'); + } + + return function_exists('posix_isatty') && posix_isatty($resource); + } + + /** + * Ensure newlines are appropriate for the current terminal. + * + * @param string + * @return string + */ + private function formatNewlines($string) + { + $string = str_replace($this->eol, "\0PHP_EOL\0", $string); + $string = preg_replace("/(\r\n|\n|\r)/", $this->eol, $string); + return str_replace("\0PHP_EOL\0", $this->eol, $string); + } +} diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/ErrorHandler.php --- a/vendor/zendframework/zend-stdlib/src/ErrorHandler.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/ErrorHandler.php Fri Feb 23 15:52:07 2018 +0000 @@ -51,7 +51,7 @@ */ public static function start($errorLevel = \E_WARNING) { - if (!static::$stack) { + if (! static::$stack) { set_error_handler([get_called_class(), 'addError'], $errorLevel); } @@ -72,7 +72,7 @@ if (static::$stack) { $errorException = array_pop(static::$stack); - if (!static::$stack) { + if (! static::$stack) { restore_error_handler(); } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/Glob.php --- a/vendor/zendframework/zend-stdlib/src/Glob.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/Glob.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,7 +38,7 @@ */ public static function glob($pattern, $flags = 0, $forceFallback = false) { - if (!defined('GLOB_BRACE') || $forceFallback) { + if (! defined('GLOB_BRACE') || $forceFallback) { return static::fallbackGlob($pattern, $flags); } @@ -96,7 +96,7 @@ */ protected static function fallbackGlob($pattern, $flags) { - if (!$flags & self::GLOB_BRACE) { + if (! $flags & self::GLOB_BRACE) { return static::systemGlob($pattern, $flags); } @@ -182,7 +182,7 @@ $current = $begin; while ($current < $length) { - if (!$flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\') { + if (! $flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\') { if (++$current === $length) { break; } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/Guard/ArrayOrTraversableGuardTrait.php --- a/vendor/zendframework/zend-stdlib/src/Guard/ArrayOrTraversableGuardTrait.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/Guard/ArrayOrTraversableGuardTrait.php Fri Feb 23 15:52:07 2018 +0000 @@ -29,7 +29,7 @@ $dataName = 'Argument', $exceptionClass = 'Zend\Stdlib\Exception\InvalidArgumentException' ) { - if (!is_array($data) && !($data instanceof Traversable)) { + if (! is_array($data) && ! ($data instanceof Traversable)) { $message = sprintf( "%s must be an array or Traversable, [%s] given", $dataName, diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/JsonSerializable.php --- a/vendor/zendframework/zend-stdlib/src/JsonSerializable.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/JsonSerializable.php Fri Feb 23 15:52:07 2018 +0000 @@ -9,6 +9,9 @@ namespace Zend\Stdlib; +/** + * @deprecated Since 3.1.0; use the native JsonSerializable interface + */ interface JsonSerializable extends \JsonSerializable { } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/Message.php --- a/vendor/zendframework/zend-stdlib/src/Message.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/Message.php Fri Feb 23 15:52:07 2018 +0000 @@ -40,7 +40,7 @@ $this->metadata[$spec] = $value; return $this; } - if (!is_array($spec) && !$spec instanceof Traversable) { + if (! is_array($spec) && ! $spec instanceof Traversable) { throw new Exception\InvalidArgumentException(sprintf( 'Expected a string, array, or Traversable argument in first position; received "%s"', (is_object($spec) ? get_class($spec) : gettype($spec)) @@ -66,7 +66,7 @@ return $this->metadata; } - if (!is_scalar($key)) { + if (! is_scalar($key)) { throw new Exception\InvalidArgumentException('Non-scalar argument provided for key'); } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/Parameters.php --- a/vendor/zendframework/zend-stdlib/src/Parameters.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/Parameters.php Fri Feb 23 15:52:07 2018 +0000 @@ -70,7 +70,7 @@ */ public function toString() { - return http_build_query($this); + return http_build_query($this->toArray()); } /** diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/PriorityList.php --- a/vendor/zendframework/zend-stdlib/src/PriorityList.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/PriorityList.php Fri Feb 23 15:52:07 2018 +0000 @@ -62,7 +62,7 @@ */ public function insert($name, $value, $priority = 0) { - if (!isset($this->items[$name])) { + if (! isset($this->items[$name])) { $this->count++; } @@ -85,7 +85,7 @@ */ public function setPriority($name, $priority) { - if (!isset($this->items[$name])) { + if (! isset($this->items[$name])) { throw new \Exception("item $name not found"); } @@ -131,7 +131,7 @@ */ public function get($name) { - if (!isset($this->items[$name])) { + if (! isset($this->items[$name])) { return; } @@ -145,7 +145,7 @@ */ protected function sort() { - if (!$this->sorted) { + if (! $this->sorted) { uasort($this->items, [$this, 'compare']); $this->sorted = true; } @@ -161,7 +161,7 @@ protected function compare(array $item1, array $item2) { return ($item1['priority'] === $item2['priority']) - ? ($item1['serial'] > $item2['serial'] ? -1 : 1) * $this->isLIFO + ? ($item1['serial'] > $item2['serial'] ? -1 : 1) * $this->isLIFO : ($item1['priority'] > $item2['priority'] ? -1 : 1); } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/PriorityQueue.php --- a/vendor/zendframework/zend-stdlib/src/PriorityQueue.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/PriorityQueue.php Fri Feb 23 15:52:07 2018 +0000 @@ -99,7 +99,7 @@ unset($this->items[$key]); $this->queue = null; - if (!$this->isEmpty()) { + if (! $this->isEmpty()) { $queue = $this->getQueue(); foreach ($this->items as $item) { $queue->insert($item['data'], $item['priority']); @@ -277,7 +277,7 @@ { if (null === $this->queue) { $this->queue = new $this->queueClass(); - if (!$this->queue instanceof \SplPriorityQueue) { + if (! $this->queue instanceof \SplPriorityQueue) { throw new Exception\DomainException(sprintf( 'PriorityQueue expects an internal queue of type SplPriorityQueue; received "%s"', get_class($this->queue) diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/SplPriorityQueue.php --- a/vendor/zendframework/zend-stdlib/src/SplPriorityQueue.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/SplPriorityQueue.php Fri Feb 23 15:52:07 2018 +0000 @@ -36,7 +36,7 @@ */ public function insert($datum, $priority) { - if (!is_array($priority)) { + if (! is_array($priority)) { $priority = [$priority, $this->serial--]; } parent::insert($datum, $priority); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/StringUtils.php --- a/vendor/zendframework/zend-stdlib/src/StringUtils.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/StringUtils.php Fri Feb 23 15:52:07 2018 +0000 @@ -84,7 +84,7 @@ public static function registerWrapper($wrapper) { $wrapper = (string) $wrapper; - if (!in_array($wrapper, static::$wrapperRegistry, true)) { + if (! in_array($wrapper, static::$wrapperRegistry, true)) { static::$wrapperRegistry[] = $wrapper; } } diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/StringWrapper/AbstractStringWrapper.php --- a/vendor/zendframework/zend-stdlib/src/StringWrapper/AbstractStringWrapper.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/StringWrapper/AbstractStringWrapper.php Fri Feb 23 15:52:07 2018 +0000 @@ -38,11 +38,11 @@ { $supportedEncodings = static::getSupportedEncodings(); - if (!in_array(strtoupper($encoding), $supportedEncodings)) { + if (! in_array(strtoupper($encoding), $supportedEncodings)) { return false; } - if ($convertEncoding !== null && !in_array(strtoupper($convertEncoding), $supportedEncodings)) { + if ($convertEncoding !== null && ! in_array(strtoupper($convertEncoding), $supportedEncodings)) { return false; } @@ -61,7 +61,7 @@ $supportedEncodings = static::getSupportedEncodings(); $encodingUpper = strtoupper($encoding); - if (!in_array($encodingUpper, $supportedEncodings)) { + if (! in_array($encodingUpper, $supportedEncodings)) { throw new Exception\InvalidArgumentException( 'Wrapper doesn\'t support character encoding "' . $encoding . '"' ); @@ -69,7 +69,7 @@ if ($convertEncoding !== null) { $convertEncodingUpper = strtoupper($convertEncoding); - if (!in_array($convertEncodingUpper, $supportedEncodings)) { + if (! in_array($convertEncodingUpper, $supportedEncodings)) { throw new Exception\InvalidArgumentException( 'Wrapper doesn\'t support character encoding "' . $convertEncoding . '"' ); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/StringWrapper/Iconv.php --- a/vendor/zendframework/zend-stdlib/src/StringWrapper/Iconv.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/StringWrapper/Iconv.php Fri Feb 23 15:52:07 2018 +0000 @@ -214,7 +214,7 @@ */ public function __construct() { - if (!extension_loaded('iconv')) { + if (! extension_loaded('iconv')) { throw new Exception\ExtensionNotLoadedException( 'PHP extension "iconv" is required for this wrapper' ); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/StringWrapper/Intl.php --- a/vendor/zendframework/zend-stdlib/src/StringWrapper/Intl.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/StringWrapper/Intl.php Fri Feb 23 15:52:07 2018 +0000 @@ -37,7 +37,7 @@ */ public function __construct() { - if (!extension_loaded('intl')) { + if (! extension_loaded('intl')) { throw new Exception\ExtensionNotLoadedException( 'PHP extension "intl" is required for this wrapper' ); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/StringWrapper/MbString.php --- a/vendor/zendframework/zend-stdlib/src/StringWrapper/MbString.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/StringWrapper/MbString.php Fri Feb 23 15:52:07 2018 +0000 @@ -48,7 +48,7 @@ */ public function __construct() { - if (!extension_loaded('mbstring')) { + if (! extension_loaded('mbstring')) { throw new Exception\ExtensionNotLoadedException( 'PHP extension "mbstring" is required for this wrapper' ); diff -r bfffd8d7479a -r 7a779792577d vendor/zendframework/zend-stdlib/src/StringWrapper/Native.php --- a/vendor/zendframework/zend-stdlib/src/StringWrapper/Native.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-stdlib/src/StringWrapper/Native.php Fri Feb 23 15:52:07 2018 +0000 @@ -35,7 +35,7 @@ $encodingUpper = strtoupper($encoding); $supportedEncodings = static::getSupportedEncodings(); - if (!in_array($encodingUpper, $supportedEncodings)) { + if (! in_array($encodingUpper, $supportedEncodings)) { return false; } @@ -69,7 +69,7 @@ $supportedEncodings = static::getSupportedEncodings(); $encodingUpper = strtoupper($encoding); - if (!in_array($encodingUpper, $supportedEncodings)) { + if (! in_array($encodingUpper, $supportedEncodings)) { throw new Exception\InvalidArgumentException( 'Wrapper doesn\'t support character encoding "' . $encoding . '"' );