diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc46de4..968ac17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: - php: [8.2, 8.3, 8.4] + php: [8.2, 8.3, 8.4, 8.5] laravel: [^11.0, ^12.0, ^13.0.x-dev] exclude: - php: 8.2 diff --git a/src/SystemVariableAssigner.php b/src/SystemVariableAssigner.php index 64f4dca..5efa753 100644 --- a/src/SystemVariableAssigner.php +++ b/src/SystemVariableAssigner.php @@ -32,7 +32,7 @@ class SystemVariableAssigner /** * @phpstan-ignore-next-line parameterByRef.unusedType */ - public function __construct(null|Closure|PDO &...$pdos) + public function __construct(Closure|PDO|null &...$pdos) { $this->pdos = array_filter($pdos); } diff --git a/src/Value.php b/src/Value.php index 677171b..911a7ff 100644 --- a/src/Value.php +++ b/src/Value.php @@ -67,7 +67,7 @@ public static function str(string $value) * * @param bool|float|int|string $value */ - public static function as(string $type, $value): ExpressionInterface + public static function as(string $type, $value): ValueInterface { switch ($type) { case static::TYPE_INTEGER: diff --git a/tests/BasicVariableAssignmentTest.php b/tests/BasicVariableAssignmentTest.php index d2c174d..a339060 100644 --- a/tests/BasicVariableAssignmentTest.php +++ b/tests/BasicVariableAssignmentTest.php @@ -8,16 +8,16 @@ use Mpyw\LaravelMySqlSystemVariableManager\MySqlConnection; use Mpyw\LaravelMySqlSystemVariableManager\Replacer; use Mpyw\LaravelMySqlSystemVariableManager\Value; +use PHPUnit\Framework\Attributes\DataProvider; class BasicVariableAssignmentTest extends TestCase { /** - * @test * @param mixed $expectedOriginal * @param mixed $newValue * @param mixed $expectedChanged - * @dataProvider provideBasicVariables */ + #[DataProvider('provideBasicVariables')] public function testAssignments(string $variableName, bool $emulated, $expectedOriginal, $newValue, $expectedChanged): void { $this->{$emulated ? 'onEmulatedConnection' : 'onNativeConnection'}(function (MySqlConnection $db) use ($variableName, $expectedOriginal, $newValue, $expectedChanged): void { @@ -28,12 +28,11 @@ public function testAssignments(string $variableName, bool $emulated, $expectedO } /** - * @test * @param mixed $expectedOriginal * @param mixed $newValue * @param mixed $expectedChanged - * @dataProvider provideBasicVariables */ + #[DataProvider('provideBasicVariables')] public function testTemporaryAssignments(string $variableName, bool $emulated, $expectedOriginal, $newValue, $expectedChanged): void { $this->{$emulated ? 'onEmulatedConnection' : 'onNativeConnection'}(function (MySqlConnection $db) use ($variableName, $expectedOriginal, $newValue, $expectedChanged): void {