diff options
-rw-r--r-- | Acl/README.md | 2 | ||||
-rw-r--r-- | Acl/composer.json | 6 | ||||
-rw-r--r-- | Core/Authorization/AccessDecisionManager.php | 16 | ||||
-rw-r--r-- | Core/README.md | 2 | ||||
-rw-r--r-- | Core/Tests/Authorization/AccessDecisionManagerTest.php | 8 | ||||
-rw-r--r-- | Core/composer.json | 14 | ||||
-rw-r--r-- | Csrf/README.md | 2 | ||||
-rw-r--r-- | Csrf/composer.json | 8 | ||||
-rw-r--r-- | Http/README.md | 2 | ||||
-rw-r--r-- | Http/composer.json | 16 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | composer.json | 20 |
12 files changed, 48 insertions, 50 deletions
diff --git a/Acl/README.md b/Acl/README.md index bff2209..458820e 100644 --- a/Acl/README.md +++ b/Acl/README.md @@ -11,7 +11,7 @@ Resources Documentation: -https://symfony.com/doc/2.7/book/security.html +https://symfony.com/doc/2.8/book/security.html Tests ----- diff --git a/Acl/composer.json b/Acl/composer.json index 917c061..b2ac560 100644 --- a/Acl/composer.json +++ b/Acl/composer.json @@ -17,10 +17,10 @@ ], "require": { "php": ">=5.3.9", - "symfony/security-core": "~2.4" + "symfony/security-core": "~2.4|~3.0.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7", + "symfony/phpunit-bridge": "~2.7|~3.0.0", "doctrine/common": "~2.2", "doctrine/dbal": "~2.2", "psr/log": "~1.0" @@ -36,7 +36,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } } } diff --git a/Core/Authorization/AccessDecisionManager.php b/Core/Authorization/AccessDecisionManager.php index b8b6a77..61debe3 100644 --- a/Core/Authorization/AccessDecisionManager.php +++ b/Core/Authorization/AccessDecisionManager.php @@ -41,12 +41,8 @@ class AccessDecisionManager implements AccessDecisionManagerInterface * * @throws \InvalidArgumentException */ - public function __construct(array $voters, $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true) + public function __construct(array $voters = array(), $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true) { - if (!$voters) { - throw new \InvalidArgumentException('You must at least add one voter.'); - } - $strategyMethod = 'decide'.ucfirst($strategy); if (!is_callable(array($this, $strategyMethod))) { throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy)); @@ -59,6 +55,16 @@ class AccessDecisionManager implements AccessDecisionManagerInterface } /** + * Configures the voters. + * + * @param VoterInterface[] $voters An array of VoterInterface instances + */ + public function setVoters(array $voters) + { + $this->voters = $voters; + } + + /** * {@inheritdoc} */ public function decide(TokenInterface $token, array $attributes, $object = null) diff --git a/Core/README.md b/Core/README.md index b0d1749..f1da5b1 100644 --- a/Core/README.md +++ b/Core/README.md @@ -11,7 +11,7 @@ Resources Documentation: -https://symfony.com/doc/2.7/book/security.html +https://symfony.com/doc/2.8/book/security.html Tests ----- diff --git a/Core/Tests/Authorization/AccessDecisionManagerTest.php b/Core/Tests/Authorization/AccessDecisionManagerTest.php index 3c970d1..bd876c7 100644 --- a/Core/Tests/Authorization/AccessDecisionManagerTest.php +++ b/Core/Tests/Authorization/AccessDecisionManagerTest.php @@ -49,14 +49,6 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase /** * @expectedException \InvalidArgumentException */ - public function testSetVotersEmpty() - { - $manager = new AccessDecisionManager(array()); - } - - /** - * @expectedException \InvalidArgumentException - */ public function testSetUnsupportedStrategy() { new AccessDecisionManager(array($this->getVoter(VoterInterface::ACCESS_GRANTED)), 'fooBar'); diff --git a/Core/composer.json b/Core/composer.json index 38054df..4d24053 100644 --- a/Core/composer.json +++ b/Core/composer.json @@ -19,12 +19,12 @@ "php": ">=5.3.9" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7", - "symfony/event-dispatcher": "~2.1", - "symfony/expression-language": "~2.6", - "symfony/http-foundation": "~2.4", - "symfony/translation": "~2.0,>=2.0.5", - "symfony/validator": "~2.5,>=2.5.5", + "symfony/phpunit-bridge": "~2.7|~3.0.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/http-foundation": "~2.4|~3.0.0", + "symfony/translation": "~2.0,>=2.0.5|~3.0.0", + "symfony/validator": "~2.5,>=2.5.5|~3.0.0", "psr/log": "~1.0", "ircmaxell/password-compat": "1.0.*" }, @@ -41,7 +41,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } } } diff --git a/Csrf/README.md b/Csrf/README.md index 3ae550b..10f4784 100644 --- a/Csrf/README.md +++ b/Csrf/README.md @@ -9,7 +9,7 @@ Resources Documentation: -https://symfony.com/doc/2.7/book/security.html +https://symfony.com/doc/2.8/book/security.html Tests ----- diff --git a/Csrf/composer.json b/Csrf/composer.json index a0de39d..20fd2ff 100644 --- a/Csrf/composer.json +++ b/Csrf/composer.json @@ -17,11 +17,11 @@ ], "require": { "php": ">=5.3.9", - "symfony/security-core": "~2.4" + "symfony/security-core": "~2.4|~3.0.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7", - "symfony/http-foundation": "~2.1" + "symfony/phpunit-bridge": "~2.7|~3.0.0", + "symfony/http-foundation": "~2.1|~3.0.0" }, "suggest": { "symfony/http-foundation": "For using the class SessionTokenStorage." @@ -32,7 +32,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } } } diff --git a/Http/README.md b/Http/README.md index 7619bfc..11f6f72 100644 --- a/Http/README.md +++ b/Http/README.md @@ -11,7 +11,7 @@ Resources Documentation: -https://symfony.com/doc/2.7/book/security.html +https://symfony.com/doc/2.8/book/security.html Tests ----- diff --git a/Http/composer.json b/Http/composer.json index 7b08d00..1c49504 100644 --- a/Http/composer.json +++ b/Http/composer.json @@ -17,15 +17,15 @@ ], "require": { "php": ">=5.3.9", - "symfony/security-core": "~2.6", - "symfony/event-dispatcher": "~2.1", - "symfony/http-foundation": "~2.4", - "symfony/http-kernel": "~2.4" + "symfony/security-core": "~2.6|~3.0.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/http-foundation": "~2.4|~3.0.0", + "symfony/http-kernel": "~2.4|~3.0.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7", - "symfony/routing": "~2.2", - "symfony/security-csrf": "~2.4", + "symfony/phpunit-bridge": "~2.7|~3.0.0", + "symfony/routing": "~2.2|~3.0.0", + "symfony/security-csrf": "~2.4|~3.0.0", "psr/log": "~1.0" }, "suggest": { @@ -38,7 +38,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } } } @@ -11,7 +11,7 @@ Resources Documentation: -https://symfony.com/doc/2.7/book/security.html +https://symfony.com/doc/2.8/book/security.html Tests ----- diff --git a/composer.json b/composer.json index aeea64a..75abcf8 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,9 @@ ], "require": { "php": ">=5.3.9", - "symfony/event-dispatcher": "~2.2", - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.4" + "symfony/event-dispatcher": "~2.2|~3.0.0", + "symfony/http-foundation": "~2.1|~3.0.0", + "symfony/http-kernel": "~2.4|~3.0.0" }, "replace": { "symfony/security-acl": "self.version", @@ -28,16 +28,16 @@ "symfony/security-http": "self.version" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7", - "symfony/intl": "~2.3", - "symfony/routing": "~2.2", - "symfony/translation": "~2.0,>=2.0.5", - "symfony/validator": "~2.5,>=2.5.5", + "symfony/phpunit-bridge": "~2.7|~3.0.0", + "symfony/intl": "~2.3|~3.0.0", + "symfony/routing": "~2.2|~3.0.0", + "symfony/translation": "~2.0,>=2.0.5|~3.0.0", + "symfony/validator": "~2.5,>=2.5.5|~3.0.0", "doctrine/common": "~2.2", "doctrine/dbal": "~2.2", "psr/log": "~1.0", "ircmaxell/password-compat": "~1.0", - "symfony/expression-language": "~2.6" + "symfony/expression-language": "~2.6|~3.0.0" }, "suggest": { "symfony/class-loader": "For using the ACL generateSql script", @@ -54,7 +54,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } } } |