Skip to content

Commit 331f8ba

Browse files
committed
Fixed phpcs issues.
1 parent 91747f2 commit 331f8ba

17 files changed

+17
-32
lines changed

Classes/Backend/BackendLayoutDataProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function addBackendLayouts(DataProviderContext $dataProviderContext, Back
5151
}
5252

5353
/**
54-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint
54+
* {@inheritdoc}
5555
*/
5656
public function getBackendLayout($identifier, $pageId) {
5757
$backendLayout = null;

Classes/ExtensionBuilder/Service/FileGenerator.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ protected function generateTCAFiles(): void {
3232
}
3333
}
3434

35-
/**
36-
* @phpstan-return void
37-
*/
38-
protected function writeFile($targetFile, $fileContents): void {
35+
protected function writeFile(string $targetFile, string $fileContents): void {
3936
// replace spaces with tabs
4037
$fileContents = (string)preg_replace_callback('/^( )+/m', function($matches) {
4138
return str_replace(' ', "\t", $matches[0]);

Classes/ExtensionBuilder/Service/Printer.php

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ public function renderFileObject(File $fileObject, bool $addDeclareStrictTypes =
8787
return $resultingCode;
8888
}
8989

90+
/**
91+
* {@inheritdoc}
92+
*/
9093
public function render($stmts): string {
9194
$code = parent::render($stmts);
9295
$code = $this->trimTrailingWhitespace($code);

Classes/Form/FormDataProvider/GridelementsMergeTsConfig.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class GridelementsMergeTsConfig implements FormDataProviderInterface {
1515
/**
1616
* Merge type specific page TS to pageTsConfig
1717
*
18-
* @param array $result
1918
* @return array
2019
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
2120
*/

Classes/Frontend/ContentObject/ScalableVectorGraphicsContentObject.php

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ScalableVectorGraphicsContentObject extends AbstractContentObject {
2121
* @param array $conf Array of TypoScript properties
2222
* @return string Empty string (the cObject only sets internal data!)
2323
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
24+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
2425
*/
2526
public function render($conf = []) {
2627
$cObj = $this->getContentObjectRenderer();

Classes/Hooks/ContentElements.php

-3
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ static protected function generateException(string $message, int $code): void {
232232

233233
/**
234234
* add Content Elements
235-
*
236-
* @param string $extensionKey
237235
*/
238236
static public function addFCEs(string $extensionKey, bool $isLocalConf = false): void {
239237
if (!$isLocalConf) {
@@ -310,7 +308,6 @@ static public function addFCEs(string $extensionKey, bool $isLocalConf = false):
310308
* Generate TCA for FCEs.
311309
* Gets called in TCA/Overrides/tt_content.php and will be cached.
312310
*
313-
* @param array $TCA
314311
* @return array modified $TCA
315312
*/
316313
static public function addTCA(array $TCA): array {

Classes/Hooks/DataHandler.php

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class DataHandler {
1616
* @param int $id The uid of the page we are currently working on
1717
* @param array $fieldArray The array of fields and values that have been saved to the datamap
1818
* @param \TYPO3\CMS\Core\DataHandling\DataHandler $parentObj The parent object that triggered this hook
19+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
1920
*/
2021
public function processDatamap_postProcessFieldArray($status, $table, $id, array &$fieldArray, \TYPO3\CMS\Core\DataHandling\DataHandler $parentObj): void {
2122

Classes/Hooks/JavascriptOptimization.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function minifyJsFiles(array $jsFiles): array {
6565
* @param string $filename Source filename, relative to requested page
6666
* @return string Filename of the compressed file, relative to requested page
6767
*/
68-
public function minifyJsFile($filename): string {
68+
public function minifyJsFile(string $filename): string {
6969
// generate the unique name of the file
7070
$filenameAbsolute = Environment::getPublicPath() . '/' . $filename;
7171
$unique = $filenameAbsolute . '-min';

Classes/Imaging/GraphicalFunctionsTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function init(): void {
2121
}
2222

2323
/**
24-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint
24+
* {@inheritdoc}
2525
*/
2626
public function imageMagickConvert($imagefile, $newExt = '', $w = '', $h = '', $params = '', $frame = '', $options = [], $mustCreate = true) {
2727
// Note: mustCreate has another default value
@@ -66,7 +66,7 @@ public function imageMagickConvert($imagefile, $newExt = '', $w = '', $h = '', $
6666
}
6767

6868
/**
69-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint
69+
* {@inheritdoc}
7070
*/
7171
public function imageMagickExec($input, $output, $params, $frame = 0) {
7272
if (!$this->processorEnabled) {

Classes/Log/Writer/MailWriter.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ public function __construct(array $options) {
4747
parent::__construct($options);
4848
}
4949

50-
/**
51-
* @param int|string $minErrorLevel
52-
*/
53-
public function setMinErrorLevel($minErrorLevel): void {
50+
public function setMinErrorLevel(int|string $minErrorLevel): void {
5451
$this->sendMail = false;
5552
$this->minErrorLevel = LogLevel::normalizeLevel($minErrorLevel);
5653
}

Classes/Resource/FilterFiles.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class FilterFiles {
1313
/**
1414
* @return bool|int -1 is the "false" value. call_user_func might also return false
1515
*/
16-
static public function filterFilesCallback(string $itemName, string $itemIdentifier, string $parentIdentifier, array $additionalInformation, DriverInterface $driverInstance) {
16+
static public function filterFilesCallback(string $itemName, string $itemIdentifier, string $parentIdentifier, array $additionalInformation, DriverInterface $driverInstance): bool|int {
1717
$ignoreFolders = ['_vti_cnf', '_vti_pvt', '.git', '.svn', 'CVS', 'Thumbs.db', '.DS_Store'];
1818
if (in_array($itemName, $ignoreFolders)) {
1919
return -1;

Classes/Resource/LocalDriver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class LocalDriver extends \TYPO3\CMS\Core\Resource\Driver\LocalDriver {
77

88
/**
9-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint
9+
* {@inheritdoc}
1010
*/
1111
public function sanitizeFileName($fileName, $charset = 'utf-8') {
1212
$fileName = parent::sanitizeFileName($fileName, $charset);

Classes/Routing/Aspect/AutomaticSlugPatternMapper.php

-5
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ protected function createRouteResult(?array $result): ?string {
6565
);
6666
}
6767

68-
/**
69-
* @param QueryBuilder $queryBuilder
70-
* @param array $values
71-
* @return array
72-
*/
7368
protected function createRouteFieldConstraints(QueryBuilder $queryBuilder, array $values): array {
7469
// check if all match-fields are set
7570
if (count($this->settings['matchFields']) !== count(array_intersect($this->settings['matchFields'], array_keys($values)))) {

Classes/ViewHelpers/SvgViewHelper.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ public function initializeArguments(): void {
4141
/**
4242
* renders an SVG
4343
*
44-
* @param array $arguments
45-
* @param \Closure $renderChildrenClosure
46-
* @param \TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
47-
* @return string
48-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
44+
* {@inheritdoc}
4945
*/
5046
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
5147
$cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);

Classes/XClass/Core/Resource/StorageRepository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class StorageRepository extends \TYPO3\CMS\Core\Resource\StorageRepository {
1313

1414
/**
15-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint
15+
* {@inheritdoc}
1616
*/
1717
protected function testCaseSensitivity($absolutePath) {
1818
return true;

Tests/Unit/Resource/FilterFilesTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ class FilterFilesTest extends UnitTestCase {
1212

1313
/**
1414
* @dataProvider getSanitizeFileNameTestData
15-
* @param bool|int $expected
1615
*/
17-
public function testFilterFilesCallback($expected, string $itemName, string $itemIdentifier): void {
16+
public function testFilterFilesCallback(bool|int $expected, string $itemName, string $itemIdentifier): void {
1817
/** @var DriverInterface $driverInstance */
1918
$driverInstance = $this->getMockBuilder(DriverInterface::class)
2019
->disableOriginalConstructor()

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
},
9090
"scripts": {
9191
"phplint": "find . -name \\*.php ! -path \"./.Build/*\" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \\;",
92-
"phpcs": "phpcs -n --runtime-set ignore_warnings_on_exit 1 --standard=.Build/vendor/vierwd/coding-standard/ForwardMediaPHP74 Classes/ Tests/",
92+
"phpcs": "phpcs -n --runtime-set ignore_warnings_on_exit 1 --standard=.Build/vendor/vierwd/coding-standard/ForwardMediaPHP80 Classes/ Tests/",
9393
"phpstan": "phpstan analyze",
9494
"unit-test": "phpunit -c Tests/UnitTests.xml Tests/Unit/",
9595
"test-all": [

0 commit comments

Comments
 (0)