From a36cd4a223a829ec7b76ee537c7dec7c55f3991a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Gallego?= Date: Sat, 18 Jan 2014 19:08:01 +0100 Subject: [PATCH] Remove factory --- CHANGELOG.md | 5 +++ composer.json | 3 -- src/Rbac/Factory/RbacFactory.php | 46 ---------------------- tests/RbacTest/Factory/RbacFactoryTest.php | 39 ------------------ 4 files changed, 5 insertions(+), 88 deletions(-) delete mode 100644 src/Rbac/Factory/RbacFactory.php delete mode 100644 tests/RbacTest/Factory/RbacFactoryTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index ac2628e..40d77f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGELOG +## 1.1.0 + +* [BC] Remove factory. It was not intend to be here but rather on ZfcRbac. This way this component is completely +framework agnostic + ## 1.0.0 * Initial release diff --git a/composer.json b/composer.json index f6cf4d6..f2e0460 100644 --- a/composer.json +++ b/composer.json @@ -26,9 +26,6 @@ "squizlabs/php_codesniffer": "1.4.*", "satooshi/php-coveralls": "~0.6" }, - "suggest": { - "zendframework/zend-servicemanager": "If you want to use RBAC factory" - }, "autoload": { "psr-0": { "Rbac\\": "src/" diff --git a/src/Rbac/Factory/RbacFactory.php b/src/Rbac/Factory/RbacFactory.php deleted file mode 100644 index f766f63..0000000 --- a/src/Rbac/Factory/RbacFactory.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @licence MIT - */ -class RbacFactory implements FactoryInterface -{ - /** - * {@inheritDoc} - */ - public function createService(ServiceLocatorInterface $serviceLocator) - { - if (version_compare(PHP_VERSION, '5.5.0', '>=')) { - $traversalStrategy = new GeneratorStrategy(); - } else { - $traversalStrategy = new RecursiveRoleIteratorStrategy(); - } - - return new Rbac($traversalStrategy); - } -} diff --git a/tests/RbacTest/Factory/RbacFactoryTest.php b/tests/RbacTest/Factory/RbacFactoryTest.php deleted file mode 100644 index be20159..0000000 --- a/tests/RbacTest/Factory/RbacFactoryTest.php +++ /dev/null @@ -1,39 +0,0 @@ -createService($serviceManager); - - $this->assertInstanceOf('Rbac\Rbac', $rbac); - $this->assertInstanceOf('Rbac\Traversal\Strategy\TraversalStrategyInterface', $rbac->getTraversalStrategy()); - } -}