Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/SystemVariableAssigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions tests/BasicVariableAssignmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down