Skip to content

Commit

Permalink
[TASK] Avoid useless parent calls
Browse files Browse the repository at this point in the history
There is no point in calling parent::initializeArguments()
when we know the parent method is an empty dummy method
that will most likely never have a body since that would
break too much.
  • Loading branch information
lolli42 committed Nov 20, 2024
1 parent 6491609 commit ee9817e
Show file tree
Hide file tree
Showing 20 changed files with 0 additions and 133 deletions.
114 changes: 0 additions & 114 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -72,126 +72,12 @@ parameters:
count: 2
path: src/View/TemplatePaths.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/AliasViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/CaseViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/ConstantViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/CountViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/CycleViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/DebugViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/ForViewHelper.php

-
message: '#^Variable \$iterationData might not be defined\.$#'
identifier: variable.undefined
count: 1
path: src/ViewHelpers/ForViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/Format/HtmlspecialcharsViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/Format/PrintfViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/GroupedForViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/RenderViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: src/ViewHelpers/SwitchViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentInConstructorViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentOverriddenResolveContentArgumentNameMethodViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticFirstRegisteredOptionalArgumentAfterRequiredArgumentAsRenderChildrenViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticUseFirstRegisteredOptionalArgumentAsRenderChildrenViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: tests/Functional/Fixtures/ViewHelpers/ContentArgumentNameViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: tests/Functional/Fixtures/ViewHelpers/ContentArgumentNameWithoutEscapeChildrenViewHelper.php

-
message: '#^Call to TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper\:\:initializeArguments\(\) on a separate line has no effect\.$#'
identifier: staticMethod.resultUnused
count: 1
path: tests/Functional/ViewHelpers/StaticCacheable/Fixtures/ViewHelpers/CompilableViewHelper.php

-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/AliasViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class AliasViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('map', 'array', 'Array that specifies which variables should be mapped to which alias', true);
}

Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/CaseViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class CaseViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('value', 'mixed', 'Value to match in this case', true);
}

Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/ConstantViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ConstantViewHelper extends AbstractViewHelper
{
public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('name', 'string', 'String representation of a PHP constant or enum');
}

Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/CountViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class CountViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('subject', 'array', 'Countable subject, array or \Countable');
}

Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/CycleViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class CycleViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('values', 'array', 'The array or object implementing \ArrayAccess (for example \SplObjectStorage) to iterated over');
$this->registerArgument('as', 'string', 'The name of the iteration variable', true);
}
Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/DebugViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class DebugViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('typeOnly', 'boolean', 'If true, debugs only the type of variables', false, false);
$this->registerArgument('levels', 'integer', 'Levels to render when rendering nested objects/arrays', false, 5);
$this->registerArgument('html', 'boolean', 'Render HTML. If false, output is indented plaintext', false, false);
Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/ForViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class ForViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('each', 'array', 'The array or \SplObjectStorage to iterated over', true);
$this->registerArgument('as', 'string', 'The name of the iteration variable', true);
$this->registerArgument('key', 'string', 'Variable to assign array key to');
Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/Format/HtmlspecialcharsViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class HtmlspecialcharsViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('value', 'string', 'Value to format');
$this->registerArgument('keepQuotes', 'boolean', 'If true quotes will not be replaced (ENT_NOQUOTES)', false, false);
$this->registerArgument('encoding', 'string', 'Encoding', false, 'UTF-8');
Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/Format/PrintfViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class PrintfViewHelper extends AbstractViewHelper
{
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('value', 'string', 'String to format');
$this->registerArgument('arguments', 'array', 'The arguments for vsprintf', false, []);
}
Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/GroupedForViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class GroupedForViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('each', 'array', 'The array or \SplObjectStorage to iterated over', true);
$this->registerArgument('as', 'string', 'The name of the iteration variable', true);
$this->registerArgument('groupBy', 'string', 'Group by this property', true);
Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/RenderViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ class RenderViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('section', 'string', 'Section to render - combine with partial to render section in partial');
$this->registerArgument('partial', 'string', 'Partial to render, with or without section');
$this->registerArgument('delegate', 'string', 'Optional PHP class name of a permanent, included-in-app ParsedTemplateInterface implementation to override partial/section');
Expand Down
1 change: 0 additions & 1 deletion src/ViewHelpers/SwitchViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class SwitchViewHelper extends AbstractViewHelper

public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('expression', 'mixed', 'Expression to switch', true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public function __construct()

public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('firstOptionalArgument', 'string', 'First optional argument which is used as render children.');
$this->registerArgument('secondOptionalArgument', 'string', 'Second optional argument which is used as render children.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function __construct() {}

public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('firstOptionalArgument', 'string', 'First optional argument which is used as render children.');
$this->registerArgument('secondOptionalArgument', 'string', 'Second optional argument which is used as render children.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ final class CompileWithContentArgumentAndRenderStaticFirstRegisteredOptionalArgu

public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('requiredArgument', 'string', 'demo required argument before optional argument', true);
$this->registerArgument('firstOptionalArgument', 'string', 'First optional argument which is used as render children.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ final class CompileWithContentArgumentAndRenderStaticUseFirstRegisteredOptionalA

public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('firstOptionalArgument', 'string', 'First optional argument which is used as render children.');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ final class ContentArgumentNameViewHelper extends AbstractViewHelper
{
public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('value', 'string', '');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ final class ContentArgumentNameWithoutEscapeChildrenViewHelper extends AbstractV

public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('value', 'string', '');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ final class CompilableViewHelper extends AbstractViewHelper
*/
public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('page', 'int', 'The page');
}

Expand Down

0 comments on commit ee9817e

Please sign in to comment.