diff --git a/.php_cs b/.php_cs deleted file mode 100644 index ab8d1a3..0000000 --- a/.php_cs +++ /dev/null @@ -1,58 +0,0 @@ -exclude('vendor') - ->in(__DIR__) -; - -return Symfony\CS\Config\Config::create() - ->level(Symfony\CS\FixerInterface::NONE_LEVEL) - ->fixers([ - 'psr0', - 'encoding', - 'short_tag', - 'braces', - 'elseif', - 'eof_ending', - 'function_call_space', - 'function_declaration', // ? - 'indentation', - 'line_after_namespace', - 'linefeed', - 'lowercase_constants', - 'lowercase_keywords', - 'php_closing_tag', - 'single_line_after_imports', - 'trailing_spaces', - 'visibility', - 'array_element_white_space_after_comma', - 'blankline_after_open_tag', - 'duplicate_semicolon', - 'extra_empty_lines', - 'function_typehint_space', - 'namespace_no_leading_whitespace', - 'no_blank_lines_after_class_opening', - 'no_empty_lines_after_phpdocs', - 'phpdoc_scalar', - 'phpdoc_separation', - 'phpdoc_types', - 'remove_leading_slash_use', - 'remove_lines_between_uses', - 'return', - 'self_accessor', - 'short_bool_cast', - 'single_array_no_trailing_comma', - 'spaces_before_semicolon', - 'spaces_cast', - 'standardize_not_equal', - 'ternary_spaces', - 'trim_array_spaces', - 'unused_use', - 'whitespacy_lines', - 'align_double_arrow', - 'header_comment', - 'newline_after_open_tag', - 'short_array_syntax', - ]) - ->finder($finder) -; diff --git a/.travis.yml b/.travis.yml index 6c0db0d..2c1bfca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 7.2 - 7.3 - 7.4 - hhvm diff --git a/composer.json b/composer.json index 4bc8c34..d45ed07 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "bin/assetic" ], "require": { - "php": "^7.2", + "php": "^7.3", "assetic/framework": "~2.0.0", "widmogrod/php-functional": "^1.0", "zendframework/zend-mvc": "^3.0", @@ -32,7 +32,7 @@ }, "require-dev": { "phpunit/phpunit": "^9", - "fabpot/php-cs-fixer": "^2.17" + "friendsofphp/php-cs-fixer": "^2.17" }, "suggest": { "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", @@ -41,7 +41,7 @@ "scripts": { "test": "phpunit", "fix-code": "php-cs-fixer fix", - "check-code": "php-cs-fixer fix --verbose --diff --dry-run" + "check-code": "php-cs-fixer fix src/ --verbose --diff --dry-run --using-cache=no" }, "autoload": { "psr-0": { diff --git a/composer.lock b/composer.lock index e5cfb64..00ac642 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "88e97e4bd1d0a02d9addc94b76afd8bb", + "content-hash": "e0a150df59475dd9c9a3d869d125afc5", "packages": [ { "name": "assetic/framework", @@ -1796,28 +1796,29 @@ "packages-dev": [ { "name": "composer/semver", - "version": "1.7.2", + "version": "3.2.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", + "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -1867,7 +1868,7 @@ "type": "tidelift" } ], - "time": "2020-12-03T15:47:16+00:00" + "time": "2020-11-13T08:59:24+00:00" }, { "name": "composer/xdebug-handler", @@ -2140,7 +2141,7 @@ "time": "2020-05-25T17:44:05+00:00" }, { - "name": "fabpot/php-cs-fixer", + "name": "friendsofphp/php-cs-fixer", "version": "v2.17.3", "source": { "type": "git", @@ -2237,7 +2238,6 @@ "type": "github" } ], - "abandoned": "friendsofphp/php-cs-fixer", "time": "2020-12-24T11:14:44+00:00" }, { @@ -3105,18 +3105,64 @@ ], "time": "2020-07-13T17:55:55+00:00" }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "time": "2019-01-08T18:20:26+00:00" + }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -3125,7 +3171,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -3150,7 +3196,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "sebastian/code-unit", @@ -3954,38 +4000,40 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.18", + "version": "v5.2.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "5d4c874b0eb1c32d40328a09dbc37307a5a910b0" + "reference": "1c93f7a1dff592c252574c79a8635a8a80856042" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5d4c874b0eb1c32d40328a09dbc37307a5a910b0", - "reference": "5d4c874b0eb1c32d40328a09dbc37307a5a910b0", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1c93f7a1dff592c252574c79a8635a8a80856042", + "reference": "1c93f7a1dff592c252574c79a8635a8a80856042", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/event-dispatcher-contracts": "^2", + "symfony/polyfill-php80": "^1.15" }, "conflict": { - "symfony/dependency-injection": "<3.4" + "symfony/dependency-injection": "<4.4" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" + "symfony/event-dispatcher-implementation": "2.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/error-handler": "~3.4|~4.4", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^3.4|^4.0|^5.0" + "symfony/stopwatch": "^4.4|^5.0" }, "suggest": { "symfony/dependency-injection": "", @@ -4030,33 +4078,33 @@ "type": "tidelift" } ], - "time": "2020-12-18T07:41:31+00:00" + "time": "2020-12-18T08:03:05+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.9", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" + "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2", + "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" }, "suggest": { - "psr/event-dispatcher": "", "symfony/event-dispatcher-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.2-dev" }, "thanks": { "name": "symfony/contracts", @@ -4106,7 +4154,7 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:19:58+00:00" + "time": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/filesystem", @@ -4659,7 +4707,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^5.6 || ^7.0" + "php": "^7.2" }, "platform-dev": [], "plugin-api-version": "1.1.0" diff --git a/src/AsseticBundle/CacheBuster/LastModifiedStrategy.php b/src/AsseticBundle/CacheBuster/LastModifiedStrategy.php index 7d6e5d9..39a0c8c 100644 --- a/src/AsseticBundle/CacheBuster/LastModifiedStrategy.php +++ b/src/AsseticBundle/CacheBuster/LastModifiedStrategy.php @@ -2,9 +2,9 @@ namespace AsseticBundle\CacheBuster; -use Assetic\Asset\AssetInterface, - Assetic\Contracts\Factory\Worker\WorkerInterface, - Assetic\Factory\AssetFactory; +use Assetic\Asset\AssetInterface; +use Assetic\Contracts\Factory\Worker\WorkerInterface; +use Assetic\Factory\AssetFactory; class LastModifiedStrategy implements WorkerInterface { diff --git a/src/AsseticBundle/CacheBuster/NoCache.php b/src/AsseticBundle/CacheBuster/NoCache.php index 6c6c352..e5edba3 100644 --- a/src/AsseticBundle/CacheBuster/NoCache.php +++ b/src/AsseticBundle/CacheBuster/NoCache.php @@ -2,9 +2,9 @@ namespace AsseticBundle\CacheBuster; -use Assetic\Asset\AssetInterface, - Assetic\Contracts\Factory\Worker\WorkerInterface, - Assetic\Factory\AssetFactory; +use Assetic\Asset\AssetInterface; +use Assetic\Contracts\Factory\Worker\WorkerInterface; +use Assetic\Factory\AssetFactory; class NoCache implements WorkerInterface { diff --git a/src/AsseticBundle/Service.php b/src/AsseticBundle/Service.php index 5370fa8..5b71d62 100644 --- a/src/AsseticBundle/Service.php +++ b/src/AsseticBundle/Service.php @@ -441,9 +441,9 @@ public function moveRaw( foreach ($asset as $value) { /** @var $value AssetInterface */ if ($disableSourcePath) { - $value->setTargetPath(( $targetPath ? $targetPath : '' ) . basename( $value->getSourcePath() ) ); + $value->setTargetPath(($targetPath ? $targetPath : '') . basename($value->getSourcePath())); } else { - $value->setTargetPath(( $targetPath ? $targetPath : '' ) . $value->getSourcePath()); + $value->setTargetPath(($targetPath ? $targetPath : '') . $value->getSourcePath()); } $value = $this->cacheAsset($value); @@ -465,8 +465,8 @@ public function prepareCollection($options, $name, Factory\AssetFactory $factory $options = isset($options['options']) ? $options['options'] : []; $options['output'] = isset($options['output']) ? $options['output'] : $name; $moveRaw = isset($options['move_raw']) && $options['move_raw']; - $targetPath = !empty( $options['targetPath'] ) ? $options['targetPath'] : ''; - if (substr( $targetPath, -1 ) != DIRECTORY_SEPARATOR) { + $targetPath = !empty($options['targetPath']) ? $options['targetPath'] : ''; + if (substr($targetPath, -1) != DIRECTORY_SEPARATOR) { $targetPath .= DIRECTORY_SEPARATOR; } @@ -476,10 +476,10 @@ public function prepareCollection($options, $name, Factory\AssetFactory $factory // Allow to move all files 1:1 to new directory // its particularly useful when this assets are i.e. images. if ($moveRaw) { - if ( isset( $options['disable_source_path'] ) ) { - $this->moveRaw( $asset, $targetPath, $factory, $options['disable_source_path'] ); + if (isset($options['disable_source_path'])) { + $this->moveRaw($asset, $targetPath, $factory, $options['disable_source_path']); } else { - $this->moveRaw( $asset, $targetPath, $factory ); + $this->moveRaw($asset, $targetPath, $factory); } } else { $asset = $this->cacheAsset($asset); diff --git a/src/AsseticBundle/View/AbstractStrategy.php b/src/AsseticBundle/View/AbstractStrategy.php index 7c67a8a..ab80992 100644 --- a/src/AsseticBundle/View/AbstractStrategy.php +++ b/src/AsseticBundle/View/AbstractStrategy.php @@ -2,8 +2,7 @@ namespace AsseticBundle\View; -use AsseticBundle\Service, - Zend\View\Renderer\RendererInterface as Renderer; +use Zend\View\Renderer\RendererInterface as Renderer; abstract class AbstractStrategy implements StrategyInterface { diff --git a/src/AsseticBundle/View/Helper/Asset.php b/src/AsseticBundle/View/Helper/Asset.php index b62dc0e..1919cb3 100644 --- a/src/AsseticBundle/View/Helper/Asset.php +++ b/src/AsseticBundle/View/Helper/Asset.php @@ -2,12 +2,12 @@ namespace AsseticBundle\View\Helper; -use Zend\View\Helper\Placeholder\Container, - Zend\ServiceManager\ServiceLocatorInterface; -use AsseticBundle\ServiceFactory, - AsseticBundle\Exception, - Assetic\Asset\AssetInterface, - Assetic\Asset\AssetCollection; +use Zend\View\Helper\Placeholder\Container; +use Zend\ServiceManager\ServiceLocatorInterface; +use AsseticBundle\ServiceFactory; +use AsseticBundle\Exception; +use Assetic\Asset\AssetInterface; +use Assetic\Asset\AssetCollection; /** * Class Asset diff --git a/src/AsseticBundle/View/StrategyInterface.php b/src/AsseticBundle/View/StrategyInterface.php index 3e97aa2..f071534 100644 --- a/src/AsseticBundle/View/StrategyInterface.php +++ b/src/AsseticBundle/View/StrategyInterface.php @@ -2,9 +2,8 @@ namespace AsseticBundle\View; -use AsseticBundle\Service, - Zend\View\Renderer\RendererInterface as Renderer, - Assetic\Asset\AssetInterface; +use Zend\View\Renderer\RendererInterface as Renderer; +use Assetic\Asset\AssetInterface; interface StrategyInterface {