diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d21750..3573d0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - php-version: ['8.4', '8.5'] + php-version: ['8.5'] dependency-versions: ['lowest', 'highest'] name: 'BlackBox' services: @@ -50,7 +50,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - php-version: ['8.4', '8.5'] + php-version: ['8.5'] dependency-versions: ['lowest', 'highest'] name: 'Coverage' services: @@ -92,6 +92,20 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} psalm: - uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main + uses: innmind/github-workflows/.github/workflows/psalm.yml@main + name: 'Psalm' + strategy: + matrix: + php-version: ['8.5'] + run-php-version: ['8.5'] + with: + php-version: ${{ matrix.php-version }} + run-php-version: ${{ matrix.run-php-version }} cs: uses: innmind/github-workflows/.github/workflows/cs.yml@main + name: 'CS' + strategy: + matrix: + php-version: ['8.5'] + with: + php-version: ${{ matrix.php-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9816337..06b8ddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [Unreleased] + +### Changed + +- Requires PHP `8.5` +- Requires `innmind/black-box:~7.0` + ## 5.1.0 - 2026-03-21 ### Added diff --git a/blackbox.php b/blackbox.php index 7596898..a70e36a 100644 --- a/blackbox.php +++ b/blackbox.php @@ -11,19 +11,20 @@ Application::new($argv) ->disableMemoryLimit() - ->codeCoverage( - CodeCoverage::of( - __DIR__.'/src/', - __DIR__.'/proofs/', - __DIR__.'/fixtures/', - ) - ->dumpTo('coverage.clover') - ->enableWhen(\getenv('ENABLE_COVERAGE') !== false), + ->scenariiPerProof(10) + ->when( + \getenv('ENABLE_COVERAGE') !== false, + static fn($app) => $app + ->codeCoverage( + CodeCoverage::of( + __DIR__.'/src/', + __DIR__.'/proofs/', + __DIR__.'/fixtures/', + ) + ->dumpTo('coverage.clover'), + ) + ->scenariiPerProof(1), ) - ->scenariiPerProof(match (\getenv('ENABLE_COVERAGE')) { - false => 100, - default => 1, - }) ->when( \getenv('BLACKBOX_SET_SIZE') !== false, static fn(Application $app) => $app->scenariiPerProof((int) \getenv('BLACKBOX_SET_SIZE')), diff --git a/composer.json b/composer.json index ba6cff1..4f07a4f 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "issues": "http://github.com/formal-php/access-layer/issues" }, "require": { - "php": "~8.4", + "php": "~8.5", "innmind/immutable": "~6.0", "innmind/url": "~5.0", "innmind/specification": "~4.1", @@ -35,16 +35,16 @@ }, "require-dev": { "innmind/static-analysis": "~1.3", - "innmind/black-box": "~6.5", + "innmind/black-box": "~7.0", "innmind/coding-standard": "~2.0" }, "conflict": { - "innmind/black-box": "<6.0|~7.0" + "innmind/black-box": "<7.0|~8.0" }, "suggest": { "innmind/black-box": "For property based testing" }, "provide": { - "innmind/black-box-sets": "6.0" + "innmind/black-box-sets": "7.0" } } diff --git a/fixtures/Table/Column/Type.php b/fixtures/Table/Column/Type.php index 51d7872..a327a49 100644 --- a/fixtures/Table/Column/Type.php +++ b/fixtures/Table/Column/Type.php @@ -210,6 +210,6 @@ private static function comment(): Set Set::strings() ->madeOf(Set::strings()->chars()->alphanumerical()) ->atLeast(1), - )->toSet(); + ); } } diff --git a/fixtures/Table/Name.php b/fixtures/Table/Name.php index abe7412..dd58e7c 100644 --- a/fixtures/Table/Name.php +++ b/fixtures/Table/Name.php @@ -25,7 +25,7 @@ public static function any(): Set Set::of('é', 'è', 'ê', 'ë', '_'), ) ->between(0, 63), - )->toSet(); + ); } /** diff --git a/proofs/connection/lazy.php b/proofs/connection/lazy.php index de2dbe4..73e9e92 100644 --- a/proofs/connection/lazy.php +++ b/proofs/connection/lazy.php @@ -6,39 +6,41 @@ use Innmind\Url\Url; use Innmind\BlackBox\Set; -return static function() { +return static function($prove) { $port = \getenv('DB_PORT') ?: '3306'; $connection = Connection::new(Url::of("mysql://root:root@127.0.0.1:$port/example"))->unwrap(); Properties::seed($connection); - $connections = Set::call(static function() use ($connection) { + $connections = Set::of(static function() use ($connection) { Properties::seed($connection); return $connection; }); - yield test( + yield $prove->test( 'Lazy interface', static fn($assert) => $assert ->object($connection) ->instance(Connection::class), ); - yield test( + yield $prove->test( 'Lazy connection must not be established at instanciation', static fn($assert) => $assert ->object(Connection::new(Url::of('mysql://unknown:unknown@127.0.0.1:3306/unknown'))), ); - yield properties( + yield $prove->properties( 'Lazy properties', Properties::any(), $connections, ); foreach (Properties::list() as $property) { - yield property( - $property, - $connections, - )->named('Lazy'); + yield $prove + ->property( + $property, + $connections, + ) + ->named('Lazy'); } }; diff --git a/proofs/connection/logger.php b/proofs/connection/logger.php index 5fcb12d..8a58df3 100644 --- a/proofs/connection/logger.php +++ b/proofs/connection/logger.php @@ -7,36 +7,38 @@ use Innmind\BlackBox\Set; use Psr\Log\NullLogger; -return static function() { +return static function($prove) { $port = \getenv('DB_PORT') ?: '3306'; $connection = Connection::logger( Connection::new(Url::of("mysql://root:root@127.0.0.1:$port/example"))->unwrap(), new NullLogger, ); Properties::seed($connection); - $connections = Set::call(static function() use ($connection) { + $connections = Set::of(static function() use ($connection) { Properties::seed($connection); return $connection; }); - yield test( + yield $prove->test( 'Logger interface', static fn($assert) => $assert ->object($connection) ->instance(Connection::class), ); - yield properties( + yield $prove->properties( 'Logger properties', Properties::any(), $connections, ); foreach (Properties::list() as $property) { - yield property( - $property, - $connections, - )->named('Logger'); + yield $prove + ->property( + $property, + $connections, + ) + ->named('Logger'); } }; diff --git a/proofs/connection/pdo.php b/proofs/connection/pdo.php index c744172..7210103 100644 --- a/proofs/connection/pdo.php +++ b/proofs/connection/pdo.php @@ -30,23 +30,23 @@ use Innmind\Immutable\Sequence; use Innmind\BlackBox\Set; -$proofs = static function(Url $dsn, Driver $driver) { +$proofs = static function($prove, Url $dsn, Driver $driver) { $connection = Connection::new($dsn)->unwrap(); Properties::seed($connection); - $connections = Set::call(static function() use ($connection) { + $connections = Set::of(static function() use ($connection) { Properties::seed($connection); return $connection; }); - yield test( + yield $prove->test( "PDO interface({$driver->name})", static fn($assert) => $assert ->object($connection) ->instance(Connection::class), ); - yield test( + yield $prove->test( "PDO lazy select doesnt load everything in memory({$driver->name})", static function($assert) use ($connection) { $table = Table\Name::of('test_lazy_load'); @@ -91,7 +91,7 @@ static function($assert) use ($connection) { ); if ($driver === Driver::mysql) { - yield test( + yield $prove->test( "PDO charset({$driver->name})", static function($assert) use ($connection, $dsn) { $table = Table\Name::of('test_charset'); @@ -144,7 +144,7 @@ static function($assert) use ($connection, $dsn) { ); } - yield test( + yield $prove->test( "Select join({$driver->name})", static function($assert) use ($connection) { $table = Table\Name::of('test_left_join'); @@ -250,7 +250,7 @@ public function value(): int }, ); - yield test( + yield $prove->test( "Delete cascade({$driver->name})", static function($assert) use ($connection) { $parent = Table\Name::of('test_cascade_delete_parent'); @@ -309,7 +309,7 @@ static function($assert) use ($connection) { }, ); - yield test( + yield $prove->test( "Delete set null({$driver->name})", static function($assert) use ($connection) { $parent = Table\Name::of('test_set_null_delete_parent'); @@ -375,7 +375,7 @@ static function($assert) use ($connection) { }, ); - yield test( + yield $prove->test( "Foreign key name({$driver->name})", static function($assert) use ($driver) { $parent = Table\Name::of('parent_table'); @@ -392,7 +392,7 @@ static function($assert) use ($driver) { }, ); - yield test( + yield $prove->test( "Delete join({$driver->name})", static function($assert) use ($connection) { $parent = Table\Name::of('test_join_delete_parent')->as('parent'); @@ -465,10 +465,10 @@ static function($assert) use ($connection) { }, ); - yield proof( - "Unique constraint({$driver->name})", - given(Set::integers()->between(0, 1_000_000)), - static function($assert, $int) use ($connection) { + yield $prove + ->proof("Unique constraint({$driver->name})") + ->given(Set::integers()->between(0, 1_000_000)) + ->test(static function($assert, $int) use ($connection) { $table = Table\Name::of('test_unique'); $_ = $connection(CreateTable::ifNotExists( $table, @@ -506,27 +506,29 @@ static function($assert, $int) use ($connection) { ))); $_ = $connection(DropTable::named($table)); - }, - ); + }); - yield properties( + yield $prove->properties( "PDO properties({$driver->name})", Properties::any(), $connections, ); foreach (Properties::list() as $property) { - yield property( - $property, - $connections, - )->named("PDO({$driver->name})"); + yield $prove + ->property( + $property, + $connections, + ) + ->named("PDO({$driver->name})"); } }; -return static function() use ($proofs) { +return static function($prove) use ($proofs) { $port = \getenv('DB_PORT') ?: '3306'; yield from $proofs( + $prove, Url::of("mysql://root:root@127.0.0.1:$port/example"), Driver::mysql, ); @@ -534,6 +536,7 @@ static function($assert, $int) use ($connection) { $port = \getenv('POSTGRES_DB_PORT') ?: '5432'; yield from $proofs( + $prove, Url::of("pgsql://root:root@127.0.0.1:$port/example"), Driver::postgres, ); diff --git a/proofs/query/parameter/type.php b/proofs/query/parameter/type.php index 4978230..4d51529 100644 --- a/proofs/query/parameter/type.php +++ b/proofs/query/parameter/type.php @@ -4,8 +4,8 @@ use Formal\AccessLayer\Query\Parameter\Type; use Innmind\BlackBox\Set; -return static function() { - yield test( +return static function($prove) { + yield $prove->test( 'Type::for() bool', static function($assert) { $assert->same( @@ -19,7 +19,7 @@ static function($assert) { }, ); - yield test( + yield $prove->test( 'Type::for() null', static function($assert) { $assert->same( @@ -29,43 +29,40 @@ static function($assert) { }, ); - yield proof( - 'Type::for() int', - given(Set::integers()), - static function($assert, $int) { + yield $prove + ->proof('Type::for() int') + ->given(Set::integers()) + ->test(static function($assert, $int) { $assert->same( Type::int, Type::for($int), ); - }, - ); + }); - yield proof( - 'Type::for() string', - given(Set::strings()->unicode()), - static function($assert, $string) { + yield $prove + ->proof('Type::for() string') + ->given(Set::strings()->unicode()) + ->test(static function($assert, $string) { $assert->same( Type::string, Type::for($string), ); - }, - ); + }); - yield proof( - 'Type::for() unsupported data', - given( + yield $prove + ->proof('Type::for() unsupported data') + ->given( Set::of( new \stdClass, new class {}, static fn() => null, \tmpfile(), ), - ), - static function($assert, $value) { + ) + ->test(static function($assert, $value) { $assert->same( Type::unspecified, Type::for($value), ); - }, - ); + }); }; diff --git a/proofs/query/where.php b/proofs/query/where.php index 52e6c11..4b92847 100644 --- a/proofs/query/where.php +++ b/proofs/query/where.php @@ -17,8 +17,8 @@ Name, }; -return static function() { - yield test( +return static function($prove) { + yield $prove->test( 'Where no specification', static function($assert) { $where = Where::of(null); @@ -30,13 +30,13 @@ static function($assert) { }, ); - yield proof( - 'Where equal comparator', - given( + yield $prove + ->proof('Where equal comparator') + ->given( Column::any(), Set::strings(), - ), - static function($assert, $column, $value) { + ) + ->test(static function($assert, $column, $value) { $specification = Property::of( $column->name()->toString(), Sign::equality, @@ -54,16 +54,15 @@ static function($assert, $column, $value) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where less than comparator', - given( + yield $prove + ->proof('Where less than comparator') + ->given( Column::any(), Set::strings(), - ), - static function($assert, $column, $value) { + ) + ->test(static function($assert, $column, $value) { $specification = Property::of( $column->name()->toString(), Sign::lessThan, @@ -81,16 +80,15 @@ static function($assert, $column, $value) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where less than or equal comparator', - given( + yield $prove + ->proof('Where less than or equal comparator') + ->given( Column::any(), Set::strings(), - ), - static function($assert, $column, $value) { + ) + ->test(static function($assert, $column, $value) { $lessThan = Property::of( $column->name()->toString(), Sign::lessThan, @@ -113,17 +111,16 @@ static function($assert, $column, $value) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where less than or equal comparator on different columns', - given( + yield $prove + ->proof('Where less than or equal comparator on different columns') + ->given( Column::any(), Column::any(), Set::strings(), - ), - static function($assert, $column1, $column2, $value) { + ) + ->test(static function($assert, $column1, $column2, $value) { $lessThan = Property::of( $column1->name()->toString(), Sign::lessThan, @@ -150,16 +147,15 @@ static function($assert, $column1, $column2, $value) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where more than comparator', - given( + yield $prove + ->proof('Where more than comparator') + ->given( Column::any(), Set::strings(), - ), - static function($assert, $column, $value) { + ) + ->test(static function($assert, $column, $value) { $specification = Property::of( $column->name()->toString(), Sign::moreThan, @@ -177,16 +173,15 @@ static function($assert, $column, $value) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where more than or equal comparator', - given( + yield $prove + ->proof('Where more than or equal comparator') + ->given( Column::any(), Set::strings(), - ), - static function($assert, $column, $value) { + ) + ->test(static function($assert, $column, $value) { $moreThan = Property::of( $column->name()->toString(), Sign::moreThan, @@ -209,17 +204,16 @@ static function($assert, $column, $value) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where more than or equal comparator on different columns', - given( + yield $prove + ->proof('Where more than or equal comparator on different columns') + ->given( Column::any(), Column::any(), Set::strings(), - ), - static function($assert, $column1, $column2, $value) { + ) + ->test(static function($assert, $column1, $column2, $value) { $moreThan = Property::of( $column1->name()->toString(), Sign::moreThan, @@ -246,13 +240,12 @@ static function($assert, $column1, $column2, $value) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where is null comparator', - given(Column::any()), - static function($assert, $column) { + yield $prove + ->proof('Where is null comparator') + ->given(Column::any()) + ->test(static function($assert, $column) { $specification = Property::of( $column->name()->toString(), Sign::equality, @@ -266,13 +259,12 @@ static function($assert, $column) { $sql, ); $assert->same(0, $parameters->size()); - }, - ); + }); - yield proof( - 'Where is not null comparator', - given(Column::any()), - static function($assert, $column) { + yield $prove + ->proof('Where is not null comparator') + ->given(Column::any()) + ->test(static function($assert, $column) { $specification = Property::of( $column->name()->toString(), Sign::equality, @@ -286,12 +278,11 @@ static function($assert, $column) { $sql, ); $assert->same(0, $parameters->size()); - }, - ); + }); - yield proof( - 'Where in comparator', - given( + yield $prove + ->proof('Where in comparator') + ->given( Column::any(), Set::strings(), Set::strings(), @@ -300,8 +291,8 @@ static function($assert, $column) { Set::strings(), Set::integers()->between(1, 5), ), - ), - static function($assert, $column, $value1, $value2, $value3, $values) { + ) + ->test(static function($assert, $column, $value1, $value2, $value3, $values) { $specification = Property::of( $column->name()->toString(), Sign::in, @@ -341,17 +332,16 @@ static function($assert, $column, $value1, $value2, $value3, $values) { \count_chars($sql)[63], // looking for '?' placeholders ); $assert->same(\count($values), $parameters->size()); - }, - ); + }); - yield proof( - 'Where not', - given( + yield $prove + ->proof('Where not') + ->given( Column::any(), Set::strings(), Set::strings(), - ), - static function($assert, $column, $leftValue, $rightValue){ + ) + ->test(static function($assert, $column, $leftValue, $rightValue){ $specification = Property::of( $column->name()->toString(), Sign::equality, @@ -397,18 +387,17 @@ static function($assert, $column, $leftValue, $rightValue){ static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where and', - given( + yield $prove + ->proof('Where and') + ->given( Column::any(), Column::any(), Set::strings(), Set::strings(), - ), - static function($assert, $column1, $column2, $value1, $value2) { + ) + ->test(static function($assert, $column1, $column2, $value1, $value2) { $left = Property::of( $column1->name()->toString(), Sign::equality, @@ -464,18 +453,17 @@ static function($assert, $column1, $column2, $value1, $value2) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Where or', - given( + yield $prove + ->proof('Where or') + ->given( Column::any(), Column::any(), Set::strings(), Set::strings(), - ), - static function($assert, $column1, $column2, $value1, $value2) { + ) + ->test(static function($assert, $column1, $column2, $value1, $value2) { $left = Property::of( $column1->name()->toString(), Sign::equality, @@ -531,12 +519,11 @@ static function($assert, $column1, $column2, $value1, $value2) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Comparator value can be a row type', - given( + yield $prove + ->proof('Comparator value can be a row type') + ->given( Column::any(), Column::any(), Set::strings(), @@ -547,8 +534,8 @@ static function($assert, $column1, $column2, $value1, $value2) { Type::string, Type::unspecified, ), - ), - static function($assert, $column, $unused, $value, $type) { + ) + ->test(static function($assert, $column, $unused, $value, $type) { $specification = Property::of( $column->name()->toString(), Sign::equality, @@ -570,17 +557,16 @@ static function($assert, $column, $unused, $value, $type) { static fn($parameter) => $parameter->type(), static fn() => null, )); - }, - ); + }); - yield proof( - 'Table name can be used in property', - given( + yield $prove + ->proof('Table name can be used in property') + ->given( Name::any(), Column::any(), Set::strings(), - ), - static function($assert, $table, $column, $value) { + ) + ->test(static function($assert, $table, $column, $value) { $specification = Property::of( $table->toString().'.'.$column->name()->toString(), Sign::equality, @@ -598,6 +584,5 @@ static function($assert, $table, $column, $value) { static fn($parameter) => $parameter->value(), static fn() => null, )); - }, - ); + }); }; diff --git a/properties/Connection.php b/properties/Connection.php index 24f340d..08c2210 100644 --- a/properties/Connection.php +++ b/properties/Connection.php @@ -19,14 +19,14 @@ final class Connection { /** - * @return Set|Set\Provider + * @return Set */ - public static function any(): Set|Set\Provider + public static function any(): Set { - return Set\Properties::any(...\array_map( + return Set::properties(...\array_map( static fn($class) => [$class, 'any'](), self::list(), - )); + ))->toSet(); } /** diff --git a/properties/Connection/AllowToStartTwoQueriesInParallel.php b/properties/Connection/AllowToStartTwoQueriesInParallel.php index 2d5040d..7462068 100644 --- a/properties/Connection/AllowToStartTwoQueriesInParallel.php +++ b/properties/Connection/AllowToStartTwoQueriesInParallel.php @@ -41,7 +41,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 125), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/ContentInsertedAfterStartOfTransactionIsAccessible.php b/properties/Connection/ContentInsertedAfterStartOfTransactionIsAccessible.php index db06a55..cdbba4f 100644 --- a/properties/Connection/ContentInsertedAfterStartOfTransactionIsAccessible.php +++ b/properties/Connection/ContentInsertedAfterStartOfTransactionIsAccessible.php @@ -42,7 +42,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/ContentIsAccessibleAfterCommit.php b/properties/Connection/ContentIsAccessibleAfterCommit.php index f3c8c93..2c0e703 100644 --- a/properties/Connection/ContentIsAccessibleAfterCommit.php +++ b/properties/Connection/ContentIsAccessibleAfterCommit.php @@ -42,7 +42,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/ContentIsNotAccessibleAfterRollback.php b/properties/Connection/ContentIsNotAccessibleAfterRollback.php index 67a45f6..9db76aa 100644 --- a/properties/Connection/ContentIsNotAccessibleAfterRollback.php +++ b/properties/Connection/ContentIsNotAccessibleAfterRollback.php @@ -42,7 +42,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/CreateTable.php b/properties/Connection/CreateTable.php index 6c23015..7a241dc 100644 --- a/properties/Connection/CreateTable.php +++ b/properties/Connection/CreateTable.php @@ -37,7 +37,7 @@ public static function any(): Set static fn(...$args) => new self(...$args), Name::any(), Column::list(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/CreateTableIfNotExists.php b/properties/Connection/CreateTableIfNotExists.php index 2942418..c964cd5 100644 --- a/properties/Connection/CreateTableIfNotExists.php +++ b/properties/Connection/CreateTableIfNotExists.php @@ -37,7 +37,7 @@ public static function any(): Set static fn(...$args) => new self(...$args), Name::any(), Column::list(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/CreateTableWithForeignKey.php b/properties/Connection/CreateTableWithForeignKey.php index 537adc1..0377923 100644 --- a/properties/Connection/CreateTableWithForeignKey.php +++ b/properties/Connection/CreateTableWithForeignKey.php @@ -45,7 +45,7 @@ public static function any(): Set Name::pair(), Column::any(Column\Type::constraint(), 30), Column::any(null, 30), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/CreateTableWithPrimaryKey.php b/properties/Connection/CreateTableWithPrimaryKey.php index 821056f..077abe7 100644 --- a/properties/Connection/CreateTableWithPrimaryKey.php +++ b/properties/Connection/CreateTableWithPrimaryKey.php @@ -43,7 +43,7 @@ public static function any(): Set Name::any(), Column::any(Column\Type::constraint()), Column::list(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/CreatingSameTableTwiceMustThrow.php b/properties/Connection/CreatingSameTableTwiceMustThrow.php index b92ce84..bbf7ae4 100644 --- a/properties/Connection/CreatingSameTableTwiceMustThrow.php +++ b/properties/Connection/CreatingSameTableTwiceMustThrow.php @@ -38,7 +38,7 @@ public static function any(): Set static fn(...$args) => new self(...$args), Name::any(), Column::list(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/DeleteSpecificRow.php b/properties/Connection/DeleteSpecificRow.php index e2ff795..393b2ae 100644 --- a/properties/Connection/DeleteSpecificRow.php +++ b/properties/Connection/DeleteSpecificRow.php @@ -42,7 +42,7 @@ public static function any(): Set static fn(...$args) => new self(...$args), Set::uuid(), Set::uuid(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/InsertSelect.php b/properties/Connection/InsertSelect.php index 004724f..71a2510 100644 --- a/properties/Connection/InsertSelect.php +++ b/properties/Connection/InsertSelect.php @@ -45,7 +45,7 @@ public static function any(): Set Set::strings() ->madeOf(Set::strings()->chars()->alphanumerical()) ->between(10, 100), // to avoid collisions - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/MultipleInsertsAtOnce.php b/properties/Connection/MultipleInsertsAtOnce.php index 0c77929..431a630 100644 --- a/properties/Connection/MultipleInsertsAtOnce.php +++ b/properties/Connection/MultipleInsertsAtOnce.php @@ -60,7 +60,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/MustThrowWhenValueDoesntFitTheSchema.php b/properties/Connection/MustThrowWhenValueDoesntFitTheSchema.php index 9c60103..7fb635b 100644 --- a/properties/Connection/MustThrowWhenValueDoesntFitTheSchema.php +++ b/properties/Connection/MustThrowWhenValueDoesntFitTheSchema.php @@ -40,7 +40,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/ParameterTypesCanBeSpecified.php b/properties/Connection/ParameterTypesCanBeSpecified.php index 299bf9f..8e82217 100644 --- a/properties/Connection/ParameterTypesCanBeSpecified.php +++ b/properties/Connection/ParameterTypesCanBeSpecified.php @@ -40,7 +40,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/ParametersCanBeBoundByIndex.php b/properties/Connection/ParametersCanBeBoundByIndex.php index 3c394a5..301605b 100644 --- a/properties/Connection/ParametersCanBeBoundByIndex.php +++ b/properties/Connection/ParametersCanBeBoundByIndex.php @@ -39,7 +39,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/ParametersCanBeBoundByName.php b/properties/Connection/ParametersCanBeBoundByName.php index c156cd3..8dd20ff 100644 --- a/properties/Connection/ParametersCanBeBoundByName.php +++ b/properties/Connection/ParametersCanBeBoundByName.php @@ -39,7 +39,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectAliasedColumns.php b/properties/Connection/SelectAliasedColumns.php index 739cb2e..ebb5bb6 100644 --- a/properties/Connection/SelectAliasedColumns.php +++ b/properties/Connection/SelectAliasedColumns.php @@ -42,7 +42,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectColumns.php b/properties/Connection/SelectColumns.php index 33df2a8..6c24966 100644 --- a/properties/Connection/SelectColumns.php +++ b/properties/Connection/SelectColumns.php @@ -42,7 +42,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectCount.php b/properties/Connection/SelectCount.php index cd84a05..e8e6fa1 100644 --- a/properties/Connection/SelectCount.php +++ b/properties/Connection/SelectCount.php @@ -45,7 +45,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectEverything.php b/properties/Connection/SelectEverything.php index e3f04ff..96c86ea 100644 --- a/properties/Connection/SelectEverything.php +++ b/properties/Connection/SelectEverything.php @@ -41,7 +41,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectLimit.php b/properties/Connection/SelectLimit.php index f78f2be..d298294 100644 --- a/properties/Connection/SelectLimit.php +++ b/properties/Connection/SelectLimit.php @@ -48,7 +48,7 @@ public static function any(): Set ->between(0, 255), Set::integers(), Set::integers()->above(1), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectOffset.php b/properties/Connection/SelectOffset.php index 97ab709..b2d148e 100644 --- a/properties/Connection/SelectOffset.php +++ b/properties/Connection/SelectOffset.php @@ -48,7 +48,7 @@ public static function any(): Set ->between(0, 255), Set::integers(), Set::integers()->above(1), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectOrder.php b/properties/Connection/SelectOrder.php index 69b9d4d..4db3838 100644 --- a/properties/Connection/SelectOrder.php +++ b/properties/Connection/SelectOrder.php @@ -55,7 +55,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 254), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectValues.php b/properties/Connection/SelectValues.php index 636cdcd..4222596 100644 --- a/properties/Connection/SelectValues.php +++ b/properties/Connection/SelectValues.php @@ -53,7 +53,7 @@ public static function any(): Set ), Set::of(null, true, false), ), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectWhere.php b/properties/Connection/SelectWhere.php index f9e4f0a..01f98f3 100644 --- a/properties/Connection/SelectWhere.php +++ b/properties/Connection/SelectWhere.php @@ -45,7 +45,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectWhereContains.php b/properties/Connection/SelectWhereContains.php index 2a91fd7..9c7d837 100644 --- a/properties/Connection/SelectWhereContains.php +++ b/properties/Connection/SelectWhereContains.php @@ -60,7 +60,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(10, 55), // 10 to avoid collisions with possible other values Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectWhereEndsWith.php b/properties/Connection/SelectWhereEndsWith.php index 51e5828..b7ff722 100644 --- a/properties/Connection/SelectWhereEndsWith.php +++ b/properties/Connection/SelectWhereEndsWith.php @@ -54,7 +54,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 125), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectWhereIn.php b/properties/Connection/SelectWhereIn.php index 209ab9e..193bbf6 100644 --- a/properties/Connection/SelectWhereIn.php +++ b/properties/Connection/SelectWhereIn.php @@ -45,7 +45,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectWhereInQuery.php b/properties/Connection/SelectWhereInQuery.php index 8ab1fcb..487d424 100644 --- a/properties/Connection/SelectWhereInQuery.php +++ b/properties/Connection/SelectWhereInQuery.php @@ -57,7 +57,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), Set::integers(), - Set\MutuallyExclusive::of( + Set::strings()->mutuallyExclusive( Set::strings() ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), @@ -65,7 +65,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 255), ), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/SelectWhereStartsWith.php b/properties/Connection/SelectWhereStartsWith.php index fef1012..9fb64df 100644 --- a/properties/Connection/SelectWhereStartsWith.php +++ b/properties/Connection/SelectWhereStartsWith.php @@ -54,7 +54,7 @@ public static function any(): Set ->madeOf(Set::strings()->chars()->ascii()) ->between(0, 125), Set::integers(), - )->toSet(); + ); } public function applicableTo(object $connection): bool diff --git a/properties/Connection/UpdateSpecificRow.php b/properties/Connection/UpdateSpecificRow.php index 28b1fbf..70f1011 100644 --- a/properties/Connection/UpdateSpecificRow.php +++ b/properties/Connection/UpdateSpecificRow.php @@ -42,7 +42,7 @@ public static function any(): Set static fn(...$args) => new self(...$args), Set::uuid(), Set::uuid(), - )->toSet(); + ); } public function applicableTo(object $connection): bool