diff --git a/proofs/connection/pdo.php b/proofs/connection/pdo.php index 673e2fb..c744172 100644 --- a/proofs/connection/pdo.php +++ b/proofs/connection/pdo.php @@ -51,8 +51,8 @@ static function($assert) use ($connection) { $table = Table\Name::of('test_lazy_load'); - $connection(DropTable::ifExists($table)); - $connection(CreateTable::named( + $_ = $connection(DropTable::ifExists($table)); + $_ = $connection(CreateTable::named( $table, Column::of( Column\Name::of('i'), @@ -61,7 +61,7 @@ static function($assert) use ($connection) { )); for ($i = 0; $i < 100_000; $i++) { - $connection(Insert::into( + $_ = $connection(Insert::into( $table, Row::of([ 'i' => $i, @@ -86,7 +86,7 @@ static function($assert) use ($connection) { ->inLessThan() ->megaBytes(3); - $connection(DropTable::named($table)); + $_ = $connection(DropTable::named($table)); }, ); @@ -96,7 +96,7 @@ static function($assert) use ($connection) { static function($assert) use ($connection, $dsn) { $table = Table\Name::of('test_charset'); - $connection(CreateTable::ifNotExists( + $_ = $connection(CreateTable::ifNotExists( $table, Column::of( Column\Name::of('str'), @@ -104,7 +104,7 @@ static function($assert) use ($connection, $dsn) { ), )); - $connection(Insert::into( + $_ = $connection(Insert::into( $table, Row::of([ 'str' => 'gelé', @@ -139,7 +139,7 @@ static function($assert) use ($connection, $dsn) { ), ); - $connection(DropTable::named($table)); + $_ = $connection(DropTable::named($table)); }, ); } @@ -148,7 +148,7 @@ static function($assert) use ($connection, $dsn) { "Select join({$driver->name})", static function($assert) use ($connection) { $table = Table\Name::of('test_left_join'); - $connection(CreateTable::ifNotExists( + $_ = $connection(CreateTable::ifNotExists( $table, Column::of( Column\Name::of('id'), @@ -163,14 +163,14 @@ static function($assert) use ($connection) { Column\Type::int()->nullable(), ), )); - $connection(Delete::from($table)); + $_ = $connection(Delete::from($table)); $insert = MultipleInsert::into( $table, Column\Name::of('id'), Column\Name::of('name'), Column\Name::of('parent'), ); - $connection($insert(Sequence::of( + $_ = $connection($insert(Sequence::of( Row::of([ 'id' => 1, 'name' => 'value_1', @@ -246,7 +246,7 @@ public function value(): int ->toList(), ); - $connection(DropTable::named($table)); + $_ = $connection(DropTable::named($table)); }, ); @@ -255,14 +255,14 @@ public function value(): int static function($assert) use ($connection) { $parent = Table\Name::of('test_cascade_delete_parent'); $child = Table\Name::of('test_cascade_delete_child'); - $connection(CreateTable::ifNotExists( + $_ = $connection(CreateTable::ifNotExists( $parent, Column::of( Column\Name::of('id'), Column\Type::int(), ), )->primaryKey(Column\Name::of('id'))); - $connection(CreateTable::ifNotExists( + $_ = $connection(CreateTable::ifNotExists( $child, Column::of( Column\Name::of('id'), @@ -275,9 +275,9 @@ static function($assert) use ($connection) { )->constraint( ForeignKey::of(Column\Name::of('parent'), $parent, Column\Name::of('id'))->onDeleteCascade(), )); - $connection(Delete::from($child)); - $connection(Delete::from($parent)); - $connection(Insert::into( + $_ = $connection(Delete::from($child)); + $_ = $connection(Delete::from($parent)); + $_ = $connection(Insert::into( $parent, Row::of([ 'id' => 1, @@ -288,7 +288,7 @@ static function($assert) use ($connection) { Column\Name::of('id'), Column\Name::of('parent'), ); - $connection($insert(Sequence::of( + $_ = $connection($insert(Sequence::of( Row::of([ 'id' => 1, 'parent' => 1, @@ -299,13 +299,13 @@ static function($assert) use ($connection) { ]), ))); - $connection(Delete::from($parent)); + $_ = $connection(Delete::from($parent)); $rows = $connection(Select::from($child)); $assert->same(0, $rows->size()); - $connection(DropTable::named($child)); - $connection(DropTable::named($parent)); + $_ = $connection(DropTable::named($child)); + $_ = $connection(DropTable::named($parent)); }, ); @@ -314,14 +314,14 @@ static function($assert) use ($connection) { static function($assert) use ($connection) { $parent = Table\Name::of('test_set_null_delete_parent'); $child = Table\Name::of('test_set_null_delete_child'); - $connection(CreateTable::ifNotExists( + $_ = $connection(CreateTable::ifNotExists( $parent, Column::of( Column\Name::of('id'), Column\Type::int(), ), )->primaryKey(Column\Name::of('id'))); - $connection(CreateTable::ifNotExists( + $_ = $connection(CreateTable::ifNotExists( $child, Column::of( Column\Name::of('id'), @@ -334,9 +334,9 @@ static function($assert) use ($connection) { )->constraint( ForeignKey::of(Column\Name::of('parent'), $parent, Column\Name::of('id'))->onDeleteSetNull(), )); - $connection(Delete::from($child)); - $connection(Delete::from($parent)); - $connection(Insert::into( + $_ = $connection(Delete::from($child)); + $_ = $connection(Delete::from($parent)); + $_ = $connection(Insert::into( $parent, Row::of([ 'id' => 1, @@ -347,7 +347,7 @@ static function($assert) use ($connection) { Column\Name::of('id'), Column\Name::of('parent'), ); - $connection($insert(Sequence::of( + $_ = $connection($insert(Sequence::of( Row::of([ 'id' => 1, 'parent' => 1, @@ -358,7 +358,7 @@ static function($assert) use ($connection) { ]), ))); - $connection(Delete::from($parent)); + $_ = $connection(Delete::from($parent)); $rows = $connection(Select::from($child)) ->map(static fn($row) => $row->toArray()) ->toList(); @@ -370,8 +370,8 @@ static function($assert) use ($connection) { ]) ->same($rows); - $connection(DropTable::named($child)); - $connection(DropTable::named($parent)); + $_ = $connection(DropTable::named($child)); + $_ = $connection(DropTable::named($parent)); }, ); @@ -397,14 +397,14 @@ static function($assert) use ($driver) { static function($assert) use ($connection) { $parent = Table\Name::of('test_join_delete_parent')->as('parent'); $child = Table\Name::of('test_join_delete_child')->as('child'); - $connection(CreateTable::ifNotExists( + $_ = $connection(CreateTable::ifNotExists( $child->name(), Column::of( Column\Name::of('id'), Column\Type::int(), ), )->primaryKey(Column\Name::of('id'))); - $connection( + $_ = $connection( CreateTable::ifNotExists( $parent->name(), Column::of( @@ -423,15 +423,15 @@ static function($assert) use ($connection) { Column\Name::of('id'), ), ); - $connection(Delete::from($parent->name())); - $connection(Delete::from($child->name())); - $connection(Insert::into( + $_ = $connection(Delete::from($parent->name())); + $_ = $connection(Delete::from($child->name())); + $_ = $connection(Insert::into( $child->name(), Row::of([ 'id' => 2, ]), )); - $connection(Insert::into( + $_ = $connection(Insert::into( $parent->name(), Row::of([ 'id' => 1, @@ -439,7 +439,7 @@ static function($assert) use ($connection) { ]), )); - $connection( + $_ = $connection( Delete::from($parent) ->join( Join::left($child)->on( @@ -460,8 +460,8 @@ static function($assert) use ($connection) { $rows = $connection(Select::from($parent)); $assert->same(0, $rows->size()); - $connection(DropTable::named($parent->name())); - $connection(DropTable::named($child->name())); + $_ = $connection(DropTable::named($parent->name())); + $_ = $connection(DropTable::named($child->name())); }, ); @@ -470,7 +470,7 @@ static function($assert) use ($connection) { given(Set::integers()->between(0, 1_000_000)), static function($assert, $int) use ($connection) { $table = Table\Name::of('test_unique'); - $connection(CreateTable::ifNotExists( + $_ = $connection(CreateTable::ifNotExists( $table, Column::of( Column\Name::of('id'), @@ -482,14 +482,14 @@ static function($assert, $int) use ($connection) { ), )->unique(Column\Name::of('id'), Column\Name::of('other'))); - $connection(Insert::into( + $_ = $connection(Insert::into( $table, Row::of([ 'id' => $int, 'other' => 'foo', ]), )); - $connection(Insert::into( + $_ = $connection(Insert::into( $table, Row::of([ 'id' => $int, @@ -505,7 +505,7 @@ static function($assert, $int) use ($connection) { ]), ))); - $connection(DropTable::named($table)); + $_ = $connection(DropTable::named($table)); }, ); diff --git a/properties/Connection.php b/properties/Connection.php index 62f5493..24f340d 100644 --- a/properties/Connection.php +++ b/properties/Connection.php @@ -83,15 +83,15 @@ public static function list(): array public static function seed(Concrete $connection): void { - $connection(DropTable::ifExists(Name::of('test'))); - $connection(DropTable::ifExists(Name::of('test_values'))); - $connection(CreateTable::named( + $_ = $connection(DropTable::ifExists(Name::of('test'))); + $_ = $connection(DropTable::ifExists(Name::of('test_values'))); + $_ = $connection(CreateTable::named( Name::of('test'), Column::of(Column\Name::of('id'), Column\Type::char(36)), Column::of(Column\Name::of('username'), Column\Type::varchar(255)), Column::of(Column\Name::of('registerNumber'), Column\Type::bigint()), )->primaryKey(Column\Name::of('id'))); - $connection(CreateTable::named( + $_ = $connection(CreateTable::named( Name::of('test_values'), Column::of(Column\Name::of('id'), Column\Type::char(36)), Column::of(Column\Name::of('value'), Column\Type::varchar(255)), diff --git a/properties/Connection/AQueryWithoutTheCorrectNumberOfParametersMustThrow.php b/properties/Connection/AQueryWithoutTheCorrectNumberOfParametersMustThrow.php index fe24f78..635ec0a 100644 --- a/properties/Connection/AQueryWithoutTheCorrectNumberOfParametersMustThrow.php +++ b/properties/Connection/AQueryWithoutTheCorrectNumberOfParametersMustThrow.php @@ -33,7 +33,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object { try { $query = SQL::of('INSERT INTO test VALUES (:uuid, :username, :registerNumber);'); - $connection($query); + $_ = $connection($query); $assert->fail('it should throw an exception'); } catch (QueryFailed $e) { $assert->same($query, $e->query()); diff --git a/properties/Connection/AllowToStartTwoQueriesInParallel.php b/properties/Connection/AllowToStartTwoQueriesInParallel.php index a415fec..2d5040d 100644 --- a/properties/Connection/AllowToStartTwoQueriesInParallel.php +++ b/properties/Connection/AllowToStartTwoQueriesInParallel.php @@ -53,7 +53,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object { // Insert at least one value to make sure the any() call will always // return true - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/AnInvalidQueryMustThrow.php b/properties/Connection/AnInvalidQueryMustThrow.php index 516adfa..cdc968e 100644 --- a/properties/Connection/AnInvalidQueryMustThrow.php +++ b/properties/Connection/AnInvalidQueryMustThrow.php @@ -33,7 +33,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object { try { $query = SQL::of('INSERT'); - $connection($query); + $_ = $connection($query); $assert->fail('it should throw an exception'); } catch (QueryFailed $e) { $assert->same($query, $e->query()); diff --git a/properties/Connection/CommittingAnUnstartedTransactionMustThrow.php b/properties/Connection/CommittingAnUnstartedTransactionMustThrow.php index bf9d16a..462568a 100644 --- a/properties/Connection/CommittingAnUnstartedTransactionMustThrow.php +++ b/properties/Connection/CommittingAnUnstartedTransactionMustThrow.php @@ -33,7 +33,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object { try { $query = Transaction::commit; - $connection($query); + $_ = $connection($query); $assert->fail('it should throw an exception'); } catch (QueryFailed $e) { $assert->same($query, $e->query()); diff --git a/properties/Connection/ContentInsertedAfterStartOfTransactionIsAccessible.php b/properties/Connection/ContentInsertedAfterStartOfTransactionIsAccessible.php index 3cc3067..db06a55 100644 --- a/properties/Connection/ContentInsertedAfterStartOfTransactionIsAccessible.php +++ b/properties/Connection/ContentInsertedAfterStartOfTransactionIsAccessible.php @@ -52,9 +52,9 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Transaction::start); + $_ = $connection(Transaction::start); - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, @@ -97,7 +97,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object ), ); - $connection(Transaction::commit); + $_ = $connection(Transaction::commit); return $connection; } diff --git a/properties/Connection/ContentIsAccessibleAfterCommit.php b/properties/Connection/ContentIsAccessibleAfterCommit.php index 1bc4d2c..f3c8c93 100644 --- a/properties/Connection/ContentIsAccessibleAfterCommit.php +++ b/properties/Connection/ContentIsAccessibleAfterCommit.php @@ -52,9 +52,9 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Transaction::start); + $_ = $connection(Transaction::start); - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, @@ -63,7 +63,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object ]), )); - $connection(Transaction::commit); + $_ = $connection(Transaction::commit); $rows = $connection(SQL::of("SELECT * FROM test WHERE id = '{$this->uuid}'")); diff --git a/properties/Connection/ContentIsNotAccessibleAfterRollback.php b/properties/Connection/ContentIsNotAccessibleAfterRollback.php index f6499ec..67a45f6 100644 --- a/properties/Connection/ContentIsNotAccessibleAfterRollback.php +++ b/properties/Connection/ContentIsNotAccessibleAfterRollback.php @@ -52,9 +52,9 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Transaction::start); + $_ = $connection(Transaction::start); - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, @@ -63,7 +63,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object ]), )); - $connection(Transaction::rollback); + $_ = $connection(Transaction::rollback); $rows = $connection(SQL::of("SELECT * FROM test WHERE id = '{$this->uuid}'")); diff --git a/properties/Connection/CreateTable.php b/properties/Connection/CreateTable.php index c4be730..6c23015 100644 --- a/properties/Connection/CreateTable.php +++ b/properties/Connection/CreateTable.php @@ -52,7 +52,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object $assert->same(0, $rows->size()); } finally { - $connection(Query\DropTable::ifExists($this->name)); + $_ = $connection(Query\DropTable::ifExists($this->name)); } return $connection; diff --git a/properties/Connection/CreateTableIfNotExists.php b/properties/Connection/CreateTableIfNotExists.php index 702b1a2..2942418 100644 --- a/properties/Connection/CreateTableIfNotExists.php +++ b/properties/Connection/CreateTableIfNotExists.php @@ -48,12 +48,12 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { try { - $connection(Query\CreateTable::named($this->name, ...$this->columns)); + $_ = $connection(Query\CreateTable::named($this->name, ...$this->columns)); $rows = $connection(Query\CreateTable::ifNotExists($this->name, ...$this->columns)); $assert->same(0, $rows->size()); } finally { - $connection(Query\DropTable::ifExists($this->name)); + $_ = $connection(Query\DropTable::ifExists($this->name)); } return $connection; diff --git a/properties/Connection/CreateTableWithForeignKey.php b/properties/Connection/CreateTableWithForeignKey.php index a6dcf5a..537adc1 100644 --- a/properties/Connection/CreateTableWithForeignKey.php +++ b/properties/Connection/CreateTableWithForeignKey.php @@ -75,8 +75,8 @@ public function ensureHeldBy(Assert $assert, object $connection): object $assert->same(0, $rows->size()); } finally { - $connection(Query\DropTable::ifExists($this->name2)); - $connection(Query\DropTable::ifExists($this->name1)); + $_ = $connection(Query\DropTable::ifExists($this->name2)); + $_ = $connection(Query\DropTable::ifExists($this->name1)); } return $connection; diff --git a/properties/Connection/CreateTableWithPrimaryKey.php b/properties/Connection/CreateTableWithPrimaryKey.php index 4a34e3c..821056f 100644 --- a/properties/Connection/CreateTableWithPrimaryKey.php +++ b/properties/Connection/CreateTableWithPrimaryKey.php @@ -60,7 +60,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object $assert->same(0, $rows->size()); } finally { - $connection(Query\DropTable::ifExists($this->name)); + $_ = $connection(Query\DropTable::ifExists($this->name)); } return $connection; diff --git a/properties/Connection/CreatingSameTableTwiceMustThrow.php b/properties/Connection/CreatingSameTableTwiceMustThrow.php index 1e5ead6..b92ce84 100644 --- a/properties/Connection/CreatingSameTableTwiceMustThrow.php +++ b/properties/Connection/CreatingSameTableTwiceMustThrow.php @@ -50,13 +50,13 @@ public function ensureHeldBy(Assert $assert, object $connection): object { try { $expected = Query\CreateTable::named($this->name, ...$this->columns); - $connection(Query\CreateTable::named($this->name, ...$this->columns)); - $connection($expected); + $_ = $connection(Query\CreateTable::named($this->name, ...$this->columns)); + $_ = $connection($expected); $assert->fail('it should throw'); } catch (QueryFailed $e) { $assert->same($expected, $e->query()); } finally { - $connection(Query\DropTable::ifExists($this->name)); + $_ = $connection(Query\DropTable::ifExists($this->name)); } return $connection; diff --git a/properties/Connection/Delete.php b/properties/Connection/Delete.php index 3aa09fa..41e3b58 100644 --- a/properties/Connection/Delete.php +++ b/properties/Connection/Delete.php @@ -41,7 +41,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { $select = SQL::of('SELECT * FROM test'); - $connection(Query\Insert::into( + $_ = $connection(Query\Insert::into( Table\Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/DeleteSpecificRow.php b/properties/Connection/DeleteSpecificRow.php index ef89ffa..e2ff795 100644 --- a/properties/Connection/DeleteSpecificRow.php +++ b/properties/Connection/DeleteSpecificRow.php @@ -58,7 +58,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object Column\Name::of('username'), Column\Name::of('registerNumber'), ); - $connection($insert(Sequence::of( + $_ = $connection($insert(Sequence::of( Row::of([ 'id' => $this->uuid1, 'username' => 'foo', diff --git a/properties/Connection/DeleteWithAlias.php b/properties/Connection/DeleteWithAlias.php index 69bbfdc..938e51a 100644 --- a/properties/Connection/DeleteWithAlias.php +++ b/properties/Connection/DeleteWithAlias.php @@ -41,7 +41,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { $select = SQL::of('SELECT * FROM test'); - $connection(Query\Insert::into( + $_ = $connection(Query\Insert::into( Table\Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/DroppingUnknownDatabaseMustThrow.php b/properties/Connection/DroppingUnknownDatabaseMustThrow.php index 0bc33a7..0c0fe9a 100644 --- a/properties/Connection/DroppingUnknownDatabaseMustThrow.php +++ b/properties/Connection/DroppingUnknownDatabaseMustThrow.php @@ -41,7 +41,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object { try { $query = Query\DropTable::named($this->name); - $connection($query); + $_ = $connection($query); $assert->fail('it should throw'); } catch (QueryFailed $e) { $assert->same($query, $e->query()); diff --git a/properties/Connection/MustThrowWhenValueDoesntFitTheSchema.php b/properties/Connection/MustThrowWhenValueDoesntFitTheSchema.php index 76548ef..9c60103 100644 --- a/properties/Connection/MustThrowWhenValueDoesntFitTheSchema.php +++ b/properties/Connection/MustThrowWhenValueDoesntFitTheSchema.php @@ -56,7 +56,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object ->with(Parameter::named('uuid', $this->uuid.$this->uuid)) // too long ->with(Parameter::named('username', $this->username)) ->with(Parameter::named('registerNumber', $this->number)); - $connection($query); + $_ = $connection($query); $assert->fail('it should throw an exception'); } catch (QueryFailed $e) { $assert->same($query, $e->query()); diff --git a/properties/Connection/ParameterTypesCanBeSpecified.php b/properties/Connection/ParameterTypesCanBeSpecified.php index 36d8833..299bf9f 100644 --- a/properties/Connection/ParameterTypesCanBeSpecified.php +++ b/properties/Connection/ParameterTypesCanBeSpecified.php @@ -54,7 +54,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object ->with(Parameter::of($this->uuid, Type::string)) ->with(Parameter::of($this->username, Type::string)) ->with(Parameter::of($this->number, Type::int)); - $connection($insert); + $_ = $connection($insert); $rows = $connection(SQL::of("SELECT * FROM test WHERE id = '{$this->uuid}'")); diff --git a/properties/Connection/ParametersCanBeBoundByIndex.php b/properties/Connection/ParametersCanBeBoundByIndex.php index 048ad5b..3c394a5 100644 --- a/properties/Connection/ParametersCanBeBoundByIndex.php +++ b/properties/Connection/ParametersCanBeBoundByIndex.php @@ -53,7 +53,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object ->with(Parameter::of($this->uuid)) ->with(Parameter::of($this->username)) ->with(Parameter::of($this->number)); - $connection($insert); + $_ = $connection($insert); $rows = $connection(SQL::of("SELECT * FROM test WHERE id = '{$this->uuid}'")); diff --git a/properties/Connection/ParametersCanBeBoundByName.php b/properties/Connection/ParametersCanBeBoundByName.php index 688e53d..c156cd3 100644 --- a/properties/Connection/ParametersCanBeBoundByName.php +++ b/properties/Connection/ParametersCanBeBoundByName.php @@ -53,7 +53,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object ->with(Parameter::named('uuid', $this->uuid)) ->with(Parameter::named('username', $this->username)) ->with(Parameter::named('registerNumber', $this->number)); - $connection($insert); + $_ = $connection($insert); $rows = $connection(SQL::of("SELECT * FROM test WHERE id = '{$this->uuid}'")); diff --git a/properties/Connection/RollbackingAnUnstartedTransactionMustThrow.php b/properties/Connection/RollbackingAnUnstartedTransactionMustThrow.php index f5111b7..3505533 100644 --- a/properties/Connection/RollbackingAnUnstartedTransactionMustThrow.php +++ b/properties/Connection/RollbackingAnUnstartedTransactionMustThrow.php @@ -33,7 +33,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object { try { $query = Transaction::rollback; - $connection($query); + $_ = $connection($query); $assert->fail('it should throw an exception'); } catch (QueryFailed $e) { $assert->same($query, $e->query()); diff --git a/properties/Connection/SelectAliasedColumns.php b/properties/Connection/SelectAliasedColumns.php index 430dba8..739cb2e 100644 --- a/properties/Connection/SelectAliasedColumns.php +++ b/properties/Connection/SelectAliasedColumns.php @@ -52,7 +52,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectColumns.php b/properties/Connection/SelectColumns.php index 159beb1..33df2a8 100644 --- a/properties/Connection/SelectColumns.php +++ b/properties/Connection/SelectColumns.php @@ -52,7 +52,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectCount.php b/properties/Connection/SelectCount.php index 282a7c7..cd84a05 100644 --- a/properties/Connection/SelectCount.php +++ b/properties/Connection/SelectCount.php @@ -55,7 +55,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectEverything.php b/properties/Connection/SelectEverything.php index 3273b5f..e3f04ff 100644 --- a/properties/Connection/SelectEverything.php +++ b/properties/Connection/SelectEverything.php @@ -51,7 +51,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectLimit.php b/properties/Connection/SelectLimit.php index c17b7ff..f78f2be 100644 --- a/properties/Connection/SelectLimit.php +++ b/properties/Connection/SelectLimit.php @@ -58,7 +58,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectOffset.php b/properties/Connection/SelectOffset.php index 493ae42..97ab709 100644 --- a/properties/Connection/SelectOffset.php +++ b/properties/Connection/SelectOffset.php @@ -58,7 +58,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectOrder.php b/properties/Connection/SelectOrder.php index 026c29f..69b9d4d 100644 --- a/properties/Connection/SelectOrder.php +++ b/properties/Connection/SelectOrder.php @@ -71,7 +71,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object Column\Name::of('username'), Column\Name::of('registerNumber'), ); - $connection($insert(Sequence::of( + $_ = $connection($insert(Sequence::of( Row::of([ 'id' => $this->uuid1, 'username' => 'a'.$this->username, diff --git a/properties/Connection/SelectValues.php b/properties/Connection/SelectValues.php index 3d79902..636cdcd 100644 --- a/properties/Connection/SelectValues.php +++ b/properties/Connection/SelectValues.php @@ -63,7 +63,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectWhere.php b/properties/Connection/SelectWhere.php index 663d2b9..f9e4f0a 100644 --- a/properties/Connection/SelectWhere.php +++ b/properties/Connection/SelectWhere.php @@ -55,7 +55,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectWhereContains.php b/properties/Connection/SelectWhereContains.php index ce6f0ad..2a91fd7 100644 --- a/properties/Connection/SelectWhereContains.php +++ b/properties/Connection/SelectWhereContains.php @@ -70,7 +70,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectWhereEndsWith.php b/properties/Connection/SelectWhereEndsWith.php index 3eff0f6..51e5828 100644 --- a/properties/Connection/SelectWhereEndsWith.php +++ b/properties/Connection/SelectWhereEndsWith.php @@ -64,7 +64,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectWhereIn.php b/properties/Connection/SelectWhereIn.php index c5d9cb8..209ab9e 100644 --- a/properties/Connection/SelectWhereIn.php +++ b/properties/Connection/SelectWhereIn.php @@ -55,7 +55,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/SelectWhereInQuery.php b/properties/Connection/SelectWhereInQuery.php index 1b76e5c..8ab1fcb 100644 --- a/properties/Connection/SelectWhereInQuery.php +++ b/properties/Connection/SelectWhereInQuery.php @@ -82,13 +82,13 @@ public function ensureHeldBy(Assert $assert, object $connection): object ->with(Parameter::of($this->uuid2)) ->with(Parameter::of($this->username)) ->with(Parameter::of($this->number)); - $connection($insert); + $_ = $connection($insert); $insert = SQL::of('INSERT INTO test_values VALUES (?, ?), (?, ?);') ->with(Parameter::of($this->uuid1)) ->with(Parameter::of($this->value1)) ->with(Parameter::of($this->uuid1)) ->with(Parameter::of($this->value2)); - $connection($insert); + $_ = $connection($insert); $select = Select::from(Name::of('test')); $select = $select->where(Comparator\Property::of( diff --git a/properties/Connection/SelectWhereStartsWith.php b/properties/Connection/SelectWhereStartsWith.php index 64d4724..fef1012 100644 --- a/properties/Connection/SelectWhereStartsWith.php +++ b/properties/Connection/SelectWhereStartsWith.php @@ -64,7 +64,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { - $connection(Insert::into( + $_ = $connection(Insert::into( Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/Update.php b/properties/Connection/Update.php index 3acf9cf..9feb50e 100644 --- a/properties/Connection/Update.php +++ b/properties/Connection/Update.php @@ -41,7 +41,7 @@ public function applicableTo(object $connection): bool public function ensureHeldBy(Assert $assert, object $connection): object { $select = SQL::of("SELECT * FROM test WHERE id = '{$this->uuid}'"); - $connection(Query\Insert::into( + $_ = $connection(Query\Insert::into( Table\Name::of('test'), Row::of([ 'id' => $this->uuid, diff --git a/properties/Connection/UpdateSpecificRow.php b/properties/Connection/UpdateSpecificRow.php index 00f1c87..28b1fbf 100644 --- a/properties/Connection/UpdateSpecificRow.php +++ b/properties/Connection/UpdateSpecificRow.php @@ -58,7 +58,7 @@ public function ensureHeldBy(Assert $assert, object $connection): object Column\Name::of('username'), Column\Name::of('registerNumber'), ); - $connection($insert(Sequence::of( + $_ = $connection($insert(Sequence::of( Row::of([ 'id' => $this->uuid1, 'username' => 'foo', diff --git a/psalm.xml b/psalm.xml index 5d768ff..a270b9b 100644 --- a/psalm.xml +++ b/psalm.xml @@ -14,4 +14,7 @@ + + + diff --git a/src/Connection.php b/src/Connection.php index d777920..1195b42 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -28,6 +28,7 @@ private function __construct( * * @return Sequence */ + #[\NoDiscard] public function __invoke(Query|Query\Builder $query): Sequence { return ($this->implementation)($query);