diff --git a/composer.lock b/composer.lock index 53f5991dd7dedbaf58d7b4b76a27676e7ad58468..ae58fc2e3895d3dce0e8e9c4535d6491b6abbc19 100644 --- a/composer.lock +++ b/composer.lock @@ -259,10 +259,10 @@ }, { "name": "pear-pear.php.net/Archive_Tar", - "version": "1.3.15", + "version": "1.3.16", "dist": { "type": "file", - "url": "http://pear.php.net/get/Archive_Tar-1.3.15.tgz", + "url": "http://pear.php.net/get/Archive_Tar-1.3.16.tgz", "reference": null, "shasum": null }, @@ -270,7 +270,7 @@ "php": ">=4.3.0.0" }, "replace": { - "pear-pear/archive_tar": "== 1.3.15.0" + "pear-pear/archive_tar": "== 1.3.16.0" }, "type": "pear-library", "autoload": { @@ -524,22 +524,25 @@ }, { "name": "symfony/yaml", - "version": "v2.6.4", + "version": "v2.6.6", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" + "reference": "174f009ed36379a801109955fc5a71a49fe62dd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", - "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/174f009ed36379a801109955fc5a71a49fe62dd4", + "reference": "174f009ed36379a801109955fc5a71a49fe62dd4", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -567,7 +570,7 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2015-01-25 04:39:26" + "time": "2015-03-30 15:54:10" }, { "name": "vufind-org/vufindcode", @@ -967,16 +970,16 @@ }, { "name": "zf-commons/zfc-rbac", - "version": "2.4.2", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/ZF-Commons/zfc-rbac.git", - "reference": "42f466656ad9730025a6bbbfd4144ac2f3abb64c" + "reference": "80970aba715fd54f63ddde68a24bee22bafb9d17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ZF-Commons/zfc-rbac/zipball/42f466656ad9730025a6bbbfd4144ac2f3abb64c", - "reference": "42f466656ad9730025a6bbbfd4144ac2f3abb64c", + "url": "https://api.github.com/repos/ZF-Commons/zfc-rbac/zipball/80970aba715fd54f63ddde68a24bee22bafb9d17", + "reference": "80970aba715fd54f63ddde68a24bee22bafb9d17", "shasum": "" }, "require": { @@ -1039,7 +1042,7 @@ "rbac", "zf2" ], - "time": "2015-01-26 11:29:23" + "time": "2015-04-16 12:10:33" }, { "name": "zfr/rbac", @@ -1208,22 +1211,25 @@ }, { "name": "symfony/css-selector", - "version": "v2.6.4", + "version": "v2.6.6", "target-dir": "Symfony/Component/CssSelector", "source": { "type": "git", "url": "https://github.com/symfony/CssSelector.git", - "reference": "3f80ecc614fec68d5b4a84a0703db3fdf5ce8584" + "reference": "db2c48df9658423a8c168d89f7b971b73d3d74a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/CssSelector/zipball/3f80ecc614fec68d5b4a84a0703db3fdf5ce8584", - "reference": "3f80ecc614fec68d5b4a84a0703db3fdf5ce8584", + "url": "https://api.github.com/repos/symfony/CssSelector/zipball/db2c48df9658423a8c168d89f7b971b73d3d74a4", + "reference": "db2c48df9658423a8c168d89f7b971b73d3d74a4", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -1255,26 +1261,29 @@ ], "description": "Symfony CssSelector Component", "homepage": "http://symfony.com", - "time": "2015-01-03 08:01:59" + "time": "2015-03-22 16:55:57" }, { "name": "symfony/process", - "version": "v2.6.4", + "version": "v2.6.6", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae" + "reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/ecfc23e89d9967999fa5f60a1e9af7384396e9ae", - "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae", + "url": "https://api.github.com/repos/symfony/Process/zipball/a8bebaec1a9dc6cde53e0250e32917579b0be552", + "reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -1302,7 +1311,7 @@ ], "description": "Symfony Process Component", "homepage": "http://symfony.com", - "time": "2015-01-25 04:39:26" + "time": "2015-03-30 15:54:10" } ], "aliases": [], diff --git a/vendor/composer/include_paths.php b/vendor/composer/include_paths.php index 190e4ed1162b1da1dacf157da0aad2e2c399e7eb..9edf5c46a7fa4a87a1a0e95c6f529c776aa2d614 100644 --- a/vendor/composer/include_paths.php +++ b/vendor/composer/include_paths.php @@ -10,8 +10,8 @@ return array( $vendorDir . '/pear-pear.php.net/PEAR', $vendorDir . '/pear-pear.php.net/Validate', $vendorDir . '/pear-pear.php.net/Validate_ISPN', - $vendorDir . '/pear-pear.php.net/Archive_Tar', $vendorDir . '/pear-pear.php.net/Console_Getopt', $vendorDir . '/pear-pear.php.net/Structures_Graph', $vendorDir . '/pear-pear.php.net/XML_Util', + $vendorDir . '/pear-pear.php.net/Archive_Tar', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 588624907d4bd701d15f7744d5b9c7c8d78dc0c9..c99227f11d089c16343080da23d6d7b9f9d4f24c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -658,108 +658,6 @@ "service proxies" ] }, - { - "name": "symfony/yaml", - "version": "v2.6.4", - "version_normalized": "2.6.4.0", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", - "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2015-01-25 04:39:26", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "installation-source": "dist", - "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" - }, - { - "name": "symfony/css-selector", - "version": "v2.6.4", - "version_normalized": "2.6.4.0", - "target-dir": "Symfony/Component/CssSelector", - "source": { - "type": "git", - "url": "https://github.com/symfony/CssSelector.git", - "reference": "3f80ecc614fec68d5b4a84a0703db3fdf5ce8584" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/CssSelector/zipball/3f80ecc614fec68d5b4a84a0703db3fdf5ce8584", - "reference": "3f80ecc614fec68d5b4a84a0703db3fdf5ce8584", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2015-01-03 08:01:59", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\CssSelector\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "http://symfony.com" - }, { "name": "behat/mink", "version": "v1.6.1", @@ -817,55 +715,6 @@ "web" ] }, - { - "name": "symfony/process", - "version": "v2.6.4", - "version_normalized": "2.6.4.0", - "target-dir": "Symfony/Component/Process", - "source": { - "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/ecfc23e89d9967999fa5f60a1e9af7384396e9ae", - "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2015-01-25 04:39:26", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\Process\\": "" - } - }, - "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 Process Component", - "homepage": "http://symfony.com" - }, { "name": "zfr/rbac", "version": "1.2.0", @@ -918,84 +767,6 @@ "zf3" ] }, - { - "name": "zf-commons/zfc-rbac", - "version": "2.4.2", - "version_normalized": "2.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/ZF-Commons/zfc-rbac.git", - "reference": "42f466656ad9730025a6bbbfd4144ac2f3abb64c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ZF-Commons/zfc-rbac/zipball/42f466656ad9730025a6bbbfd4144ac2f3abb64c", - "reference": "42f466656ad9730025a6bbbfd4144ac2f3abb64c", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "zendframework/zend-mvc": "~2.2", - "zendframework/zend-servicemanager": "~2.2", - "zfr/rbac": "~1.2" - }, - "require-dev": { - "doctrine/common": "~2.4", - "doctrine/doctrine-module": "~0.8", - "doctrine/doctrine-orm-module": "~0.8", - "phpunit/phpunit": "~3.7", - "satooshi/php-coveralls": "~0.6", - "squizlabs/php_codesniffer": "1.4.*", - "zendframework/zend-developer-tools": "dev-master", - "zendframework/zendframework": "~2.2" - }, - "suggest": { - "doctrine/doctrine-module": "if you want to use Doctrine role provider", - "zendframework/zend-developer-tools": "if you want to show information about the roles" - }, - "time": "2015-01-26 11:29:23", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "ZfcRbac\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Spraggs", - "email": "theman@spiffyjr.me", - "homepage": "http://www.spiffyjr.me/" - }, - { - "name": "Jean-Marie Leroux", - "email": "jmleroux.pro@gmail.com" - }, - { - "name": "Michaël Gallego", - "email": "mic.gallego@gmail.com", - "homepage": "http://www.michaelgallego.fr" - } - ], - "description": "Zend Framework 2 Module that provides a layer of features of Zend\\Permissions\\Rbac", - "homepage": "http://www.github.com/ZF-Commons/zfc-rbac", - "keywords": [ - "module", - "permissions", - "rbac", - "zf2" - ] - }, { "name": "vufind-org/vufindhttp", "version": "v1.0.4", @@ -1044,37 +815,6 @@ "description": "VuFind 2.x HTTP service library", "homepage": "http://vufind.org/" }, - { - "name": "pear-pear.php.net/Archive_Tar", - "version": "1.3.15", - "version_normalized": "1.3.15.0", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/Archive_Tar-1.3.15.tgz", - "reference": null, - "shasum": null - }, - "require": { - "php": ">=4.3.0.0" - }, - "replace": { - "pear-pear/archive_tar": "== 1.3.15.0" - }, - "type": "pear-library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "New BSD\n License" - ], - "description": "This class provides handling of tar files in PHP.\nIt supports creating, listing, extracting and adding to tar files.\nGzip support is available if PHP has the zlib extension built-in or\nloaded. Bz2 compression is also supported with the bz2 extension loaded." - }, { "name": "pear-pear.php.net/Console_Getopt", "version": "1.4.0", @@ -1352,5 +1092,274 @@ "source": "https://github.com/zendframework/zf2/tree/release-2.3.7", "issues": "https://github.com/zendframework/zf2/issues" } + }, + { + "name": "symfony/yaml", + "version": "v2.6.6", + "version_normalized": "2.6.6.0", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "174f009ed36379a801109955fc5a71a49fe62dd4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/174f009ed36379a801109955fc5a71a49fe62dd4", + "reference": "174f009ed36379a801109955fc5a71a49fe62dd4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "time": "2015-03-30 15:54:10", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "installation-source": "dist", + "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" + }, + { + "name": "zf-commons/zfc-rbac", + "version": "v2.5.1", + "version_normalized": "2.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/ZF-Commons/zfc-rbac.git", + "reference": "80970aba715fd54f63ddde68a24bee22bafb9d17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ZF-Commons/zfc-rbac/zipball/80970aba715fd54f63ddde68a24bee22bafb9d17", + "reference": "80970aba715fd54f63ddde68a24bee22bafb9d17", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "zendframework/zend-mvc": "~2.2", + "zendframework/zend-servicemanager": "~2.2", + "zfr/rbac": "~1.2" + }, + "require-dev": { + "doctrine/common": "~2.4", + "doctrine/doctrine-module": "~0.8", + "doctrine/doctrine-orm-module": "~0.8", + "phpunit/phpunit": "~3.7", + "satooshi/php-coveralls": "~0.6", + "squizlabs/php_codesniffer": "1.4.*", + "zendframework/zend-developer-tools": "dev-master", + "zendframework/zendframework": "~2.2" + }, + "suggest": { + "doctrine/doctrine-module": "if you want to use Doctrine role provider", + "zendframework/zend-developer-tools": "if you want to show information about the roles" + }, + "time": "2015-04-16 12:10:33", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev", + "dev-develop": "3.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "ZfcRbac\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Spraggs", + "email": "theman@spiffyjr.me", + "homepage": "http://www.spiffyjr.me/" + }, + { + "name": "Jean-Marie Leroux", + "email": "jmleroux.pro@gmail.com" + }, + { + "name": "Michaël Gallego", + "email": "mic.gallego@gmail.com", + "homepage": "http://www.michaelgallego.fr" + } + ], + "description": "Zend Framework 2 Module that provides a layer of features of Zend\\Permissions\\Rbac", + "homepage": "http://www.github.com/ZF-Commons/zfc-rbac", + "keywords": [ + "module", + "permissions", + "rbac", + "zf2" + ] + }, + { + "name": "pear-pear.php.net/Archive_Tar", + "version": "1.3.16", + "version_normalized": "1.3.16.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Archive_Tar-1.3.16.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.3.0.0" + }, + "replace": { + "pear-pear/archive_tar": "== 1.3.16.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "license": [ + "New BSD\n License" + ], + "description": "This class provides handling of tar files in PHP.\nIt supports creating, listing, extracting and adding to tar files.\nGzip support is available if PHP has the zlib extension built-in or\nloaded. Bz2 compression is also supported with the bz2 extension loaded." + }, + { + "name": "symfony/process", + "version": "v2.6.6", + "version_normalized": "2.6.6.0", + "target-dir": "Symfony/Component/Process", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process.git", + "reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Process/zipball/a8bebaec1a9dc6cde53e0250e32917579b0be552", + "reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "time": "2015-03-30 15:54:10", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Process\\": "" + } + }, + "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 Process Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/css-selector", + "version": "v2.6.6", + "version_normalized": "2.6.6.0", + "target-dir": "Symfony/Component/CssSelector", + "source": { + "type": "git", + "url": "https://github.com/symfony/CssSelector.git", + "reference": "db2c48df9658423a8c168d89f7b971b73d3d74a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/CssSelector/zipball/db2c48df9658423a8c168d89f7b971b73d3d74a4", + "reference": "db2c48df9658423a8c168d89f7b971b73d3d74a4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "time": "2015-03-22 16:55:57", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\CssSelector\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "http://symfony.com" } ] diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php index 756a12a75ae5fe0b1771cc50ca6f12906120808a..fd5deeabe499854912966896d4bb4dc727f15206 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php @@ -19,6 +19,6 @@ namespace Symfony\Component\CssSelector\Exception; * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> */ -class ExpressionErrorException extends ParseException implements ExceptionInterface +class ExpressionErrorException extends ParseException { } diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php index 2decde67fedfc06cd27ce67edc49e60c8db32bfc..e60e5ed0f21d9abfb708c41f6b283d3677e7e153 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php @@ -19,6 +19,6 @@ namespace Symfony\Component\CssSelector\Exception; * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> */ -class InternalErrorException extends ParseException implements ExceptionInterface +class InternalErrorException extends ParseException { } diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php index 831b001340f9b051836053ef3d86f073e46b6223..418bc301cbca9a4d07193681081f613fd0c4d0eb 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php @@ -21,7 +21,7 @@ use Symfony\Component\CssSelector\Parser\Token; * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> */ -class SyntaxErrorException extends ParseException implements ExceptionInterface +class SyntaxErrorException extends ParseException { /** * @param string $expectedValue diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md b/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md index ef28bc9d17775a80b1ca0644b95bf6717e8036d4..ffe6c890f6b350a8468a4fd139c46af4b8280497 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md @@ -43,5 +43,5 @@ which is distributed under the BSD license. You can run the unit tests with the following command: $ cd path/to/Symfony/Component/CssSelector/ - $ composer.phar install + $ composer install $ phpunit diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php index 50daeccd1d27819f4edff05235c489cd5f344926..61ab80eec8d0b7fc3961cf6058c1b38e35b84fda 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php @@ -37,23 +37,23 @@ class CssSelectorTest extends \PHPUnit_Framework_TestCase $this->fail('->parse() throws an Exception if the css selector is not valid'); } catch (\Exception $e) { $this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid'); - $this->assertEquals("Expected identifier, but <eof at 3> found.", $e->getMessage(), '->parse() throws an Exception if the css selector is not valid'); + $this->assertEquals('Expected identifier, but <eof at 3> found.', $e->getMessage(), '->parse() throws an Exception if the css selector is not valid'); } } public function getCssToXPathWithoutPrefixTestData() { return array( - array('h1', "h1"), - array('foo|h1', "foo:h1"), - array('h1, h2, h3', "h1 | h2 | h3"), + array('h1', 'h1'), + array('foo|h1', 'foo:h1'), + array('h1, h2, h3', 'h1 | h2 | h3'), array('h1:nth-child(3n+1)', "*/*[name() = 'h1' and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"), - array('h1 > p', "h1/p"), + array('h1 > p', 'h1/p'), array('h1#foo', "h1[@id = 'foo']"), array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"), array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"), - array('h1[class]', "h1[@class]"), + array('h1[class]', 'h1[@class]'), array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"), array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"), diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php index 30f7189f06f18ba248e02af0515a12b0dbd99b6e..143328f412774620c6fe4470464fc0b98e0ad6de 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php @@ -90,12 +90,12 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase public function getCssToXPathTestData() { return array( - array('*', "*"), - array('e', "e"), - array('*|e', "e"), - array('e|f', "e:f"), - array('e[foo]', "e[@foo]"), - array('e[foo|bar]', "e[@foo:bar]"), + array('*', '*'), + array('e', 'e'), + array('*|e', 'e'), + array('e|f', 'e:f'), + array('e[foo]', 'e[@foo]'), + array('e[foo|bar]', 'e[@foo:bar]'), array('e[foo="bar"]', "e[@foo = 'bar']"), array('e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"), array('e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"), @@ -105,29 +105,29 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase array('e:nth-child(1)', "*/*[name() = 'e' and (position() = 1)]"), array('e:nth-last-child(1)', "*/*[name() = 'e' and (position() = last() - 0)]"), array('e:nth-last-child(2n+2)', "*/*[name() = 'e' and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"), - array('e:nth-of-type(1)', "*/e[position() = 1]"), - array('e:nth-last-of-type(1)', "*/e[position() = last() - 0]"), + array('e:nth-of-type(1)', '*/e[position() = 1]'), + array('e:nth-last-of-type(1)', '*/e[position() = last() - 0]'), array('div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"), array('e:first-child', "*/*[name() = 'e' and (position() = 1)]"), array('e:last-child', "*/*[name() = 'e' and (position() = last())]"), - array('e:first-of-type', "*/e[position() = 1]"), - array('e:last-of-type', "*/e[position() = last()]"), + array('e:first-of-type', '*/e[position() = 1]'), + array('e:last-of-type', '*/e[position() = last()]'), array('e:only-child', "*/*[name() = 'e' and (last() = 1)]"), - array('e:only-of-type', "e[last() = 1]"), - array('e:empty', "e[not(*) and not(string-length())]"), - array('e:EmPTY', "e[not(*) and not(string-length())]"), - array('e:root', "e[not(parent::*)]"), - array('e:hover', "e[0]"), + array('e:only-of-type', 'e[last() = 1]'), + array('e:empty', 'e[not(*) and not(string-length())]'), + array('e:EmPTY', 'e[not(*) and not(string-length())]'), + array('e:root', 'e[not(parent::*)]'), + array('e:hover', 'e[0]'), array('e:contains("foo")', "e[contains(string(.), 'foo')]"), array('e:ConTains(foo)', "e[contains(string(.), 'foo')]"), array('e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"), array('e#myid', "e[@id = 'myid']"), - array('e:not(:nth-child(odd))', "e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]"), - array('e:nOT(*)', "e[0]"), - array('e f', "e/descendant-or-self::*/f"), - array('e > f', "e/f"), + array('e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'), + array('e:nOT(*)', 'e[0]'), + array('e f', 'e/descendant-or-self::*/f'), + array('e > f', 'e/f'), array('e + f', "e/following-sibling::*[name() = 'f' and (position() = 1)]"), - array('e ~ f', "e/following-sibling::f"), + array('e ~ f', 'e/following-sibling::f'), array('div#container p', "div[@id = 'container']/descendant-or-self::*/p"), ); } diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php b/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php index 883156be7091f4cc111714084e94cd8a7d83360b..0da74d47273fb9b5c1fe0af4971f3ca4fd4d4306 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php @@ -98,9 +98,9 @@ class HtmlExtension extends AbstractExtension public function translateDisabled(XPathExpr $xpath) { return $xpath->addCondition( - "(" - ."@disabled and" - ."(" + '(' + .'@disabled and' + .'(' ."(name(.) = 'input' and @type != 'hidden')" ." or name(.) = 'button'" ." or name(.) = 'select'" @@ -109,14 +109,14 @@ class HtmlExtension extends AbstractExtension ." or name(.) = 'fieldset'" ." or name(.) = 'optgroup'" ." or name(.) = 'option'" - .")" - .") or (" + .')' + .') or (' ."(name(.) = 'input' and @type != 'hidden')" ." or name(.) = 'button'" ." or name(.) = 'select'" ." or name(.) = 'textarea'" - .")" - ." and ancestor::fieldset[@disabled]" + .')' + .' and ancestor::fieldset[@disabled]' ); // todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any." } @@ -150,10 +150,10 @@ class HtmlExtension extends AbstractExtension ." or name(.) = 'textarea'" ." or name(.) = 'keygen'" .')' - ." and not (@disabled or ancestor::fieldset[@disabled])" + .' and not (@disabled or ancestor::fieldset[@disabled])' .') or (' ."name(.) = 'option' and not(" - ."@disabled or ancestor::optgroup[@disabled]" + .'@disabled or ancestor::optgroup[@disabled]' .')' .')' ); diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json b/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json index d47c77fe6444aca9ce20659b8730c3341e8dc54c..831b8eb45efa97ec196d6e6a1835629cf27d730c 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json @@ -22,6 +22,9 @@ "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "autoload": { "psr-0": { "Symfony\\Component\\CssSelector\\": "" } }, diff --git a/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist b/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist index 7f885331517be1bd8fd14e162595292cdd5c5ab2..bc57cfcdfa8d8b0dcb16f7986ca4f075e7ee101b 100644 --- a/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist +++ b/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist @@ -7,8 +7,7 @@ bootstrap="vendor/autoload.php" > <php> - <!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) --> - <ini name="error_reporting" value="-16385"/> + <ini name="error_reporting" value="-1" /> </php> <testsuites> <testsuite name="Symfony CssSelector Component Test Suite"> diff --git a/vendor/symfony/process/Symfony/Component/Process/PhpProcess.php b/vendor/symfony/process/Symfony/Component/Process/PhpProcess.php index bc25154a8ed2decab6ace8d3bcf02f8eafaa7cc9..6a5858748a16501677c8354f40d0bad45096cd06 100644 --- a/vendor/symfony/process/Symfony/Component/Process/PhpProcess.php +++ b/vendor/symfony/process/Symfony/Component/Process/PhpProcess.php @@ -26,8 +26,6 @@ use Symfony\Component\Process\Exception\RuntimeException; */ class PhpProcess extends Process { - private $executableFinder; - /** * Constructor. * @@ -41,9 +39,12 @@ class PhpProcess extends Process */ public function __construct($script, $cwd = null, array $env = array(), $timeout = 60, array $options = array()) { - parent::__construct(null, $cwd, $env, $script, $timeout, $options); + $executableFinder = new PhpExecutableFinder(); + if (false === $php = $executableFinder->find()) { + $php = null; + } - $this->executableFinder = new PhpExecutableFinder(); + parent::__construct($php, $cwd, $env, $script, $timeout, $options); } /** @@ -62,10 +63,7 @@ class PhpProcess extends Process public function start($callback = null) { if (null === $this->getCommandLine()) { - if (false === $php = $this->executableFinder->find()) { - throw new RuntimeException('Unable to find the PHP executable.'); - } - $this->setCommandLine($php); + throw new RuntimeException('Unable to find the PHP executable.'); } parent::start($callback); diff --git a/vendor/symfony/process/Symfony/Component/Process/Process.php b/vendor/symfony/process/Symfony/Component/Process/Process.php index ece751d17e89ff864a8895cd2c8ce54ff39935af..ba619ce1cc9688e1dd7112f6e057c8bdb11ff5a5 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Process.php +++ b/vendor/symfony/process/Symfony/Component/Process/Process.php @@ -254,8 +254,6 @@ class Process * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * - * @return Process The process itself - * * @throws RuntimeException When process can't be launched * @throws RuntimeException When process is already running * @throws LogicException In case a callback is provided and output has been disabled @@ -798,7 +796,7 @@ class Process $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { if ('\\' === DIRECTORY_SEPARATOR && !$this->isSigchildEnabled()) { - exec(sprintf("taskkill /F /T /PID %d 2>&1", $this->getPid()), $output, $exitCode); + exec(sprintf('taskkill /F /T /PID %d 2>&1', $this->getPid()), $output, $exitCode); if ($exitCode > 0) { throw new RuntimeException('Unable to kill the process'); } @@ -949,6 +947,9 @@ class Process if ('\\' === DIRECTORY_SEPARATOR && $tty) { throw new RuntimeException('TTY mode is not supported on Windows platform.'); } + if ($tty && (!file_exists('/dev/tty') || !is_readable('/dev/tty'))) { + throw new RuntimeException('TTY mode requires /dev/tty to be readable.'); + } $this->tty = (bool) $tty; diff --git a/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php b/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php index 189ab8a3d13f653e010c66d3ccadd56e1f63cf58..5262ce25dd5145a6fea409611051ccdb288f9858 100644 --- a/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php +++ b/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php @@ -68,7 +68,7 @@ class ProcessBuilder } /** - * Adds an unescaped prefix to the command string. + * Adds a prefix to the command string. * * The prefix is preserved when resetting arguments. * @@ -167,8 +167,6 @@ class ProcessBuilder /** * Sets the input of the process. * - * Deprecation: As of Symfony 2.5, this method only accepts string values. - * * @param string|null $input The input as a string * * @return ProcessBuilder diff --git a/vendor/symfony/process/Symfony/Component/Process/README.md b/vendor/symfony/process/Symfony/Component/Process/README.md index 29d1cf9330441ee37ceb6300e7e9c5082ff90e2f..7c83ed413e565455377502a16122c3128e62b499 100644 --- a/vendor/symfony/process/Symfony/Component/Process/README.md +++ b/vendor/symfony/process/Symfony/Component/Process/README.md @@ -47,5 +47,5 @@ Resources You can run the unit tests with the following command: $ cd path/to/Symfony/Component/Process/ - $ composer.phar install + $ composer install $ phpunit diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php index 5bfd1a869257c2c8445643db751cbb2afff313fa..2b9c36d08a73ddaf4bdcfd1ff12871c21693e562 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php @@ -841,13 +841,13 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testStartAfterATimeout() { - $process = $this->getProcess('php -r "$n = 1000; while ($n--) {echo \'\'; usleep(1000); }"'); + $process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 1000; while ($n--) {echo \'\'; usleep(1000); }'))); $process->setTimeout(0.1); try { $process->run(); - $this->fail('An exception should have been raised.'); - } catch (\Exception $e) { + $this->fail('A RuntimeException should have been raised.'); + } catch (RuntimeException $e) { } $process->start(); usleep(1000); diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/ExecutableFinderTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/ExecutableFinderTest.php index 5033cdab0201da757c22e69ea28f64100c275ee5..20b12b1c3ce49441ef457fdd0331aec7b2be2d94 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/ExecutableFinderTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/ExecutableFinderTest.php @@ -20,7 +20,7 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase { private $path; - public function tearDown() + protected function tearDown() { if ($this->path) { // Restore path if it was changed. diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/PhpProcessTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/PhpProcessTest.php index df66ad624be314fd7be72b1835567b741b3f2e2a..5dc546cc1ce6e47f63d1739d1558595573c9f7db 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/PhpProcessTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/PhpProcessTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Process\Tests; +use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\PhpProcess; class PhpProcessTest extends \PHPUnit_Framework_TestCase @@ -26,4 +27,23 @@ PHP $process->wait(); $this->assertEquals($expected, $process->getOutput()); } + + public function testCommandLine() + { + $process = new PhpProcess(<<<PHP +<?php echo 'foobar'; +PHP + ); + + $f = new PhpExecutableFinder(); + $commandLine = $f->find(); + + $this->assertSame($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP before start'); + + $process->start(); + $this->assertSame($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after start'); + + $process->wait(); + $this->assertSame($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after wait'); + } } diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php index 02a960d4e52d443836beebcb0ee7f6eba1f4c9ca..1b5056d1bb104db63fa7981ee3e8f53848d3e9f2 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php @@ -93,7 +93,7 @@ class ProcessBuilderTest extends \PHPUnit_Framework_TestCase $proc = $pb->getProcess(); - $this->assertContains("second", $proc->getCommandLine()); + $this->assertContains('second', $proc->getCommandLine()); } public function testPrefixIsPrependedToAllGeneratedProcess() diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php index 20753df4a643ecef445bd0884c70ef02c51c4ecd..b028395f9b4de60a18e69954c316d45b72960680 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php @@ -49,8 +49,8 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase $cmd = 'php'; $exitCode = 1; $exitText = 'General error'; - $output = "Command output"; - $errorOutput = "FATAL: Unexpected error"; + $output = 'Command output'; + $errorOutput = 'FATAL: Unexpected error'; $process = $this->getMock( 'Symfony\Component\Process\Process', diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/SignalListener.php b/vendor/symfony/process/Symfony/Component/Process/Tests/SignalListener.php index 32910e17068746718773733b8f6df9a2ab177736..335ac6027e8e0b16a4a1aa6c8dbd4ab6b245d227 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/SignalListener.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/SignalListener.php @@ -3,7 +3,7 @@ // required for signal handling declare (ticks = 1); -pcntl_signal(SIGUSR1, function () {echo "Caught SIGUSR1"; exit;}); +pcntl_signal(SIGUSR1, function () {echo 'Caught SIGUSR1'; exit;}); $n = 0; diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/SimpleProcessTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/SimpleProcessTest.php index 0a8b12620571d9b775464d93fc9c4790dfe02688..4bf9ad87c6f0acc243ba99236dca7ff098efa13a 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/SimpleProcessTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/SimpleProcessTest.php @@ -17,7 +17,7 @@ class SimpleProcessTest extends AbstractProcessTest { private $enabledSigchild = false; - public function setUp() + protected function setUp() { ob_start(); phpinfo(INFO_GENERAL); diff --git a/vendor/symfony/process/Symfony/Component/Process/composer.json b/vendor/symfony/process/Symfony/Component/Process/composer.json index 39fa97cb59b052c2f2fb49656f4df8ddf68f034f..0c05fc788e5614da46d6cf79119f5c5f4f141948 100644 --- a/vendor/symfony/process/Symfony/Component/Process/composer.json +++ b/vendor/symfony/process/Symfony/Component/Process/composer.json @@ -18,6 +18,9 @@ "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "autoload": { "psr-0": { "Symfony\\Component\\Process\\": "" } }, diff --git a/vendor/symfony/process/Symfony/Component/Process/phpunit.xml.dist b/vendor/symfony/process/Symfony/Component/Process/phpunit.xml.dist index 8f147bca733e962abcf15ead6650a74b378500d9..07b617be4b5d233944996d1fe4631700b7a2cd94 100644 --- a/vendor/symfony/process/Symfony/Component/Process/phpunit.xml.dist +++ b/vendor/symfony/process/Symfony/Component/Process/phpunit.xml.dist @@ -7,8 +7,7 @@ bootstrap="vendor/autoload.php" > <php> - <!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) --> - <ini name="error_reporting" value="-16385"/> + <ini name="error_reporting" value="-1" /> </php> <testsuites> <testsuite name="Symfony Process Component Test Suite"> diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php index 302942e02e1a2ca8a62288302784976ddb3f59c9..52ea724cf407095786be9068cf0e0dd7aa8a35b7 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php @@ -129,7 +129,7 @@ class Inline setlocale(LC_NUMERIC, 'C'); } if (is_float($value)) { - $repr = strval($value); + $repr = (string) $value; if (is_infinite($value)) { $repr = str_ireplace('INF', '.Inf', $repr); } elseif (floor($value) == $value && $repr == $value) { @@ -137,7 +137,7 @@ class Inline $repr = '!!float '.$repr; } } else { - $repr = is_string($value) ? "'$value'" : strval($value); + $repr = is_string($value) ? "'$value'" : (string) $value; } if (false !== $locale) { setlocale(LC_NUMERIC, $locale); @@ -149,6 +149,7 @@ class Inline case Escaper::requiresDoubleQuoting($value): return Escaper::escapeWithDoubleQuotes($value); case Escaper::requiresSingleQuoting($value): + case preg_match(self::getHexRegex(), $value): case preg_match(self::getTimestampRegex(), $value): return Escaper::escapeWithSingleQuotes($value); default: @@ -169,8 +170,9 @@ class Inline { // array $keys = array_keys($value); - if ((1 == count($keys) && '0' == $keys[0]) - || (count($keys) > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2) + $keysCount = count($keys); + if ((1 === $keysCount && '0' == $keys[0]) + || ($keysCount > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) === $keysCount * ($keysCount - 1) / 2) ) { $output = array(); foreach ($value as $val) { @@ -285,7 +287,7 @@ class Inline { $output = array(); $len = strlen($sequence); - $i += 1; + ++$i; // [foo, bar, ...] while ($i < $len) { @@ -344,7 +346,7 @@ class Inline { $output = array(); $len = strlen($mapping); - $i += 1; + ++$i; // {foo: bar, bar:foo, ...} while ($i < $len) { @@ -466,7 +468,7 @@ class Inline case 0 === strpos($scalar, '!str'): return (string) substr($scalar, 5); case 0 === strpos($scalar, '! '): - return intval(self::parseScalar(substr($scalar, 2))); + return (int) self::parseScalar(substr($scalar, 2)); case 0 === strpos($scalar, '!!php/object:'): if (self::$objectSupport) { return unserialize(substr($scalar, 13)); @@ -481,23 +483,24 @@ class Inline return (float) substr($scalar, 8); case ctype_digit($scalar): $raw = $scalar; - $cast = intval($scalar); + $cast = (int) $scalar; return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): $raw = $scalar; - $cast = intval($scalar); + $cast = (int) $scalar; - return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); + return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw === (string) $cast) ? $cast : $raw); case is_numeric($scalar): - return '0x' == $scalar[0].$scalar[1] ? hexdec($scalar) : floatval($scalar); + case preg_match(self::getHexRegex(), $scalar): + return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; case '.inf' === $scalarLower: case '.nan' === $scalarLower: return -log(0); case '-.inf' === $scalarLower: return log(0); case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): - return floatval(str_replace(',', '', $scalar)); + return (float) str_replace(',', '', $scalar); case preg_match(self::getTimestampRegex(), $scalar): return strtotime($scalar); } @@ -530,4 +533,14 @@ class Inline $~x EOF; } + + /** + * Gets a regex that matches a YAML number in hexadecimal notation. + * + * @return string + */ + private static function getHexRegex() + { + return '~^0x[0-9a-f]++$~i'; + } } diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php index e9a94d7785dea7399d940651b0a9db1a820e0398..065e650b4c0905928f8de6cca5cb32ca2f5352ae 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php @@ -52,13 +52,13 @@ class Parser */ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false) { - $this->currentLineNb = -1; - $this->currentLine = ''; - $this->lines = explode("\n", $this->cleanup($value)); - if (!preg_match('//u', $value)) { throw new ParseException('The YAML value does not appear to be valid UTF-8.'); } + $this->currentLineNb = -1; + $this->currentLine = ''; + $value = $this->cleanup($value); + $this->lines = explode("\n", $value); if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { $mbEncoding = mb_internal_encoding(); @@ -94,7 +94,7 @@ class Parser if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); - $parser->refs = & $this->refs; + $parser->refs = &$this->refs; $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); } else { if (isset($values['leadspaces']) @@ -103,7 +103,7 @@ class Parser // this is a compact notation element, add to next block and parse $c = $this->getRealCurrentLineNb(); $parser = new Parser($c); - $parser->refs = & $this->refs; + $parser->refs = &$this->refs; $block = $values['value']; if ($this->isNextLineIndented()) { @@ -160,7 +160,7 @@ class Parser } $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); - $parser->refs = & $this->refs; + $parser->refs = &$this->refs; $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap); if (!is_array($parsed)) { @@ -211,7 +211,7 @@ class Parser } else { $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); - $parser->refs = & $this->refs; + $parser->refs = &$this->refs; $value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap); // Spec: Keys MUST be unique; first one wins. // But overwriting is allowed when a merge node is used in current block. @@ -233,9 +233,8 @@ class Parser throw new ParseException('Multiple documents are not supported.'); } - // 1-liner optionally followed by newline - $lineCount = count($this->lines); - if (1 === $lineCount || (2 === $lineCount && empty($this->lines[1]))) { + // 1-liner optionally followed by newline(s) + if ($this->lines[0] === trim($value)) { try { $value = Inline::parse($this->lines[0], $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); } catch (ParseException $e) { @@ -461,7 +460,7 @@ class Parser if (preg_match('/^'.self::FOLDED_SCALAR_PATTERN.'$/', $value, $matches)) { $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; - return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), intval(abs($modifiers))); + return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs($modifiers)); } try { diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/README.md b/vendor/symfony/yaml/Symfony/Component/Yaml/README.md index 96abbbfd16fa782f99afe810d8cfbb9119cfffc5..85a9786735afb6e32b4a2924d1174838771793b1 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/README.md +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/README.md @@ -17,5 +17,5 @@ Resources You can run the unit tests with the following command: $ cd path/to/Symfony/Component/Yaml/ - $ composer.phar install + $ composer install $ phpunit diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php index ad5aac3ff83408f91b1fccf229692a8288318e24..bbff1760383ac75c3651751825848239f899ced9 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php @@ -52,7 +52,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); if (false === setlocale(LC_ALL, $required_locales)) { - $this->markTestSkipped('Could not set any of required locales: '.implode(", ", $required_locales)); + $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales)); } $this->assertEquals('1.2', Inline::dump(1.2)); diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php index 553d2fb5de519741426cd6ea909f52e5a06d4ca4..6e39e7dc660ee5c95ace44bcab21749478db3ad3 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php @@ -135,6 +135,14 @@ EOF; ); $tests['Literal block chomping strip with multiple trailing newlines'] = array($expected, $yaml); + $yaml = <<<'EOF' +{} + + +EOF; + $expected = array(); + $tests['Literal block chomping strip with multiple trailing newlines after a 1-liner'] = array($expected, $yaml); + $yaml = <<<'EOF' foo: |- one @@ -251,8 +259,8 @@ bar: >- EOF; $expected = array( - 'foo' => "one two", - 'bar' => "one two", + 'foo' => 'one two', + 'bar' => 'one two', ); $tests['Folded block chomping strip with single trailing newline'] = array($expected, $yaml); @@ -268,8 +276,8 @@ bar: >- EOF; $expected = array( - 'foo' => "one two", - 'bar' => "one two", + 'foo' => 'one two', + 'bar' => 'one two', ); $tests['Folded block chomping strip with multiple trailing newlines'] = array($expected, $yaml); @@ -282,8 +290,8 @@ bar: >- two EOF; $expected = array( - 'foo' => "one two", - 'bar' => "one two", + 'foo' => 'one two', + 'bar' => 'one two', ); $tests['Folded block chomping strip without trailing newline'] = array($expected, $yaml); @@ -329,7 +337,7 @@ bar: > EOF; $expected = array( 'foo' => "one two\n", - 'bar' => "one two", + 'bar' => 'one two', ); $tests['Folded block chomping clip without trailing newline'] = array($expected, $yaml); @@ -375,7 +383,7 @@ bar: >+ EOF; $expected = array( 'foo' => "one two\n", - 'bar' => "one two", + 'bar' => 'one two', ); $tests['Folded block chomping keep without trailing newline'] = array($expected, $yaml); @@ -447,9 +455,9 @@ EOF; } $yamls = array( - iconv("UTF-8", "ISO-8859-1", "foo: 'äöüß'"), - iconv("UTF-8", "ISO-8859-15", "euro: '€'"), - iconv("UTF-8", "CP1252", "cp1252: '©ÉÇáñ'"), + iconv('UTF-8', 'ISO-8859-1', "foo: 'äöüß'"), + iconv('UTF-8', 'ISO-8859-15', "euro: '€'"), + iconv('UTF-8', 'CP1252', "cp1252: '©ÉÇáñ'"), ); foreach ($yamls as $yaml) { diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json b/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json index 2b2d961b7b357f0af709fa468070091ed3386bc7..b38eec29e9ac2e8ce2dc292aaec5156a00050112 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json @@ -18,6 +18,9 @@ "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "autoload": { "psr-0": { "Symfony\\Component\\Yaml\\": "" } }, diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist b/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist index 39c04ce3a6bcc03a3d1aca91673800067a685514..8f7741fe393e6d2ffe5940ccb0e71a88b330b7c9 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist @@ -7,8 +7,7 @@ bootstrap="vendor/autoload.php" > <php> - <!-- php -r 'echo -1 & ~E_USER_DEPRECATED;' --> - <ini name="error_reporting" value="-16385"/> + <ini name="error_reporting" value="-1" /> </php> <testsuites> <testsuite name="Symfony Yaml Component Test Suite"> diff --git a/vendor/zf-commons/zfc-rbac/docs/04. Guards.md b/vendor/zf-commons/zfc-rbac/docs/04. Guards.md index 85a4d3a2085730be48f4e7784b369bc35b3ebec4..68195618fe4265482090779a5af8c91158af5e06 100644 --- a/vendor/zf-commons/zfc-rbac/docs/04. Guards.md +++ b/vendor/zf-commons/zfc-rbac/docs/04. Guards.md @@ -177,17 +177,34 @@ return [ 'guards' => [ 'ZfcRbac\Guard\RoutePermissionsGuard' => [ 'admin*' => ['admin'], - 'post/manage' => ['post.update', 'post.delete'] + 'post/manage' => ['post.update', 'post.delete'] ] ] ] ]; ``` -> All permissions in a rule must be matched (it is an AND condition). +> By default, all permissions in a rule must be matched (an AND condition). In the previous example, one must have ```post.update``` **AND** ```post.delete``` permissions -to access the ```post/manage``` route. +to access the ```post/manage``` route. You can also specify an OR condition like so: + +```php +use ZfcRbac\Guard\GuardInterface; + +return [ + 'zfc_rbac' => [ + 'guards' => [ + 'ZfcRbac\Guard\RoutePermissionsGuard' => [ + 'post/manage' => [ + 'permissions' => ['post.update', 'post.delete'], + 'condition' => GuardInterface::CONDITION_OR + ] + ] + ] + ] +]; +``` > Permissions are linked to roles, not to users diff --git a/vendor/zf-commons/zfc-rbac/docs/07. Cookbook.md b/vendor/zf-commons/zfc-rbac/docs/07. Cookbook.md index 14dee276a7eec599113835312f482bfedb2159db..32131d67560f525caac620424a9f96368ea1d3bf 100644 --- a/vendor/zf-commons/zfc-rbac/docs/07. Cookbook.md +++ b/vendor/zf-commons/zfc-rbac/docs/07. Cookbook.md @@ -51,19 +51,19 @@ Since we have a dependency, let's inject it using the `ControllerManager`, we wi ```php class Module { - // getAutoloaderConfig(), getConfig(), etc... - - public function getControllerConfig() + public function getConfig() { return [ - 'factories' => [ - 'PostController' => function($cpm) { - // We assume a Service key 'PostService' here that returns the PostService Class - return new PostController( - $cpm->getServiceLocator()->get('PostService') - ); - } - ] + 'controllers' => [ + 'factories' => [ + 'PostController' => function ($cpm) { + // We assume a Service key 'PostService' here that returns the PostService Class + return new PostController( + $cpm->getServiceLocator()->get('PostService') + ); + }, + ], + ], ]; } } @@ -162,6 +162,7 @@ permissions before doing anything wrong. So let's modify our previously created ```php use Doctrine\Common\Persistence\ObjectManager; +use ZfcRbac\Service\AuthorizationService; class PostService { diff --git a/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Collector/RbacCollector.php b/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Collector/RbacCollector.php index 532a867c95382cea998cbb650f26fbe164e76144..a8ff2c79a302307bfc9b51d3ce04914b96dcc570 100644 --- a/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Collector/RbacCollector.php +++ b/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Collector/RbacCollector.php @@ -181,12 +181,17 @@ class RbacCollector implements CollectorInterface, Serializable */ private function collectPermissions(RoleInterface $role) { - // Gather the permissions for the given role. We have to use reflection as - // the RoleInterface does not have "getPermissions" method - $reflectionProperty = new ReflectionProperty($role, 'permissions'); - $reflectionProperty->setAccessible(true); + if (method_exists($role, 'getPermissions')) { + $permissions = $role->getPermissions(); + } else { - $permissions = $reflectionProperty->getValue($role); + // Gather the permissions for the given role. We have to use reflection as + // the RoleInterface does not have "getPermissions" method + $reflectionProperty = new ReflectionProperty($role, 'permissions'); + $reflectionProperty->setAccessible(true); + + $permissions = $reflectionProperty->getValue($role); + } if ($permissions instanceof Traversable) { $permissions = iterator_to_array($permissions); diff --git a/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Guard/GuardInterface.php b/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Guard/GuardInterface.php index 05f19537ae225448b384c161bba9c898302e10c1..4a88f0633742fdebf4da9852f43273ea0addc8d1 100644 --- a/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Guard/GuardInterface.php +++ b/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Guard/GuardInterface.php @@ -47,6 +47,12 @@ interface GuardInterface extends ListenerAggregateInterface const POLICY_DENY = 'deny'; const POLICY_ALLOW = 'allow'; + /** + * Condition constants + */ + const CONDITION_OR = 'OR'; + const CONDITION_AND = 'AND'; + /** * @param MvcEvent $event * @return bool diff --git a/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Guard/RoutePermissionsGuard.php b/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Guard/RoutePermissionsGuard.php index 577a9c8251bec0280ff818474ff5d3c14f8df8c9..a48822da0c49214cdc9ee44d013a426b026a7082 100644 --- a/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Guard/RoutePermissionsGuard.php +++ b/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Guard/RoutePermissionsGuard.php @@ -18,7 +18,7 @@ namespace ZfcRbac\Guard; use Zend\Mvc\MvcEvent; -use ZfcRbac\Exception; +use ZfcRbac\Exception\InvalidArgumentException; use ZfcRbac\Service\AuthorizationServiceInterface; /** @@ -101,12 +101,37 @@ class RoutePermissionsGuard extends AbstractGuard return true; } - foreach ($allowedPermissions as $permission) { - if (!$this->authorizationService->isGranted($permission)) { - return false; + $permissions = isset($allowedPermissions['permissions']) + ? $allowedPermissions['permissions'] + : $allowedPermissions; + + $condition = isset($allowedPermissions['condition']) + ? $allowedPermissions['condition'] + : GuardInterface::CONDITION_AND; + + if (GuardInterface::CONDITION_AND === $condition) { + foreach ($permissions as $permission) { + if (!$this->authorizationService->isGranted($permission)) { + return false; + } + } + + return true; + } + + if (GuardInterface::CONDITION_OR === $condition) { + foreach ($permissions as $permission) { + if ($this->authorizationService->isGranted($permission)) { + return true; + } } + + return false; } - return true; + throw new InvalidArgumentException(sprintf( + 'Condition must be either "AND" or "OR", %s given', + is_object($condition) ? get_class($condition) : gettype($condition) + )); } } diff --git a/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Identity/AuthenticationIdentityProvider.php b/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Identity/AuthenticationIdentityProvider.php index 316f77ace324fc3b6d541ab453add2c8e2a98e5c..81dea0f66399593749f7e9c5befbb7bfc43c1572 100644 --- a/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Identity/AuthenticationIdentityProvider.php +++ b/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Identity/AuthenticationIdentityProvider.php @@ -30,7 +30,7 @@ use ZfcRbac\Exception; class AuthenticationIdentityProvider implements IdentityProviderInterface { /** - * @var AuthenticationService + * @var AuthenticationServiceInterface */ protected $authenticationService; diff --git a/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Asset/MockRoleWithPermissionMethod.php b/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Asset/MockRoleWithPermissionMethod.php new file mode 100644 index 0000000000000000000000000000000000000000..376d352a0b54fb89f06dd5772029a0afd723e16e --- /dev/null +++ b/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Asset/MockRoleWithPermissionMethod.php @@ -0,0 +1,22 @@ +<?php + +namespace ZfcRbacTest\Asset; + +use Rbac\Role\RoleInterface; + +class MockRoleWithPermissionMethod implements RoleInterface +{ + public function getPermissions() + { + return ['permission-method-a', 'permission-method-b']; + } + + public function getName() + { + return 'role-with-permission-method'; + } + public function hasPermission($permission) + { + return false; + } +} \ No newline at end of file diff --git a/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Asset/MockRoleWithPermissionProperty.php b/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Asset/MockRoleWithPermissionProperty.php new file mode 100644 index 0000000000000000000000000000000000000000..44522bbb2d791bec9266aa3222584de2ae6b918c --- /dev/null +++ b/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Asset/MockRoleWithPermissionProperty.php @@ -0,0 +1,19 @@ +<?php + +namespace ZfcRbacTest\Asset; + +use Rbac\Role\RoleInterface; + +class MockRoleWithPermissionProperty implements RoleInterface +{ + private $permissions = ['permission-property-a', 'permission-property-b']; + + public function getName() + { + return 'role-with-permission-property'; + } + public function hasPermission($permission) + { + return false; + } +} \ No newline at end of file diff --git a/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Collector/RbacCollectorTest.php b/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Collector/RbacCollectorTest.php index c89ca2488061d0f26e2b11f339eefe568ff4ce44..ae0c99c47363118808314dd96d8fa055fe318737 100644 --- a/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Collector/RbacCollectorTest.php +++ b/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Collector/RbacCollectorTest.php @@ -18,6 +18,7 @@ namespace ZfcRbacTest\Collector; +use Rbac\Role\RoleInterface; use Zend\Mvc\MvcEvent; use Zend\Permissions\Rbac\Rbac; use Zend\Permissions\Rbac\Role; @@ -25,8 +26,11 @@ use ZfcRbac\Collector\RbacCollector; use ZfcRbac\Guard\GuardInterface; use ZfcRbac\Options\ModuleOptions; use ZfcRbac\Role\InMemoryRoleProvider; +use ZfcRbac\Role\RoleProviderInterface; use ZfcRbac\Service\RoleService; use Rbac\Traversal\Strategy\RecursiveRoleIteratorStrategy; +use ZfcRbacTest\Asset\MockRoleWithPermissionMethod; +use ZfcRbacTest\Asset\MockRoleWithPermissionProperty; /** * @covers \ZfcRbac\Collector\RbacCollector @@ -176,4 +180,95 @@ class RbacCollectorTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expectedCollection, $collection); } -} + + /** + * Tests the collectPermissions method when the role has a $permissions Property + */ + public function testCollectPermissionsProperty() + { + $expectedCollection = [ + 'guards' => [], + 'roles' => ['role-with-permission-property'], + 'permissions' => [ + 'role-with-permission-property' => ['permission-property-a', 'permission-property-b'], + ], + 'options' => [ + 'guest_role' => 'guest', + 'protection_policy' => GuardInterface::POLICY_ALLOW, + ], + ]; + + $collection = $this->collectPermissionsPropertyTestBase(new MockRoleWithPermissionProperty()); + $this->assertEquals($expectedCollection, $collection); + } + + /** + * Tests the collectPermissions method when the role has a getPermissions() method + */ + public function testCollectPermissionsMethod() + { + $expectedCollection = [ + 'guards' => [], + 'roles' => ['role-with-permission-method'], + 'permissions' => [ + 'role-with-permission-method' => ['permission-method-a', 'permission-method-b'], + ], + 'options' => [ + 'guest_role' => 'guest', + 'protection_policy' => GuardInterface::POLICY_ALLOW, + ], + ]; + + $collection = $this->collectPermissionsPropertyTestBase(new MockRoleWithPermissionMethod()); + $this->assertEquals($expectedCollection, $collection); + } + + /** + * Base method for the *collectPermissionProperty tests + * @param RoleInterface $role + * @return array|\string[] + */ + private function collectPermissionsPropertyTestBase(RoleInterface $role) + { + $serviceManager = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface'); + + $application = $this->getMock('Zend\Mvc\Application', [], [], '', false); + $application->expects($this->once())->method('getServiceManager')->will($this->returnValue($serviceManager)); + + $mvcEvent = new MvcEvent(); + $mvcEvent->setApplication($application); + + $identity = $this->getMock('ZfcRbac\Identity\IdentityInterface'); + $identity->expects($this->once()) + ->method('getRoles') + ->will($this->returnValue([$role])); + + $identityProvider = $this->getMock('ZfcRbac\Identity\IdentityProviderInterface'); + $identityProvider->expects($this->once()) + ->method('getIdentity') + ->will($this->returnValue($identity)); + + $roleProvider = $this->getMock('ZfcRbac\Role\RoleProviderInterface'); + + $roleService = new RoleService($identityProvider, + $roleProvider, + new RecursiveRoleIteratorStrategy()); + + $serviceManager->expects($this->at(0)) + ->method('get') + ->with('ZfcRbac\Service\RoleService') + ->will($this->returnValue($roleService)); + + $serviceManager->expects($this->at(1)) + ->method('get') + ->with('ZfcRbac\Options\ModuleOptions') + ->will($this->returnValue(new ModuleOptions())); + + $collector = new RbacCollector(); + $collector->collect($mvcEvent); + + $collector->unserialize($collector->serialize()); + return $collector->getCollection(); + } + +} \ No newline at end of file diff --git a/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Guard/RoutePermissionsGuardTest.php b/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Guard/RoutePermissionsGuardTest.php index 0de7740d04d68ce122115ef5ac5c3e8c84a80709..4420546e9ce675d3cfd02ed83e5d01584cdcd7ad 100644 --- a/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Guard/RoutePermissionsGuardTest.php +++ b/vendor/zf-commons/zfc-rbac/tests/ZfcRbacTest/Guard/RoutePermissionsGuardTest.php @@ -326,6 +326,26 @@ class RoutePermissionsGuardTest extends \PHPUnit_Framework_TestCase 'isGranted' => true, 'policy' => GuardInterface::POLICY_DENY ], + [ + 'rules' => ['route' => [ + 'permissions' => ['post.edit', 'post.read'], + 'condition' => GuardInterface::CONDITION_OR + ]], + 'matchedRouteName' => 'route', + 'identityPermissions' => [['post.edit', null, true]], + 'isGranted' => true, + 'policy' => GuardInterface::POLICY_DENY + ], + [ + 'rules' => ['route' => [ + 'permissions' => ['post.edit', 'post.read'], + 'condition' => GuardInterface::CONDITION_AND + ]], + 'matchedRouteName' => 'route', + 'identityPermissions' => [['post.edit', null, true]], + 'isGranted' => false, + 'policy' => GuardInterface::POLICY_DENY + ] ]; }