Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 16b1061

Browse files
authored
Merge pull request #92 from axwel13/master
fix deprecations and symfony 6
2 parents cae5524 + cf7f6aa commit 16b1061

File tree

7 files changed

+18
-17
lines changed

7 files changed

+18
-17
lines changed

src/Activator/TraceableChainActivator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TraceableChainActivator extends ChainActivator
2323
/**
2424
* {@inheritdoc}
2525
*/
26-
public function isActive($name, Context $context)
26+
public function isActive($name, Context $context): bool
2727
{
2828
$stack = [];
2929
$result = false;

src/DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(array $configurators)
3636
/**
3737
* {@inheritdoc}
3838
*/
39-
public function getConfigTreeBuilder()
39+
public function getConfigTreeBuilder(): TreeBuilder
4040
{
4141
$treeBuilder = new TreeBuilder('flagception');
4242
$rootNode = $treeBuilder->getRootNode();
@@ -108,7 +108,7 @@ public function getConfigTreeBuilder()
108108
*
109109
* @return NodeDefinition
110110
*/
111-
public function appendActivators()
111+
public function appendActivators(): NodeDefinition
112112
{
113113
$builder = new TreeBuilder('activators');
114114
$node = $builder->getRootNode();

src/DependencyInjection/FlagceptionExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function load(array $configs, ContainerBuilder $container)
7171
*
7272
* @throws Exception
7373
*/
74-
private function getConfigurators(ContainerBuilder $container)
74+
private function getConfigurators(ContainerBuilder $container): array
7575
{
7676
$configurators = [];
7777

src/Listener/AnnotationSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function onKernelController(ControllerEvent $event)
9595
/**
9696
* {@inheritdoc}
9797
*/
98-
public static function getSubscribedEvents()
98+
public static function getSubscribedEvents(): array
9999
{
100100
return [
101101
KernelEvents::CONTROLLER => 'onKernelController',

src/Listener/RoutingMetadataSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function onKernelController(ControllerEvent $event)
6565
/**
6666
* {@inheritdoc}
6767
*/
68-
public static function getSubscribedEvents()
68+
public static function getSubscribedEvents(): array
6969
{
7070
return [
7171
KernelEvents::CONTROLLER => 'onKernelController',

src/Profiler/FeatureDataCollector.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function collect(Request $request, Response $response, Throwable $excepti
9595
];
9696
}
9797

98-
$featureTrace = &$this->data['requests'][$trace['feature']];
98+
$featureTrace = $this->data['requests'][$trace['feature']];
9999
$featureTrace['requests']++;
100100

101101
if ($trace['result'] === true) {
@@ -117,6 +117,7 @@ public function collect(Request $request, Response $response, Throwable $excepti
117117
$this->data['activators'][$activator]['inactiveRequests']++;
118118
}
119119
}
120+
$this->data['requests'][$trace['feature']] = $featureTrace;
120121
}
121122

122123
$this->data['summary']['features'] = count($this->data['requests']);
@@ -136,7 +137,7 @@ public function collect(Request $request, Response $response, Throwable $excepti
136137
*
137138
* @return array
138139
*/
139-
public function getRequests()
140+
public function getRequests(): array
140141
{
141142
return $this->data['requests'];
142143
}
@@ -146,7 +147,7 @@ public function getRequests()
146147
*
147148
* @return array
148149
*/
149-
public function getActivators()
150+
public function getActivators(): array
150151
{
151152
return $this->data['activators'];
152153
}
@@ -156,7 +157,7 @@ public function getActivators()
156157
*
157158
* @return array
158159
*/
159-
public function getDecorators()
160+
public function getDecorators(): array
160161
{
161162
return $this->data['decorators'];
162163
}
@@ -166,7 +167,7 @@ public function getDecorators()
166167
*
167168
* @return array
168169
*/
169-
public function getTrace()
170+
public function getTrace(): array
170171
{
171172
return $this->data['trace'];
172173
}
@@ -176,15 +177,15 @@ public function getTrace()
176177
*
177178
* @return array
178179
*/
179-
public function getSummary()
180+
public function getSummary(): array
180181
{
181182
return $this->data['summary'];
182183
}
183184

184185
/**
185186
* {@inheritdoc}
186187
*/
187-
public function getName()
188+
public function getName(): string
188189
{
189190
return 'flagception';
190191
}

src/Twig/ToggleExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(FeatureManagerInterface $manager)
4141
*
4242
* @return bool
4343
*/
44-
public function isActive($name, array $contextValues = [])
44+
public function isActive(string $name, array $contextValues = []): bool
4545
{
4646
$context = new Context();
4747
foreach ($contextValues as $contextKey => $contextValue) {
@@ -54,7 +54,7 @@ public function isActive($name, array $contextValues = [])
5454
/**
5555
* {@inheritDoc}
5656
*/
57-
public function getFunctions()
57+
public function getFunctions(): array
5858
{
5959
return [
6060
new TwigFunction('feature', [$this, 'isActive']),
@@ -64,7 +64,7 @@ public function getFunctions()
6464
/**
6565
* {@inheritDoc}
6666
*/
67-
public function getTests()
67+
public function getTests(): array
6868
{
6969
return [
7070
new TwigTest('active feature', [$this, 'isActive']),
@@ -77,7 +77,7 @@ public function getTests()
7777
*
7878
* @return string
7979
*/
80-
public function getName()
80+
public function getName(): string
8181
{
8282
return 'flagception';
8383
}

0 commit comments

Comments
 (0)