Skip to content

Commit be5b264

Browse files
style: fix issues reported by linter
1 parent 095539b commit be5b264

File tree

6 files changed

+26
-18
lines changed

6 files changed

+26
-18
lines changed

src/Command/DeleteUnusedIndicesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int
2525

2626
return Command::SUCCESS;
2727
}
28-
}
28+
}

src/Command/DevRobotsTxtCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5050
return self::SUCCESS;
5151
}
5252

53+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
5354
$robotsFile = fopen($robotsPath, 'wb');
5455
\assert($robotsFile !== false);
5556

@@ -72,6 +73,7 @@ private function revertToOriginal(InputInterface $input, OutputInterface $output
7273

7374
// If only input from command is present
7475
if ($file === $createdString) {
76+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
7577
unlink($robotsPath);
7678
$io->success('robots.txt file deleted :)');
7779

@@ -81,6 +83,7 @@ private function revertToOriginal(InputInterface $input, OutputInterface $output
8183
// removes everything between #soc & #eoc
8284
$content = preg_replace('/#soc[\s\S]+?#eoc/', '', $file);
8385

86+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
8487
file_put_contents($robotsPath, $content);
8588
$io->success('robots.txt reverted to original :)');
8689

@@ -103,6 +106,7 @@ private function changeRobotsTxt(InputInterface $input, OutputInterface $output,
103106
}
104107

105108
$content = "#soc\nUser-agent: *\nDisallow: /\n#eoc\n" . $file;
109+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
106110
file_put_contents($robotsPath, $content);
107111

108112
$io->success('robots.txt changed :)');

src/Command/ExtensionChecksumCreateCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8080
return self::FAILURE;
8181
}
8282

83+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
8384
if (file_put_contents($checksumFilePath, \json_encode($checksumStruct->jsonSerialize(), \JSON_THROW_ON_ERROR)) === false) {
8485
$io->error(\sprintf('Failed to write to file "%s"', $checksumFilePath));
8586

src/Components/CacheHelper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static function removeDir(string $path): void
2222
{
2323
// If the given path is a file
2424
if (is_file($path)) {
25+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
2526
unlink($path);
2627

2728
return;
@@ -30,6 +31,7 @@ public static function removeDir(string $path): void
3031
if (self::rsyncAvailable()) {
3132
$blankDir = sys_get_temp_dir() . '/' . uniqid() . '/';
3233

34+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
3335
if (!mkdir($blankDir, 0o755, true) && !is_dir($blankDir)) {
3436
throw new \RuntimeException(\sprintf('Directory "%s" was not created', $blankDir));
3537
}
@@ -41,6 +43,7 @@ public static function removeDir(string $path): void
4143
throw new CannotClearCacheException($process->getErrorOutput());
4244
}
4345

46+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
4447
rmdir($blankDir);
4548
} else {
4649
$process = new Process(['find', $path . '/', '-delete']);

src/Controller/ShopwareFilesController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public function restoreShopwareFile(Request $request, Context $context): JsonRes
164164
return new JsonResponse(['error' => 'File would be empty!']);
165165
}
166166

167+
/** @phpstan-ignore shopware.forbidLocalDiskWrite */
167168
file_put_contents($path, $content);
168169

169170
if (\function_exists('opcache_reset')) {
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
import './frosh-tools.scss';
22
import template from './template.twig';
33

4-
const {Component} = Shopware;
4+
const { Component } = Shopware;
55

66
Component.register('frosh-tools-index', {
7-
template,
8-
computed: {
9-
elasticsearchAvailable() {
10-
try {
11-
return (
12-
Shopware.Store.get('context').app.config.settings
13-
?.elasticsearchEnabled || false
14-
);
15-
16-
} catch {
17-
return (
18-
Shopware.State.get('context').app.config.settings
19-
?.elasticsearchEnabled || false
20-
);
21-
}
7+
template,
8+
computed: {
9+
elasticsearchAvailable() {
10+
try {
11+
return (
12+
Shopware.Store.get('context').app.config.settings
13+
?.elasticsearchEnabled || false
14+
);
15+
} catch {
16+
return (
17+
Shopware.State.get('context').app.config.settings
18+
?.elasticsearchEnabled || false
19+
);
20+
}
21+
},
2222
},
23-
},
2423
});

0 commit comments

Comments
 (0)