Drop support for PHP 8.3 and lower. The package now declares >=8.4, and CI runs only on 8.4. - composer.json: require php >=8.4. - mago.toml: php-version = "8.4", matching the minimum supported version. - phpstan.neon: phpVersion 80400. - Upgrade phpstan/phpstan to ^2.3: 1.x cannot parse `new Foo()->bar()`, which the 8.4 formatter now emits. - Fix the type errors PHPStan 2 reports: class-string<static> variance, optional array offsets in fromEnvironment, list vs array for PdoConnection::$lru, ReflectionClass<Model> docblocks, Repository made covariant in T, and a redundant null comparison in validateRelationPath. - CI: single PHP 8.4 job using the php:8.4-cli container instead of setup-php, which failed with a TLS handshake timeout on the runner. BREAKING CHANGE: PHP 8.4 is now required.
This commit is contained in:
1 parent
c15015d809
commit
0e756e45c7
20 files changed
+97
-107
No files matched your search
@@ -31,7 +31,7 @@ final class PersisterTest extends TestCase
|
||||
public function it_inserts_and_assigns_the_generated_key(): void
|
||||
{
|
||||
$this->connection->lastInsertId = '42';
|
||||
$usuario = (new Usuario())->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
$usuario = new Usuario()->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
|
||||
$key = $this->persister->insert($usuario);
|
||||
|
||||
@@ -44,7 +44,7 @@ final class PersisterTest extends TestCase
|
||||
public function it_only_writes_writable_columns(): void
|
||||
{
|
||||
$this->connection->lastInsertId = '1';
|
||||
$usuario = (new Usuario())->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
$usuario = new Usuario()->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
|
||||
$this->persister->insert($usuario);
|
||||
|
||||
@@ -57,7 +57,7 @@ final class PersisterTest extends TestCase
|
||||
#[Test]
|
||||
public function it_saves_as_update_when_the_key_is_present(): void
|
||||
{
|
||||
$usuario = (new Usuario())->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
$usuario = new Usuario()->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
$usuario->codigo = 9;
|
||||
|
||||
$this->persister->save($usuario);
|
||||
@@ -69,7 +69,7 @@ final class PersisterTest extends TestCase
|
||||
public function it_saves_as_insert_when_the_key_is_absent(): void
|
||||
{
|
||||
$this->connection->lastInsertId = '3';
|
||||
$usuario = (new Usuario())->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
$usuario = new Usuario()->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
|
||||
$this->persister->save($usuario);
|
||||
|
||||
@@ -81,13 +81,13 @@ final class PersisterTest extends TestCase
|
||||
{
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$this->persister->insert((new Usuario())->hydrate(['nombre' => 'Ana']));
|
||||
$this->persister->insert(new Usuario()->hydrate(['nombre' => 'Ana']));
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function it_refuses_to_write_a_partial_model(): void
|
||||
{
|
||||
$usuario = (new Usuario())->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
$usuario = new Usuario()->hydrate(['nombre' => 'Ana', 'clave' => 'abc']);
|
||||
$usuario->codigo = 1;
|
||||
$usuario->markPartial();
|
||||
|
||||
@@ -149,7 +149,7 @@ final class PersisterTest extends TestCase
|
||||
$listener,
|
||||
);
|
||||
|
||||
$persister->insert((new Usuario())->hydrate(['nombre' => 'Ana', 'clave' => 'abc']));
|
||||
$persister->insert(new Usuario()->hydrate(['nombre' => 'Ana', 'clave' => 'abc']));
|
||||
|
||||
self::assertSame([['action' => 'insert', 'pk' => 7]], $listener->calls);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user