Skip to content

Commit a1cb022

Browse files
author
Jannik
authored
Merge pull request #37 from Becklyn/next
2 parents 1b2ded7 + 95d35fb commit a1cb022

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2.6.9
2+
=====
3+
4+
* (bug) Fix small BC break in older symfony versions.
5+
6+
17
2.6.8
28
=====
39

src/Cache/CacheWarmer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,15 @@ public function isOptional ()
130130
/**
131131
* @inheritdoc
132132
*/
133-
public function warmUp ($cacheDir) : void
133+
public function warmUp ($cacheDir) : array
134134
{
135135
if (!$this->isDebug)
136136
{
137137
$this->clearCache(null);
138138
$this->fillCache(null);
139139
}
140+
141+
return [];
140142
}
141143

142144

src/DependencyInjection/BecklynAssetsConfiguration.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Becklyn\AssetsBundle\DependencyInjection;
44

55
use Becklyn\AssetsBundle\Asset\Asset;
6+
use Symfony\Component\Config\Definition\BaseNode;
67
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
78
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
89
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
@@ -34,7 +35,7 @@ public function getConfigTreeBuilder ()
3435
->defaultFalse()
3536
->end()
3637
->arrayNode("dependency_maps")
37-
->setDeprecated("The `becklyn_assets.dependency_maps` option is deprecated, as the the maps will always be automatically loaded.")
38+
->setDeprecated(...$this->formatDeprecationMessage("becklyn/assets-bundle", "2.6.6", "The %path%.%node% option is deprecated, as the the maps will always be automatically loaded."))
3839
->scalarPrototype()->end()
3940
->defaultValue([])
4041
->info("The paths to the dependency maps. In asset notation: e.g. `@namespace/js/_dependencies.json`")
@@ -96,4 +97,19 @@ function (array $paths)
9697
->info($description)
9798
->defaultValue([]);
9899
}
100+
101+
/**
102+
* Returns the correct deprecation param's as an array for setDeprecated.
103+
*
104+
* Symfony/Config v5.1 introduces a deprecation notice when calling
105+
* setDeprecation() with less than 3 args and the getDeprecation method was
106+
* introduced at the same time. By checking if getDeprecation() exists,
107+
* we can determine the correct param count to use when calling setDeprecated.
108+
*/
109+
private function formatDeprecationMessage (string $bundle, string $version, string $message) : array
110+
{
111+
return \method_exists(BaseNode::class, 'getDeprecation')
112+
? [$bundle, $version, $message]
113+
: [$message];
114+
}
99115
}

vendor-bin/test/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"becklyn/php-cs": "^3.0.12"
3+
"becklyn/php-cs": "^6"
44
}
55
}

0 commit comments

Comments
 (0)