Skip to content

Commit 79d94a8

Browse files
committed
Address PHPMD and PHPStan errors
1 parent 55177c8 commit 79d94a8

File tree

27 files changed

+49
-32
lines changed

27 files changed

+49
-32
lines changed

src/App/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* @inheritdoc
2323
* @codeCoverageIgnore
24-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
24+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
2525
*/
2626
class Container implements ContainerInterface
2727
{

src/App/GenericException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/**
1313
* Base exception for general purposes.
1414
*
15-
* @SuppressWarnings(PHPMD.NumberOfChildren)
15+
* @SuppressWarnings("PHPMD.NumberOfChildren")
1616
*/
1717
class GenericException extends \Exception
1818
{

src/App/Logger/Formatter/JsonErrorFormatter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function __construct(
5353
public function format(\Monolog\LogRecord|array $record): string
5454
{
5555
// Monolog version 3 or higher.
56+
/** @phpstan-ignore-next-line */
5657
if (\Monolog\Logger::API == 3) {
5758
try {
5859
/** @phpstan-ignore-next-line */

src/App/Logger/HandlerFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* The handler factory.
2525
*
26-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
26+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
2727
*/
2828
class HandlerFactory
2929
{
@@ -73,7 +73,7 @@ public function __construct(
7373
* @return AbstractProcessingHandler
7474
* @throws LoggerException
7575
*
76-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
76+
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
7777
*/
7878
public function create(string $handler): AbstractProcessingHandler
7979
{
@@ -172,6 +172,7 @@ private function normalizeLevel(string $level): int
172172
/** @phpstan-ignore-next-line */
173173
$normalizedLevel = Logger::toMonologLevel($level);
174174

175+
/** @phpstan-ignore-next-line */
175176
if (\Monolog\Logger::API == 3) {
176177
/** @phpstan-ignore-next-line */
177178
$normalizedLevel = $normalizedLevel->value;

src/App/Logger/Processor/SanitizeProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(Sanitizer $sanitizer)
3333
public function __invoke(\Monolog\LogRecord|array $record)
3434
{
3535
// Monolog version 3 or higher.
36-
if (\Monolog\Logger::API == 3) {
36+
if (\Monolog\Logger::API == 3) { // @phpstan-ignore-line
3737
$message = $this->sanitizer->sanitize($record->message); // @phpstan-ignore-line
3838
// Create new LogRecord from existing and update the message,
3939
// since message is read only

src/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* @inheritdoc
1717
*
18-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
1919
*/
2020
class Application extends \Symfony\Component\Console\Application
2121
{

src/Command/ConfigShow/Renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function renderTable(OutputInterface $output, string $title, array $he
114114
$table = new Table($output);
115115
$table->setHeaders($header)
116116
->setRows($rows);
117-
if (method_exists($table, 'setColumnWidth')) {
117+
if (method_exists($table, 'setColumnWidth')) { // @phpstan-ignore-line
118118
$table->setColumnWidth(0, 40);
119119
$table->setColumnWidth(1, 60);
120120
}

src/Command/ConfigValidate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function configure(): void
5353
* @param OutputInterface $output
5454
* @return int
5555
*
56-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
56+
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
5757
*/
5858
public function execute(InputInterface $input, OutputInterface $output)
5959
{

src/Command/Dev/GenerateSchemaError.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/**
1919
* @codeCoverageIgnore
20-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
2121
*/
2222
class GenerateSchemaError extends Command
2323
{
@@ -60,7 +60,7 @@ protected function configure(): void
6060
/**
6161
* @inheritdoc
6262
*
63-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
63+
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
6464
*/
6565
protected function execute(InputInterface $input, OutputInterface $output): int
6666
{

src/Command/Dev/UpdateComposer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected function configure(): void
102102
* @throws ConfigException
103103
* @throws FileSystemException
104104
*
105-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
105+
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
106106
*/
107107
protected function execute(InputInterface $input, OutputInterface $output): int
108108
{

0 commit comments

Comments
 (0)