Skip to content

Commit 5fcd191

Browse files
sabbelasichongithub-actions[bot]
authored andcommitted
Apply coding standard changes
1 parent 17ec0fe commit 5fcd191

20 files changed

+49
-49
lines changed

Classes/Asset/EntrypointLookup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private function validateEntryName(string $entryName): void
114114

115115
private function getEntriesData(): array
116116
{
117-
if (null !== $this->entriesData) {
117+
if ($this->entriesData !== null) {
118118
return $this->entriesData;
119119
}
120120

Classes/Asset/EntrypointLookupCollection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ public function __construct(EntryLookupFactoryInterface $entryLookupFactory, str
3232

3333
public function getEntrypointLookup(string $buildName = null): EntrypointLookupInterface
3434
{
35-
if (null === $this->buildEntrypoints) {
35+
if ($this->buildEntrypoints === null) {
3636
$this->buildEntrypoints = $this->entryLookupFactory->getCollection();
3737
}
38-
if (null === $buildName) {
39-
if (null === $this->defaultBuildName) {
38+
if ($buildName === null) {
39+
if ($this->defaultBuildName === null) {
4040
throw new UndefinedBuildException(
4141
'There is no default build configured: please pass an argument to getEntrypointLookup().'
4242
);

Classes/Asset/TagRenderer.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function renderWebpackScriptTags(ScriptTag $scriptTag): void
7878
}
7979

8080
// We do not want to replace null values in $attributes
81-
$parameters = array_filter($parameters, static fn ($param) => null !== $param);
81+
$parameters = array_filter($parameters, static fn ($param) => $param !== null);
8282

8383
foreach ($files as $index => $file) {
8484
$this->addAdditionalAbsRefPrefixDirectories($file);
@@ -108,7 +108,7 @@ public function renderWebpackScriptTags(ScriptTag $scriptTag): void
108108

109109
$attributes = array_values($attributes);
110110

111-
$pageRendererMethodName = 'addJS' . (self::POSITION_FOOTER === $scriptTag->getPosition() ? 'Footer' : '');
111+
$pageRendererMethodName = 'addJS' . ($scriptTag->getPosition() === self::POSITION_FOOTER ? 'Footer' : '');
112112

113113
if ($scriptTag->isLibrary()) {
114114
$pageRendererMethodName .= 'Library';
@@ -119,7 +119,7 @@ public function renderWebpackScriptTags(ScriptTag $scriptTag): void
119119
$pageRenderer->{$pageRendererMethodName}(...$attributes);
120120
}
121121

122-
if (true === $scriptTag->isRegisterFile()) {
122+
if ($scriptTag->isRegisterFile() === true) {
123123
$this->assetRegistry->registerFile(new File($file, FileType::createScript(), [
124124
'integrity' => $integrityHashes[$file] ?? false,
125125
]));
@@ -181,7 +181,7 @@ public function renderWebpackLinkTags(LinkTag $linkTag): void
181181

182182
$pageRenderer->addCssFile(...$attributes);
183183

184-
if (true === $linkTag->isRegisterFile()) {
184+
if ($linkTag->isRegisterFile() === true) {
185185
$this->assetRegistry->registerFile(new File($file, FileType::createStyle()));
186186
}
187187
}
@@ -205,7 +205,7 @@ private function addAdditionalAbsRefPrefixDirectories(string $file): void
205205

206206
$newDir = basename(dirname($file)) . '/';
207207

208-
if (false === in_array($newDir, $directories, true)) {
208+
if (in_array($newDir, $directories, true) === false) {
209209
$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalAbsRefPrefixDirectories'] .= ',' . $newDir;
210210
}
211211
}
@@ -217,19 +217,19 @@ private function removeLeadingSlash(string $file, array $parameters): bool
217217
return true;
218218
}
219219

220-
if (null === $this->applicationType) {
220+
if ($this->applicationType === null) {
221221
return false;
222222
}
223223

224224
if (! $this->applicationType->isFrontend()) {
225225
return false;
226226
}
227227

228-
if ('' === $this->getTypoScriptFrontendController()->absRefPrefix) {
228+
if ($this->getTypoScriptFrontendController()->absRefPrefix === '') {
229229
return false;
230230
}
231231

232-
if ('/' === $this->getTypoScriptFrontendController()->absRefPrefix) {
232+
if ($this->getTypoScriptFrontendController()->absRefPrefix === '/') {
233233
return true;
234234
}
235235

@@ -251,15 +251,15 @@ private function removeType(array $parameters): bool
251251
return false;
252252
}
253253

254-
if (null === $this->applicationType) {
254+
if ($this->applicationType === null) {
255255
return false;
256256
}
257257

258258
if (! $this->applicationType->isFrontend()) {
259259
return false;
260260
}
261261

262-
if (! isset($this->getTypoScriptFrontendController()->config['config']['doctype']) || 'html5' !== $this->getTypoScriptFrontendController()->config['config']['doctype']) {
262+
if (! isset($this->getTypoScriptFrontendController()->config['config']['doctype']) || $this->getTypoScriptFrontendController()->config['config']['doctype'] !== 'html5') {
263263
return false;
264264
}
265265

Classes/Form/FormDataProvider/RichtextEncoreConfiguration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public function __construct(EntrypointLookupCollectionInterface $entrypointLooku
3131
public function addData(array $result): array
3232
{
3333
foreach ($result['processedTca']['columns'] as $fieldName => $fieldConfig) {
34-
if (! isset($fieldConfig['config']['type']) || 'text' !== $fieldConfig['config']['type']) {
34+
if (! isset($fieldConfig['config']['type']) || $fieldConfig['config']['type'] !== 'text') {
3535
continue;
3636
}
3737

38-
if (! isset($fieldConfig['config']['enableRichtext']) || true !== (bool) $fieldConfig['config']['enableRichtext']) {
38+
if (! isset($fieldConfig['config']['enableRichtext']) || (bool) $fieldConfig['config']['enableRichtext'] !== true) {
3939
continue;
4040
}
4141

@@ -72,7 +72,7 @@ private function getContentCss(string $contentsCss): array
7272
$buildAndEntryName = GeneralUtility::trimExplode(':', $cssFile, true, 2);
7373
$buildName = EntrypointLookupInterface::DEFAULT_BUILD;
7474

75-
if (2 === count($buildAndEntryName)) {
75+
if (count($buildAndEntryName) === 2) {
7676
[$buildName, $entryName] = $buildAndEntryName;
7777
} else {
7878
$entryName = $buildAndEntryName[0];

Classes/Integration/AssetRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getRegisteredFiles(): array
5454

5555
public function getDefaultAttributes(): array
5656
{
57-
if (0 === count($this->defaultAttributes)) {
57+
if (count($this->defaultAttributes) === 0) {
5858
$this->defaultAttributes['crossorigin'] = $this->settingsService->getStringByPath('preload.crossorigin');
5959
}
6060
return $this->defaultAttributes;

Classes/Integration/EntryLookupFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242
*/
4343
public function getCollection(): array
4444
{
45-
if (null !== self::$collection) {
45+
if (self::$collection !== null) {
4646
return self::$collection;
4747
}
4848

Classes/Integration/Filesystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function get(string $pathToFile): string
2020
{
2121
$data = GeneralUtility::getUrl($pathToFile);
2222

23-
if (false === $data) {
23+
if ($data === false) {
2424
throw new UnexpectedValueException(sprintf('Data could not be read from file %s', $pathToFile));
2525
}
2626

@@ -47,7 +47,7 @@ public function createHash(string $entrypointJsonPath): string
4747
{
4848
$md5HashOfFile = md5_file($entrypointJsonPath);
4949

50-
if (false === $md5HashOfFile) {
50+
if ($md5HashOfFile === false) {
5151
$message = sprintf('File "%s" could not be md5Hashed', $entrypointJsonPath);
5252
throw new UnexpectedValueException($message);
5353
}

Classes/Integration/JsonDecoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function decode(string $json): array
1717
{
1818
// In PHP 7.3 you can use JSON_THROW_ON_ERROR constant
1919
$array = json_decode($json, true);
20-
if (JSON_ERROR_NONE !== json_last_error()) {
20+
if (json_last_error() !== JSON_ERROR_NONE) {
2121
throw new JsonDecodeException(json_last_error_msg());
2222
}
2323

Classes/Integration/PackageFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(SettingsServiceInterface $settingsService, Filesyste
3030

3131
public function getPackage(string $package): JsonPackage
3232
{
33-
$manifestJsonPath = EntrypointLookupInterface::DEFAULT_BUILD === $package ? 'manifestJsonPath' : sprintf(
33+
$manifestJsonPath = $package === EntrypointLookupInterface::DEFAULT_BUILD ? 'manifestJsonPath' : sprintf(
3434
'packages.%s.manifestJsonPath',
3535
$package
3636
);

Classes/Integration/PageRendererHooks.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function renderPreProcess(array $params, PageRenderer $pageRenderer): voi
4646
}
4747

4848
// Is the include type 'jsLibs' and should be treated as a library
49-
$isLibrary = TagRendererInterface::POSITION_JS_LIBRARY === $includeType;
49+
$isLibrary = $includeType === TagRendererInterface::POSITION_JS_LIBRARY;
5050

5151
foreach ($params[$includeType] as $key => $jsFile) {
5252
if (! $this->isEncoreEntryName($jsFile['file'])) {
@@ -56,7 +56,7 @@ public function renderPreProcess(array $params, PageRenderer $pageRenderer): voi
5656
$buildAndEntryName = $this->createBuildAndEntryName($jsFile['file']);
5757
$buildName = EntrypointLookupInterface::DEFAULT_BUILD;
5858

59-
if (2 === count($buildAndEntryName)) {
59+
if (count($buildAndEntryName) === 2) {
6060
[$buildName, $entryName] = $buildAndEntryName;
6161
} else {
6262
$entryName = $buildAndEntryName[0];
@@ -85,7 +85,7 @@ public function renderPreProcess(array $params, PageRenderer $pageRenderer): voi
8585
$buildAndEntryName = $this->createBuildAndEntryName($cssFile['file']);
8686
$buildName = EntrypointLookupInterface::DEFAULT_BUILD;
8787

88-
if (2 === count($buildAndEntryName)) {
88+
if (count($buildAndEntryName) === 2) {
8989
[$buildName, $entryName] = $buildAndEntryName;
9090
} else {
9191
$entryName = $buildAndEntryName[0];

0 commit comments

Comments
 (0)