Skip to content

Commit 72cc5b1

Browse files
BAP-22772: Use override attribute instead of inheritdoc annotations (#39344)
- Updated php-cs-fixer config - Applied new cs rules - Deleted annotations like "{@inheritdoc}" - Rector AddOverrideAttributeToOverriddenMethodsRector rule applied - Updated documentation
1 parent 96d218e commit 72cc5b1

7 files changed

+11
-9
lines changed

Bundle/DependencyInjection/Configuration.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ class Configuration implements ConfigurationInterface
99
{
1010
public const ROOT_NODE_NAME = 'oro_twig_inspector';
1111

12-
/**
13-
* {@inheritdoc}
14-
*/
12+
#[\Override]
1513
public function getConfigTreeBuilder(): TreeBuilder
1614
{
1715
$treeBuilder = new TreeBuilder(self::ROOT_NODE_NAME);

Bundle/DependencyInjection/OroTwigInspectorExtension.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
*/
1313
class OroTwigInspectorExtension extends Extension
1414
{
15-
/**
16-
* {@inheritDoc}
17-
*/
15+
#[\Override]
1816
public function load(array $configs, ContainerBuilder $container): void
1917
{
2018
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

DataCollector/TwigInspectorCollector.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
*/
1212
class TwigInspectorCollector implements DataCollectorInterface
1313
{
14+
#[\Override]
1415
public function collect(Request $request, Response $response, \Throwable $exception = null): void
1516
{
1617
}
1718

19+
#[\Override]
1820
public function reset(): void
1921
{
2022
}
2123

22-
/**
23-
* {@inheritDoc}
24-
*/
24+
#[\Override]
2525
public function getName(): string
2626
{
2727
return 'twig_inspector';

Twig/DebugInfoNodeVisitor.php

+3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ class DebugInfoNodeVisitor extends AbstractNodeVisitor
1919
{
2020
protected const EXTENSION_NAME = HtmlCommentsExtension::class;
2121

22+
#[\Override]
2223
protected function doEnterNode(Node $node, Environment $env): Node
2324
{
2425
return $node;
2526
}
2627

28+
#[\Override]
2729
protected function doLeaveNode(Node $node, Environment $env): Node
2830
{
2931
$varName = $this->getVarName();
@@ -82,6 +84,7 @@ protected function getReference(Node $node): NodeReference
8284
return new NodeReference($node->getAttribute('name'), $node->getTemplateName(), $node->getTemplateLine());
8385
}
8486

87+
#[\Override]
8588
public function getPriority(): int
8689
{
8790
return 0;

Twig/Node/NodeEnd.php

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function __construct(string $varName)
1515
parent::__construct([], ['var_name' => $varName]);
1616
}
1717

18+
#[\Override]
1819
public function compile(Compiler $compiler): void
1920
{
2021
$compiler

Twig/Node/NodeStart.php

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public function __construct(string $extensionName, string $name, int $line, stri
1818
);
1919
}
2020

21+
#[\Override]
2122
public function compile(Compiler $compiler): void
2223
{
2324
$compiler

Twig/TwigInspectorExtension.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
class TwigInspectorExtension extends AbstractExtension
1111
{
12+
#[\Override]
1213
public function getNodeVisitors(): array
1314
{
1415
return [new DebugInfoNodeVisitor()];

0 commit comments

Comments
 (0)