Skip to content

Commit

Permalink
Merge pull request #37 from Becklyn/next
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannik committed Jun 15, 2020
2 parents 1b2ded7 + 95d35fb commit a1cb022
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.6.9
=====

* (bug) Fix small BC break in older symfony versions.


2.6.8
=====

Expand Down
4 changes: 3 additions & 1 deletion src/Cache/CacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,15 @@ public function isOptional ()
/**
* @inheritdoc
*/
public function warmUp ($cacheDir) : void
public function warmUp ($cacheDir) : array
{
if (!$this->isDebug)
{
$this->clearCache(null);
$this->fillCache(null);
}

return [];
}


Expand Down
18 changes: 17 additions & 1 deletion src/DependencyInjection/BecklynAssetsConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Becklyn\AssetsBundle\DependencyInjection;

use Becklyn\AssetsBundle\Asset\Asset;
use Symfony\Component\Config\Definition\BaseNode;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
Expand Down Expand Up @@ -34,7 +35,7 @@ public function getConfigTreeBuilder ()
->defaultFalse()
->end()
->arrayNode("dependency_maps")
->setDeprecated("The `becklyn_assets.dependency_maps` option is deprecated, as the the maps will always be automatically loaded.")
->setDeprecated(...$this->formatDeprecationMessage("becklyn/assets-bundle", "2.6.6", "The %path%.%node% option is deprecated, as the the maps will always be automatically loaded."))
->scalarPrototype()->end()
->defaultValue([])
->info("The paths to the dependency maps. In asset notation: e.g. `@namespace/js/_dependencies.json`")
Expand Down Expand Up @@ -96,4 +97,19 @@ function (array $paths)
->info($description)
->defaultValue([]);
}

/**
* Returns the correct deprecation param's as an array for setDeprecated.
*
* Symfony/Config v5.1 introduces a deprecation notice when calling
* setDeprecation() with less than 3 args and the getDeprecation method was
* introduced at the same time. By checking if getDeprecation() exists,
* we can determine the correct param count to use when calling setDeprecated.
*/
private function formatDeprecationMessage (string $bundle, string $version, string $message) : array
{
return \method_exists(BaseNode::class, 'getDeprecation')
? [$bundle, $version, $message]
: [$message];
}
}
2 changes: 1 addition & 1 deletion vendor-bin/test/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"becklyn/php-cs": "^3.0.12"
"becklyn/php-cs": "^6"
}
}

0 comments on commit a1cb022

Please sign in to comment.