diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aeebc8..8964876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -224,7 +224,7 @@ return array( 2012-08-26 ---------- - * Rewrite AsseticBundle\Service to determinate how to set up template to use resources (link, script) depending on Zend\View\Renderer + * Rewrite AsseticBundle\Service to determinate how to set up template to use resources (link, script) depending on Laminas\View\Renderer * Assetic configuration namespace was change from: ``` php diff --git a/Module.php b/Module.php index fbbd163..853cfee 100755 --- a/Module.php +++ b/Module.php @@ -2,10 +2,10 @@ namespace AsseticBundle; -use Zend\EventManager\EventInterface; -use Zend\ModuleManager\Feature\AutoloaderProviderInterface; -use Zend\ModuleManager\Feature\BootstrapListenerInterface; -use Zend\ModuleManager\Feature\ConfigProviderInterface; +use Laminas\EventManager\EventInterface; +use Laminas\ModuleManager\Feature\AutoloaderProviderInterface; +use Laminas\ModuleManager\Feature\BootstrapListenerInterface; +use Laminas\ModuleManager\Feature\ConfigProviderInterface; class Module implements AutoloaderProviderInterface, @@ -15,13 +15,13 @@ class Module implements /** * Listen to the bootstrap event * - * @param \Zend\EventManager\EventInterface $e + * @param \Laminas\EventManager\EventInterface $e * * @return array */ public function onBootstrap(EventInterface $e) { - /** @var $e \Zend\Mvc\MvcEvent */ + /** @var $e \Laminas\Mvc\MvcEvent */ // Only attach the Listener if the request came in through http(s) if (PHP_SAPI !== 'cli') { $app = $e->getApplication(); @@ -41,14 +41,14 @@ public function getConfig() } /** - * Return an array for passing to Zend\Loader\AutoloaderFactory. + * Return an array for passing to Laminas\Loader\AutoloaderFactory. * * @return array */ public function getAutoloaderConfig() { return [ - 'Zend\Loader\StandardAutoloader' => [ + 'Laminas\Loader\StandardAutoloader' => [ 'namespaces' => [ __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__ . '/' ], diff --git a/bin/assetic b/bin/assetic index ee0cb47..b6fb8f3 100755 --- a/bin/assetic +++ b/bin/assetic @@ -34,11 +34,11 @@ if (!file_exists('config/application.config.php')) { $appConfig = include 'config/application.config.php'; if (file_exists('config/development.config.php')) { - $appConfig = Zend\Stdlib\ArrayUtils::merge($appConfig, include 'config/development.config.php'); + $appConfig = Laminas\Stdlib\ArrayUtils::merge($appConfig, include 'config/development.config.php'); } // init Zend Application -$application = \Zend\Mvc\Application::init($appConfig); +$application = \Laminas\Mvc\Application::init($appConfig); /* @var $cli \Symfony\Console\Application */ $cli = $application->getServiceManager()->get('AsseticBundle\Cli'); diff --git a/composer.json b/composer.json index 5aee3eb..5709ae0 100644 --- a/composer.json +++ b/composer.json @@ -1,52 +1,55 @@ { - "name": "widmogrod/zf2-assetic-module", - "type": "library", - "description": "Zend Framework 2 module that provides complete integration of Assetic library", - "keywords": [ - "assetic", - "assets", - "resources", - "css", - "js", - "less" - ], - "homepage": "https://github.com/widmogrod/zf2-assetic-module", - "license": "MIT", - "authors": [ - { - "name": "Gabriel Habryn", - "email": "widmogrod@gmail.com", - "homepage": "https://github.com/widmogrod/zf2-assetic-module", - "role": "Developer" - } - ], - "bin": [ - "bin/assetic" - ], - "require": { - "php": "^5.6 || ^7.0", - "kriswallsmith/assetic": "^1.2", - "widmogrod/php-functional": "^1.0", - "zendframework/zend-mvc": "^3.0", - "symfony/console": "^3.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^5.4", - "fabpot/php-cs-fixer": "^1.12" - }, - "suggest": { - "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", - "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler" - }, - "scripts": { - "test": "phpunit", - "fix-code": "php-cs-fixer fix", - "check-code": "php-cs-fixer fix --verbose --diff --dry-run" - }, - "autoload": { - "psr-0": { - "AsseticBundle": "src" + "name": "widmogrod/zf2-assetic-module", + "type": "library", + "description": "Zend Framework 2 module that provides complete integration of Assetic library", + "keywords": [ + "assetic", + "assets", + "resources", + "css", + "js", + "less" + ], + "homepage": "https://github.com/widmogrod/zf2-assetic-module", + "license": "MIT", + "authors": [ + { + "name": "Gabriel Habryn", + "email": "widmogrod@gmail.com", + "homepage": "https://github.com/widmogrod/zf2-assetic-module", + "role": "Developer" + } + ], + "bin": [ + "bin/assetic" + ], + "require": { + "php": "^5.6 || ^7.0", + "kriswallsmith/assetic": "^1.2", + "widmogrod/php-functional": "^1.0", + "laminas/laminas-mvc": "^3.0", + "symfony/console": "^3.1.3", + "laminas/laminas-dependency-plugin": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4", + "fabpot/php-cs-fixer": "^1.12" + }, + "suggest": { + "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", + "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler" }, - "classmap": ["Module.php"] - } + "scripts": { + "test": "phpunit", + "fix-code": "php-cs-fixer fix", + "check-code": "php-cs-fixer fix --verbose --diff --dry-run" + }, + "autoload": { + "psr-0": { + "AsseticBundle": "src" + }, + "classmap": [ + "Module.php" + ] + } } diff --git a/configs/module.config.php b/configs/module.config.php index afea7f7..d8d1881 100644 --- a/configs/module.config.php +++ b/configs/module.config.php @@ -1,6 +1,6 @@ [ @@ -13,8 +13,8 @@ 'AsseticBundle\Service' => 'AsseticBundle\ServiceFactory', 'Assetic\AssetWriter' => 'AsseticBundle\WriterFactory', 'AsseticBundle\FilterManager' => 'AsseticBundle\FilterManagerFactory', - 'Assetic\AssetManager' => 'Zend\ServiceManager\Factory\InvokableFactory', - 'AsseticBundle\Listener' => 'Zend\ServiceManager\Factory\InvokableFactory', + 'Assetic\AssetManager' => 'Laminas\ServiceManager\Factory\InvokableFactory', + 'AsseticBundle\Listener' => 'Laminas\ServiceManager\Factory\InvokableFactory', 'AsseticBundle\Cli' => 'AsseticBundle\Cli\ApplicationFactory', 'AsseticBundle\Configuration' => 'AsseticBundle\Factory\ConfigurationFactory', ], @@ -22,9 +22,9 @@ 'assetic_configuration' => [ 'rendererToStrategy' => [ - 'Zend\View\Renderer\PhpRenderer' => 'AsseticBundle\View\ViewHelperStrategy', - 'Zend\View\Renderer\FeedRenderer' => 'AsseticBundle\View\NoneStrategy', - 'Zend\View\Renderer\JsonRenderer' => 'AsseticBundle\View\NoneStrategy', + 'Laminas\View\Renderer\PhpRenderer' => 'AsseticBundle\View\ViewHelperStrategy', + 'Laminas\View\Renderer\FeedRenderer' => 'AsseticBundle\View\NoneStrategy', + 'Laminas\View\Renderer\JsonRenderer' => 'AsseticBundle\View\NoneStrategy', ], 'acceptableErrors' => [ Application::ERROR_CONTROLLER_NOT_FOUND, diff --git a/docs/config.md b/docs/config.md index 590273d..8567f13 100644 --- a/docs/config.md +++ b/docs/config.md @@ -201,9 +201,9 @@ Also,…. | Renderer | Strategy | |----------|-----------| -| `Zend\View\Renderer\PhpRenderer` | `AsseticBundle\View\ViewHelperStrategy` -| `Zend\View\Renderer\FeedRenderer` | `AsseticBundle\View\NoneStrategy` -| `Zend\View\Renderer\JsonRenderer` | `AsseticBundle\View\NoneStrategy` +| `Laminas\View\Renderer\PhpRenderer` | `AsseticBundle\View\ViewHelperStrategy` +| `Laminas\View\Renderer\FeedRenderer` | `AsseticBundle\View\NoneStrategy` +| `Laminas\View\Renderer\JsonRenderer` | `AsseticBundle\View\NoneStrategy` ### AcceptableErrors diff --git a/docs/howto.md b/docs/howto.md index 85dafe1..5eae5d0 100644 --- a/docs/howto.md +++ b/docs/howto.md @@ -4,7 +4,7 @@ Step by step introduction, how to use `AsseticBundle` with `ZF3` #### [Install ZF3 skeleton application](https://github.com/zendframework/ZendSkeletonApplication) ``` -composer create-project zendframework/skeleton-application path/to/project +composer create-project laminas/skeleton-application path/to/project ``` #### Enter ZF3 directory @@ -20,8 +20,8 @@ composer require widmogrod/zf2-assetic-module #### Declare `AsseticBundle` in the `config/modules.config.php` file: ```php return [ - 'Zend\Router', - 'Zend\Validator', + 'Laminas\Router', + 'Laminas\Validator', 'AsseticBundle', // <-- put it here 'Application', ]; diff --git a/docs/tips.md b/docs/tips.md index bd02186..d2de64f 100644 --- a/docs/tips.md +++ b/docs/tips.md @@ -74,7 +74,7 @@ To enable it you only need to specify which cache buster strategy you want to us ```php use AsseticBundle\CacheBuster\LastModifiedStrategy; -use Zend\ServiceManager\Factory\InvokableFactory; +use Laminas\ServiceManager\Factory\InvokableFactory; return [ 'service_manager' => [ @@ -93,7 +93,7 @@ return [ Please note anyone using `zf2-assetic-module` with `ZfcRbac` you will experience this same issue on (Access Denied)[https://github.com/widmogrod/zf2-assetic-module/pull/41]. This is due to the white list of acceptable errors in assetic. You will need to allow the firewall errors in your assetic configuration to get css on your access denied pages: ``` -use Zend\Mvc\Application; +use Laminas\Mvc\Application; use ZfcRbac\Guard\GuardInterface; return array( diff --git a/src/AsseticBundle/Cli/ApplicationFactory.php b/src/AsseticBundle/Cli/ApplicationFactory.php index 5d54c7b..4585ada 100644 --- a/src/AsseticBundle/Cli/ApplicationFactory.php +++ b/src/AsseticBundle/Cli/ApplicationFactory.php @@ -4,8 +4,8 @@ use Interop\Container\ContainerInterface; use Symfony\Component\Console\Application; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; +use Laminas\ServiceManager\FactoryInterface; +use Laminas\ServiceManager\ServiceLocatorInterface; class ApplicationFactory implements FactoryInterface { diff --git a/src/AsseticBundle/Configuration.php b/src/AsseticBundle/Configuration.php index 1eeed7c..2167cbf 100644 --- a/src/AsseticBundle/Configuration.php +++ b/src/AsseticBundle/Configuration.php @@ -2,7 +2,7 @@ namespace AsseticBundle; -use Zend\Stdlib; +use Laminas\Stdlib; class Configuration { @@ -51,7 +51,7 @@ class Configuration /** * The base url. * - * By default this value is set from "\Zend\Http\PhpEnvironment\Request::getBaseUrl()" + * By default this value is set from "\Laminas\Http\PhpEnvironment\Request::getBaseUrl()" * * Example: * @@ -65,7 +65,7 @@ class Configuration /** * The base path. * - * By default this value is set from "\Zend\Http\PhpEnvironment\Request::getBasePath()" + * By default this value is set from "\Laminas\Http\PhpEnvironment\Request::getBasePath()" * * Example: * @@ -116,7 +116,7 @@ class Configuration /** * Map of strategies that will be choose to setup Assetic\AssetInterface - * for particular Zend\View\Renderer\RendererInterface + * for particular Laminas\View\Renderer\RendererInterface * * @var array */ diff --git a/src/AsseticBundle/Factory/ConfigurationFactory.php b/src/AsseticBundle/Factory/ConfigurationFactory.php index 12bf4bd..f5d1741 100644 --- a/src/AsseticBundle/Factory/ConfigurationFactory.php +++ b/src/AsseticBundle/Factory/ConfigurationFactory.php @@ -4,7 +4,7 @@ use AsseticBundle\Configuration; use Interop\Container\ContainerInterface; -use Zend\ServiceManager\Factory\FactoryInterface; +use Laminas\ServiceManager\Factory\FactoryInterface; class ConfigurationFactory implements FactoryInterface { diff --git a/src/AsseticBundle/FilterManager.php b/src/AsseticBundle/FilterManager.php index ba2b901..ad5c5a0 100644 --- a/src/AsseticBundle/FilterManager.php +++ b/src/AsseticBundle/FilterManager.php @@ -4,7 +4,7 @@ use Assetic\Filter\FilterInterface; use Assetic\FilterManager as AsseticFilterManager; -use Zend\ServiceManager\ServiceLocatorInterface; +use Laminas\ServiceManager\ServiceLocatorInterface; class FilterManager extends AsseticFilterManager { diff --git a/src/AsseticBundle/FilterManagerFactory.php b/src/AsseticBundle/FilterManagerFactory.php index d5bb3b3..35b2719 100644 --- a/src/AsseticBundle/FilterManagerFactory.php +++ b/src/AsseticBundle/FilterManagerFactory.php @@ -3,8 +3,8 @@ namespace AsseticBundle; use Interop\Container\ContainerInterface; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; +use Laminas\ServiceManager\FactoryInterface; +use Laminas\ServiceManager\ServiceLocatorInterface; class FilterManagerFactory implements FactoryInterface { diff --git a/src/AsseticBundle/Listener.php b/src/AsseticBundle/Listener.php index cca0396..455bd11 100644 --- a/src/AsseticBundle/Listener.php +++ b/src/AsseticBundle/Listener.php @@ -2,11 +2,11 @@ namespace AsseticBundle; -use Zend\EventManager\EventManagerInterface; -use Zend\EventManager\ListenerAggregateInterface; -use Zend\Http\PhpEnvironment\Response; -use Zend\Mvc\MvcEvent; -use Zend\Stdlib\CallbackHandler; +use Laminas\EventManager\EventManagerInterface; +use Laminas\EventManager\ListenerAggregateInterface; +use Laminas\Http\PhpEnvironment\Response; +use Laminas\Mvc\MvcEvent; +use Laminas\Stdlib\CallbackHandler; class Listener implements ListenerAggregateInterface { diff --git a/src/AsseticBundle/Service.php b/src/AsseticBundle/Service.php index ab36ad1..f757dbd 100644 --- a/src/AsseticBundle/Service.php +++ b/src/AsseticBundle/Service.php @@ -11,7 +11,7 @@ use Assetic\Asset\AssetInterface; use Assetic\Asset\AssetCache; use Assetic\Cache\FilesystemCache; -use Zend\View\Renderer\RendererInterface as Renderer; +use Laminas\View\Renderer\RendererInterface as Renderer; use AsseticBundle\View\StrategyInterface; class Service @@ -325,7 +325,7 @@ public function setupRendererFromOptions(Renderer $renderer, array $options) } /** - * @param \Zend\View\Renderer\RendererInterface $renderer + * @param \Laminas\View\Renderer\RendererInterface $renderer * * @return bool */ @@ -339,7 +339,7 @@ public function hasStrategyForRenderer(Renderer $renderer) /** * Get strategy to setup assets for given $renderer. * - * @param \Zend\View\Renderer\RendererInterface $renderer + * @param \Laminas\View\Renderer\RendererInterface $renderer * * @throws Exception\DomainException * @throws Exception\InvalidArgumentException @@ -388,7 +388,7 @@ public function getStrategyForRenderer(Renderer $renderer) /** * Get renderer name from $renderer object. * - * @param \Zend\View\Renderer\RendererInterface $renderer + * @param \Laminas\View\Renderer\RendererInterface $renderer * * @return string */ diff --git a/src/AsseticBundle/ServiceFactory.php b/src/AsseticBundle/ServiceFactory.php index 9599e0a..4c06841 100644 --- a/src/AsseticBundle/ServiceFactory.php +++ b/src/AsseticBundle/ServiceFactory.php @@ -3,8 +3,8 @@ namespace AsseticBundle; use Interop\Container\ContainerInterface; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; +use Laminas\ServiceManager\FactoryInterface; +use Laminas\ServiceManager\ServiceLocatorInterface; class ServiceFactory implements FactoryInterface { @@ -19,7 +19,7 @@ public function __invoke(ContainerInterface $locator, $requestedName, array $opt { $asseticConfig = $locator->get('AsseticConfiguration'); if ($asseticConfig->detectBaseUrl()) { - /** @var $request \Zend\Http\PhpEnvironment\Request */ + /** @var $request \Laminas\Http\PhpEnvironment\Request */ $request = $locator->get('Request'); if (method_exists($request, 'getBaseUrl')) { $asseticConfig->setBaseUrl($request->getBaseUrl()); diff --git a/src/AsseticBundle/View/AbstractStrategy.php b/src/AsseticBundle/View/AbstractStrategy.php index 7c67a8a..c3e1478 100644 --- a/src/AsseticBundle/View/AbstractStrategy.php +++ b/src/AsseticBundle/View/AbstractStrategy.php @@ -3,7 +3,7 @@ namespace AsseticBundle\View; use AsseticBundle\Service, - Zend\View\Renderer\RendererInterface as Renderer; + Laminas\View\Renderer\RendererInterface as Renderer; abstract class AbstractStrategy implements StrategyInterface { @@ -23,7 +23,7 @@ public function setRenderer(Renderer $renderer) } /** - * @return \Zend\View\Renderer\RendererInterface + * @return \Laminas\View\Renderer\RendererInterface */ public function getRenderer() { diff --git a/src/AsseticBundle/View/Helper/Asset.php b/src/AsseticBundle/View/Helper/Asset.php index b62dc0e..5573486 100644 --- a/src/AsseticBundle/View/Helper/Asset.php +++ b/src/AsseticBundle/View/Helper/Asset.php @@ -2,8 +2,8 @@ namespace AsseticBundle\View\Helper; -use Zend\View\Helper\Placeholder\Container, - Zend\ServiceManager\ServiceLocatorInterface; +use Laminas\View\Helper\Placeholder\Container, + Laminas\ServiceManager\ServiceLocatorInterface; use AsseticBundle\ServiceFactory, AsseticBundle\Exception, Assetic\Asset\AssetInterface, diff --git a/src/AsseticBundle/View/StrategyInterface.php b/src/AsseticBundle/View/StrategyInterface.php index 3e97aa2..b762e86 100644 --- a/src/AsseticBundle/View/StrategyInterface.php +++ b/src/AsseticBundle/View/StrategyInterface.php @@ -3,7 +3,7 @@ namespace AsseticBundle\View; use AsseticBundle\Service, - Zend\View\Renderer\RendererInterface as Renderer, + Laminas\View\Renderer\RendererInterface as Renderer, Assetic\Asset\AssetInterface; interface StrategyInterface diff --git a/src/AsseticBundle/View/ViewHelperStrategy.php b/src/AsseticBundle/View/ViewHelperStrategy.php index 2fe9c70..51d748b 100644 --- a/src/AsseticBundle/View/ViewHelperStrategy.php +++ b/src/AsseticBundle/View/ViewHelperStrategy.php @@ -3,7 +3,7 @@ namespace AsseticBundle\View; use Assetic\Asset\AssetCollection; -use Zend\View\Renderer\PhpRenderer; +use Laminas\View\Renderer\PhpRenderer; use Assetic\Asset\AssetInterface; class ViewHelperStrategy extends AbstractStrategy diff --git a/src/AsseticBundle/WriterFactory.php b/src/AsseticBundle/WriterFactory.php index 5a839b0..d64be51 100644 --- a/src/AsseticBundle/WriterFactory.php +++ b/src/AsseticBundle/WriterFactory.php @@ -4,8 +4,8 @@ use Assetic\AssetWriter; use Interop\Container\ContainerInterface; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; +use Laminas\ServiceManager\FactoryInterface; +use Laminas\ServiceManager\ServiceLocatorInterface; class WriterFactory implements FactoryInterface { diff --git a/tests/AsseticBundleTest/FilterManager.php b/tests/AsseticBundleTest/FilterManager.php index c533715..5b52ddc 100644 --- a/tests/AsseticBundleTest/FilterManager.php +++ b/tests/AsseticBundleTest/FilterManager.php @@ -3,7 +3,7 @@ namespace AsseticBundleTest; use AsseticBundle; -use Zend\ServiceManager; +use Laminas\ServiceManager; /** * Generated by PHPUnit_SkeletonGenerator 1.2.0 on 2012-11-17 at 11:53:23. diff --git a/tests/AsseticBundleTest/Service.php b/tests/AsseticBundleTest/Service.php index 362b0e1..e0c6d92 100644 --- a/tests/AsseticBundleTest/Service.php +++ b/tests/AsseticBundleTest/Service.php @@ -211,14 +211,14 @@ public function testInitLoadedModules() public function testGetRendererName() { - $renderer = $this->getMockBuilder('Zend\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); + $renderer = $this->getMockBuilder('Laminas\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); $name = $this->object->getRendererName($renderer); $this->assertEquals(get_class($renderer), $name); } public function testHasStrategyForRenderer() { - $renderer = $this->getMockBuilder('Zend\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); + $renderer = $this->getMockBuilder('Laminas\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); $value = $this->object->hasStrategyForRenderer($renderer); $this->assertFalse($value); @@ -233,7 +233,7 @@ public function testHasStrategyForRenderer() public function testGetStrategyForRendererNull() { - $renderer = $this->getMockBuilder('Zend\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); + $renderer = $this->getMockBuilder('Laminas\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); $value = $this->object->getStrategyForRenderer($renderer); $this->assertNull($value); } @@ -243,7 +243,7 @@ public function testGetStrategyForRendererNull() */ public function testGetStrategyForRendererFailure() { - $renderer = $this->getMockBuilder('Zend\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); + $renderer = $this->getMockBuilder('Laminas\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); $this->object->getConfiguration()->addRendererToStrategy( get_class($renderer), @@ -255,7 +255,7 @@ public function testGetStrategyForRendererFailure() public function testGetStrategyForRendererSuccess() { - $renderer = $this->getMockBuilder('Zend\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); + $renderer = $this->getMockBuilder('Laminas\View\Renderer\RendererInterface')->disableOriginalConstructor()->getMock(); $this->object->getConfiguration()->addRendererToStrategy( get_class($renderer),