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
@@ -23,7 +23,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
#[Test]
|
||||
public function it_reads_table_and_primary_key(): void
|
||||
{
|
||||
$metadata = (new MetadataFactory())->forClass(Usuario::class);
|
||||
$metadata = new MetadataFactory()->forClass(Usuario::class);
|
||||
|
||||
self::assertSame('usuarios', $metadata->table());
|
||||
self::assertSame('codigo', $metadata->primaryKey());
|
||||
@@ -33,7 +33,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
#[Test]
|
||||
public function it_converts_property_names_to_columns(): void
|
||||
{
|
||||
$metadata = (new MetadataFactory())->forClass(Usuario::class);
|
||||
$metadata = new MetadataFactory()->forClass(Usuario::class);
|
||||
|
||||
self::assertSame('password_hash', $metadata->column('passwordHash'));
|
||||
self::assertSame('passwordHash', $metadata->property('password_hash'));
|
||||
@@ -43,7 +43,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
#[Test]
|
||||
public function it_honours_an_explicit_column_name(): void
|
||||
{
|
||||
$metadata = (new MetadataFactory())->forClass(Factura::class);
|
||||
$metadata = new MetadataFactory()->forClass(Factura::class);
|
||||
|
||||
self::assertSame('importe_total', $metadata->column('total'));
|
||||
}
|
||||
@@ -51,7 +51,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
#[Test]
|
||||
public function it_excludes_relations_from_writable_columns(): void
|
||||
{
|
||||
$metadata = (new MetadataFactory())->forClass(Factura::class);
|
||||
$metadata = new MetadataFactory()->forClass(Factura::class);
|
||||
|
||||
self::assertSame(['usuarioCodigo', 'total'], $metadata->writable());
|
||||
self::assertCount(2, $metadata->relations());
|
||||
@@ -60,7 +60,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
#[Test]
|
||||
public function it_resolves_belongs_to_metadata(): void
|
||||
{
|
||||
$metadata = (new MetadataFactory())->forClass(Factura::class);
|
||||
$metadata = new MetadataFactory()->forClass(Factura::class);
|
||||
$relation = $metadata->properties()['usuario']->relation;
|
||||
|
||||
self::assertNotNull($relation);
|
||||
@@ -72,7 +72,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
#[Test]
|
||||
public function it_resolves_belongs_to_many_pivot_metadata(): void
|
||||
{
|
||||
$metadata = (new MetadataFactory())->forClass(Articulo::class);
|
||||
$metadata = new MetadataFactory()->forClass(Articulo::class);
|
||||
$relation = $metadata->properties()['etiquetas']->relation;
|
||||
|
||||
self::assertNotNull($relation);
|
||||
@@ -89,7 +89,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
$this->expectException(MetadataException::class);
|
||||
$this->expectExceptionMessage('[M2]');
|
||||
|
||||
(new MetadataFactory())->forClass(SinTableName::class);
|
||||
new MetadataFactory()->forClass(SinTableName::class);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
@@ -98,7 +98,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
$this->expectException(MetadataException::class);
|
||||
$this->expectExceptionMessage('[M3]');
|
||||
|
||||
(new MetadataFactory())->forClass(SinPrimaryKey::class);
|
||||
new MetadataFactory()->forClass(SinPrimaryKey::class);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
@@ -107,7 +107,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
$this->expectException(MetadataException::class);
|
||||
$this->expectExceptionMessage('[M3]');
|
||||
|
||||
(new MetadataFactory())->forClass(DosPrimaryKeys::class);
|
||||
new MetadataFactory()->forClass(DosPrimaryKeys::class);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
@@ -116,7 +116,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
$this->expectException(MetadataException::class);
|
||||
$this->expectExceptionMessage('[M4]');
|
||||
|
||||
(new MetadataFactory())->forClass(SinTipo::class);
|
||||
new MetadataFactory()->forClass(SinTipo::class);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
@@ -125,7 +125,7 @@ final class MetadataFactoryTest extends TestCase
|
||||
$this->expectException(MetadataException::class);
|
||||
$this->expectExceptionMessage('[M7]');
|
||||
|
||||
(new MetadataFactory())->forClass(ColumnaDuplicada::class);
|
||||
new MetadataFactory()->forClass(ColumnaDuplicada::class);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
@@ -134,6 +134,6 @@ final class MetadataFactoryTest extends TestCase
|
||||
$this->expectException(MetadataException::class);
|
||||
$this->expectExceptionMessage('[M5]');
|
||||
|
||||
(new MetadataFactory())->forClass(RelacionNoNulable::class);
|
||||
new MetadataFactory()->forClass(RelacionNoNulable::class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user