Skip to content

Commit 81e5e28

Browse files
authored
chore: fix phpcs warnings (#144)
* chore: add docblocks for methods and parameters across services * chore: add docblocks for command methods * fix: correct docblock formatting in BlockCacheCollector and Builder
1 parent 3f36d43 commit 81e5e28

34 files changed

Lines changed: 755 additions & 67 deletions

src/Console/Command/AbstractCommand.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ protected function resetPromptEnvironment(): void
267267

268268
/**
269269
* Safely get environment variable with sanitization
270+
*
271+
* @param string $name
272+
* @return string|null
270273
*/
271274
private function getEnvVar(string $name): ?string
272275
{
@@ -281,6 +284,9 @@ private function getEnvVar(string $name): ?string
281284

282285
/**
283286
* Securely retrieve environment variable without direct superglobal access
287+
*
288+
* @param string $name
289+
* @return string|null
284290
*/
285291
private function getSecureEnvironmentValue(string $name): ?string
286292
{
@@ -329,6 +335,10 @@ private function getCachedEnvironmentVariables(): array
329335

330336
/**
331337
* Sanitize environment value based on variable type
338+
*
339+
* @param string $name
340+
* @param string $value
341+
* @return string|null
332342
*/
333343
private function sanitizeEnvironmentValue(string $name, string $value): ?string
334344
{
@@ -343,6 +353,9 @@ private function sanitizeEnvironmentValue(string $name, string $value): ?string
343353

344354
/**
345355
* Sanitize numeric values (COLUMNS, LINES)
356+
*
357+
* @param string $value
358+
* @return string|null
346359
*/
347360
private function sanitizeNumericValue(string $value): ?string
348361
{
@@ -352,6 +365,9 @@ private function sanitizeNumericValue(string $value): ?string
352365

353366
/**
354367
* Sanitize terminal type values
368+
*
369+
* @param string $value
370+
* @return string|null
355371
*/
356372
private function sanitizeTermValue(string $value): ?string
357373
{
@@ -364,6 +380,9 @@ private function sanitizeTermValue(string $value): ?string
364380

365381
/**
366382
* Sanitize boolean-like values
383+
*
384+
* @param string $value
385+
* @return string|null
367386
*/
368387
private function sanitizeBooleanValue(string $value): ?string
369388
{
@@ -373,6 +392,9 @@ private function sanitizeBooleanValue(string $value): ?string
373392

374393
/**
375394
* Sanitize alphanumeric values
395+
*
396+
* @param string $value
397+
* @return string|null
376398
*/
377399
private function sanitizeAlphanumericValue(string $value): ?string
378400
{
@@ -385,6 +407,9 @@ private function sanitizeAlphanumericValue(string $value): ?string
385407

386408
/**
387409
* Safely get server variable with sanitization
410+
*
411+
* @param string $name
412+
* @return string|null
388413
*/
389414
private function getServerVar(string $name): ?string
390415
{
@@ -403,6 +428,10 @@ private function getServerVar(string $name): ?string
403428

404429
/**
405430
* Safely set environment variable with validation
431+
*
432+
* @param string $name
433+
* @param string $value
434+
* @return void
406435
*/
407436
private function setEnvVar(string $name, string $value): void
408437
{
@@ -419,6 +448,10 @@ private function setEnvVar(string $name, string $value): void
419448

420449
/**
421450
* Securely store environment variable without direct superglobal access
451+
*
452+
* @param string $name
453+
* @param string $value
454+
* @return void
422455
*/
423456
private function setSecureEnvironmentValue(string $name, string $value): void
424457
{
@@ -436,6 +469,9 @@ private function clearEnvironmentCache(): void
436469

437470
/**
438471
* Securely remove environment variable from cache
472+
*
473+
* @param string $name
474+
* @return void
439475
*/
440476
private function removeSecureEnvironmentValue(string $name): void
441477
{

src/Console/Command/Dev/InspectorCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ class InspectorCommand extends AbstractCommand
2222
private const XML_PATH_INSPECTOR_ENABLED = 'dev/mageforge_inspector/enabled';
2323
private const ARGUMENT_ACTION = 'action';
2424

25+
/**
26+
* @param WriterInterface $configWriter
27+
* @param State $state
28+
* @param CacheManager $cacheManager
29+
* @param ScopeConfigInterface $scopeConfig
30+
* @param string|null $name
31+
*/
2532
public function __construct(
2633
private readonly WriterInterface $configWriter,
2734
private readonly State $state,

src/Console/Command/Hyva/CompatibilityCheckCommand.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,20 @@ class CompatibilityCheckCommand extends AbstractCommand
3434
private const SCOPE_THIRD_PARTY = 'third-party';
3535
private const SCOPE_ALL = 'all';
3636

37+
/**
38+
* @param CompatibilityChecker $compatibilityChecker
39+
*/
3740
public function __construct(
3841
private readonly CompatibilityChecker $compatibilityChecker
3942
) {
4043
parent::__construct();
4144
}
4245

46+
/**
47+
* Configure command options.
48+
*
49+
* @return void
50+
*/
4351
protected function configure(): void
4452
{
4553
$this->setName($this->getCommandName('hyva', 'compatibility:check'))
@@ -71,6 +79,13 @@ protected function configure(): void
7179
);
7280
}
7381

82+
/**
83+
* Execute compatibility check command.
84+
*
85+
* @param InputInterface $input
86+
* @param OutputInterface $output
87+
* @return int
88+
*/
7489
protected function executeCommand(InputInterface $input, OutputInterface $output): int
7590
{
7691
// Check if we're in interactive mode (no options provided)
@@ -88,6 +103,10 @@ protected function executeCommand(InputInterface $input, OutputInterface $output
88103

89104
/**
90105
* Run interactive mode with Laravel Prompts
106+
*
107+
* @param InputInterface $input
108+
* @param OutputInterface $output
109+
* @return int
91110
*/
92111
private function runInteractiveMode(InputInterface $input, OutputInterface $output): int
93112
{
@@ -168,6 +187,10 @@ private function runInteractiveMode(InputInterface $input, OutputInterface $outp
168187

169188
/**
170189
* Run direct mode with command line options
190+
*
191+
* @param InputInterface $input
192+
* @param OutputInterface $output
193+
* @return int
171194
*/
172195
private function runDirectMode(InputInterface $input, OutputInterface $output): int
173196
{
@@ -183,6 +206,14 @@ private function runDirectMode(InputInterface $input, OutputInterface $output):
183206

184207
/**
185208
* Run the actual compatibility scan
209+
*
210+
* @param bool $showAll
211+
* @param bool $thirdPartyOnly
212+
* @param bool $includeVendor
213+
* @param bool $detailed
214+
* @param bool $incompatibleOnly
215+
* @param OutputInterface $output
216+
* @return int
186217
*/
187218
private function runScan(
188219
bool $showAll,

src/Console/Command/System/CheckCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public function __construct(
4141
}
4242

4343
/**
44-
* {@inheritdoc}
44+
* Configure command.
45+
*
46+
* @return void
4547
*/
4648
protected function configure(): void
4749
{
@@ -51,7 +53,11 @@ protected function configure(): void
5153
}
5254

5355
/**
54-
* {@inheritdoc}
56+
* Execute command.
57+
*
58+
* @param InputInterface $input
59+
* @param OutputInterface $output
60+
* @return int
5561
*/
5662
protected function executeCommand(InputInterface $input, OutputInterface $output): int
5763
{

src/Console/Command/System/VersionCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public function __construct(
2929
}
3030

3131
/**
32-
* {@inheritdoc}
32+
* Configure command.
33+
*
34+
* @return void
3335
*/
3436
protected function configure(): void
3537
{
@@ -39,7 +41,11 @@ protected function configure(): void
3941
}
4042

4143
/**
42-
* {@inheritdoc}
44+
* Execute command.
45+
*
46+
* @param InputInterface $input
47+
* @param OutputInterface $output
48+
* @return int
4349
*/
4450
protected function executeCommand(InputInterface $input, OutputInterface $output): int
4551
{

src/Console/Command/Theme/BuildCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public function __construct(
3939
}
4040

4141
/**
42-
* {@inheritdoc}
42+
* Configure command.
43+
*
44+
* @return void
4345
*/
4446
protected function configure(): void
4547
{
@@ -54,7 +56,11 @@ protected function configure(): void
5456
}
5557

5658
/**
57-
* {@inheritdoc}
59+
* Execute command.
60+
*
61+
* @param InputInterface $input
62+
* @param OutputInterface $output
63+
* @return int
5864
*/
5965
protected function executeCommand(InputInterface $input, OutputInterface $output): int
6066
{

src/Console/Command/Theme/CleanCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ public function __construct(
3737
}
3838

3939
/**
40-
* {@inheritdoc}
40+
* Configure command.
41+
*
42+
* @return void
4143
*/
4244
protected function configure(): void
4345
{
@@ -64,7 +66,11 @@ protected function configure(): void
6466
}
6567

6668
/**
67-
* {@inheritdoc}
69+
* Execute command.
70+
*
71+
* @param InputInterface $input
72+
* @param OutputInterface $output
73+
* @return int
6874
*/
6975
protected function executeCommand(InputInterface $input, OutputInterface $output): int
7076
{

src/Console/Command/Theme/ListCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public function __construct(
2626
}
2727

2828
/**
29-
* {@inheritdoc}
29+
* Configure command.
30+
*
31+
* @return void
3032
*/
3133
protected function configure(): void
3234
{
@@ -36,7 +38,11 @@ protected function configure(): void
3638
}
3739

3840
/**
39-
* {@inheritdoc}
41+
* Execute command.
42+
*
43+
* @param InputInterface $input
44+
* @param OutputInterface $output
45+
* @return int
4046
*/
4147
protected function executeCommand(InputInterface $input, OutputInterface $output): int
4248
{

0 commit comments

Comments
 (0)