From b89c133ab3c82bdbfb0207ffbf6106b476fdd31c Mon Sep 17 00:00:00 2001 From: wakebit <32976842+wakebit@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:16:51 +0500 Subject: [PATCH] fix code-style --- src/Console/Command/Database/TableCommand.php | 3 +++ src/Console/Command/Migrate/AbstractCommand.php | 2 ++ tests/config/container.php | 1 + tests/config/cycle.php | 1 + tests/src/Constraints/SeeInOrder.php | 9 +++------ tests/src/TestCase.php | 1 + 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Console/Command/Database/TableCommand.php b/src/Console/Command/Database/TableCommand.php index d05b01c..02c3aa5 100644 --- a/src/Console/Command/Database/TableCommand.php +++ b/src/Console/Command/Database/TableCommand.php @@ -42,18 +42,21 @@ final class TableCommand extends Command /** * @var InputInterface + * * @psalm-suppress PropertyNotSetInConstructor */ private $input; /** * @var OutputInterface + * * @psalm-suppress PropertyNotSetInConstructor */ private $output; /** * @var string + * * @psalm-suppress PropertyNotSetInConstructor */ private $tableName; diff --git a/src/Console/Command/Migrate/AbstractCommand.php b/src/Console/Command/Migrate/AbstractCommand.php index f0ff03f..c21643e 100644 --- a/src/Console/Command/Migrate/AbstractCommand.php +++ b/src/Console/Command/Migrate/AbstractCommand.php @@ -29,12 +29,14 @@ abstract class AbstractCommand extends Command /** * @var InputInterface + * * @psalm-suppress PropertyNotSetInConstructor */ protected $input; /** * @var OutputInterface + * * @psalm-suppress PropertyNotSetInConstructor */ protected $output; diff --git a/tests/config/container.php b/tests/config/container.php index d57285c..94949c4 100644 --- a/tests/config/container.php +++ b/tests/config/container.php @@ -29,6 +29,7 @@ use Wakebit\CycleBridge\Schema\Config\SchemaConfig; use Wakebit\CycleBridge\Schema\GeneratorQueue; use Wakebit\CycleBridge\Schema\SchemaFactory; + use function DI\autowire; use function DI\factory; use function DI\get; diff --git a/tests/config/cycle.php b/tests/config/cycle.php index 6646d56..fe5e18e 100644 --- a/tests/config/cycle.php +++ b/tests/config/cycle.php @@ -5,6 +5,7 @@ use Spiral\Migrations\Config\MigrationConfig; use Spiral\Tokenizer\Config\TokenizerConfig; use Wakebit\CycleBridge\Schema\Config\SchemaConfig; + use function DI\create; /** diff --git a/tests/src/Constraints/SeeInOrder.php b/tests/src/Constraints/SeeInOrder.php index f99072e..7903b12 100644 --- a/tests/src/Constraints/SeeInOrder.php +++ b/tests/src/Constraints/SeeInOrder.php @@ -7,9 +7,6 @@ namespace Wakebit\CycleBridge\Tests\Constraints; use PHPUnit\Framework\Constraint\Constraint; -use ReflectionClass; -use function mb_strlen; -use function mb_strpos; final class SeeInOrder extends Constraint { @@ -46,7 +43,7 @@ public function matches($values): bool continue; } - $valuePosition = mb_strpos($this->content, $value, $position); + $valuePosition = \mb_strpos($this->content, $value, $position); if ($valuePosition === false || $valuePosition < $position) { $this->failedValue = $value; @@ -54,7 +51,7 @@ public function matches($values): bool return false; } - $position = $valuePosition + mb_strlen($value); + $position = $valuePosition + \mb_strlen($value); } return true; @@ -79,6 +76,6 @@ public function failureDescription($values): string */ public function toString(): string { - return (new ReflectionClass($this))->name; + return (new \ReflectionClass($this))->name; } } diff --git a/tests/src/TestCase.php b/tests/src/TestCase.php index 12b7571..6bf04ca 100644 --- a/tests/src/TestCase.php +++ b/tests/src/TestCase.php @@ -22,6 +22,7 @@ protected function setUp(): void /** * @var array $definitions + * * @psalm-suppress MissingFile */ $definitions = require __DIR__ . '/../config/container.php';