From c765de937027b6bfc26c9cf8b4cc66535f2a8bb7 Mon Sep 17 00:00:00 2001 From: Miguel Muscat Date: Wed, 24 Jan 2024 16:29:31 +0100 Subject: [PATCH] refactor: remove psalm immutability --- inc/functions.php | 11 ----------- src/DataSource.php | 3 --- src/DatabaseAdapter.php | 6 +----- src/Expression/BaseExpr.php | 1 - src/Expression/BetweenExpr.php | 1 - src/Expression/BinaryExpr.php | 1 - src/Expression/ColumnTerm.php | 6 +----- src/Expression/ExprInterface.php | 1 - src/Expression/FnExpr.php | 6 +----- src/Expression/Term.php | 8 +------- src/Expression/UnaryExpr.php | 1 - src/Join.php | 1 - src/Order.php | 1 - src/Query.php | 2 -- src/Query/CompoundQuery.php | 2 -- src/Query/CreateIndexQuery.php | 6 +----- src/Query/CreateTableQuery.php | 8 +------- src/Query/DeleteQuery.php | 7 +------ src/Query/DropTableQuery.php | 6 +----- src/Query/InsertQuery.php | 10 +--------- src/Query/SelectQuery.php | 10 +--------- src/Query/Traits/HasAssignmentTrait.php | 3 --- src/Query/Traits/HasGroupByTrait.php | 3 --- src/Query/Traits/HasHavingTrait.php | 3 --- src/Query/Traits/HasJoinsTrait.php | 7 +------ src/Query/Traits/HasLimitTrait.php | 3 --- src/Query/Traits/HasOffsetTrait.php | 3 --- src/Query/Traits/HasOrderTrait.php | 3 --- src/Query/Traits/HasWhereTrait.php | 3 --- src/Query/UpdateQuery.php | 7 +------ src/Schema.php | 1 - src/Schema/Column.php | 1 - src/Schema/ForeignKey.php | 1 - src/Schema/Index.php | 1 - src/Schema/Key.php | 1 - src/Schema/PrimaryKey.php | 1 - src/Schema/UniqueKey.php | 1 - src/Table.php | 1 - src/TableRef.php | 6 +----- 39 files changed, 13 insertions(+), 134 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 901d24d..e6ca2b0 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -12,7 +12,6 @@ /** * Creates a new column term. * - * @psalm-pure * @param string|ColumnTerm|Table|TableRef $arg1 The column name or term if only 1 arg is given. Otherwise, the table * name, instance, or reference. * @param string|null $arg2 The column name if the 1st arg is a table name, instance, or reference. @@ -44,7 +43,6 @@ function col($arg1, ?string $arg2 = null): ColumnTerm /** * Creates a data source for a table. This is an alias for the {@link TableRef} constructor. * - * @psalm-pure * @param string $name The table name. * @param string|null $alias Optional alias. * @return TableRef The created data source. @@ -84,7 +82,6 @@ function all($source): ColumnTerm * * Note that this creates a join with an empty table name. Be sure to call {@link Join::with()} to set the table name. * - * @psalm-pure * @param string $type The join type. * @param DataSource|null $with The data source to join with. * @param ExprInterface|null $on The condition to join on. @@ -98,7 +95,6 @@ function using(string $type, ?DataSource $with = null, ?ExprInterface $on = null /** * Creates an ascending order instance for a column. * - * @psalm-pure * @param string|ColumnTerm $column The column name or term. * @return Order|Group The order instance. */ @@ -110,7 +106,6 @@ function asc($column): Order /** * Creates a descending order instance for a column. * - * @psalm-pure * @param string|ColumnTerm $column The column name or term. * @return Order|Group The order instance. */ @@ -126,7 +121,6 @@ function desc($column): Order * three arguments, this function creates a binary expression using the first argument as the left-hand side, the second * argument as the operator, and the third argument as the right-hand side. * - * @psalm-pure * @param mixed $value The value to create the term from. * @param string|null $operator Optional operator to create a binary expression. * @param mixed|null $value2 Optional second value to create a binary expression. @@ -148,7 +142,6 @@ function expr($value, ?string $operator = null, $value2 = null): ExprInterface * Creates a boolean NOT unary expression. This is an alias for calling the {@link ExprInterface::not()} method on the * passed argument. * - * @psalm-pure * @param ExprInterface $expr The expression to negate. * @return ExprInterface The created expression. */ @@ -161,7 +154,6 @@ function not(ExprInterface $expr): ExprInterface * Creates a number negation unary expression. This is an alias for calling the {@link ExprInterface::not()} method on * the passed argument. * - * @psalm-pure * @param ExprInterface $expr The expression to negate. * @return ExprInterface The created expression. */ @@ -173,7 +165,6 @@ function neg(ExprInterface $expr): ExprInterface /** * Creates a distinct column term. This is an alias for calling the {@link ColumnTerm::distinct()} method on the column. * - * @psalm-pure * @param ColumnTerm $col The column term. * @return ColumnTerm The distinct column term. */ @@ -185,7 +176,6 @@ function distinct(ColumnTerm $col): ColumnTerm /** * ORs a list of expressions into a single expression. * - * @psalm-pure * @param iterable $exprs The expressions to OR. * @return ExprInterface|null The created expression. */ @@ -209,7 +199,6 @@ function orAll(iterable $exprs): ?ExprInterface /** * ANDs a list of expressions into a single expression. * - * @psalm-pure * @param iterable $exprs The expressions to AND. * @return ExprInterface|null The created expression. */ diff --git a/src/DataSource.php b/src/DataSource.php index 1feeb0c..c5db447 100644 --- a/src/DataSource.php +++ b/src/DataSource.php @@ -12,7 +12,6 @@ interface DataSource /** * Creates a copy with an alias. * - * @psalm-mutation-free * @param string|null $alias The string alias or null for no alias. * @return static The new instance. */ @@ -21,7 +20,6 @@ public function as(?string $alias): self; /** * Retrieves the data source's alias, if it has one. * - * @psalm-mutation-free * @return string|null The string alias or null if the data source has no alias. */ public function getAlias(): ?string; @@ -29,7 +27,6 @@ public function getAlias(): ?string; /** * Compiles the source into an SQL fragment. * - * @psalm-mutation-free * @return string The compiled SQL fragment. * @throws SqlCompileException If an error occurred while compiling. */ diff --git a/src/DatabaseAdapter.php b/src/DatabaseAdapter.php index 2a48594..4f50827 100644 --- a/src/DatabaseAdapter.php +++ b/src/DatabaseAdapter.php @@ -4,11 +4,7 @@ use RebelCode\Atlas\Exception\DatabaseException; -/** - * An adapter for a database connection that allows queries created by Atlas to be executed. - * - * @psalm-immutable - */ +/** An adapter for a database connection that allows queries created by Atlas to be executed. */ interface DatabaseAdapter { /** diff --git a/src/Expression/BaseExpr.php b/src/Expression/BaseExpr.php index f253b96..9e8e659 100644 --- a/src/Expression/BaseExpr.php +++ b/src/Expression/BaseExpr.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Expression; -/** @psalm-immutable */ abstract class BaseExpr implements ExprInterface { protected ?string $alias = null; diff --git a/src/Expression/BetweenExpr.php b/src/Expression/BetweenExpr.php index 077e337..b503b1f 100644 --- a/src/Expression/BetweenExpr.php +++ b/src/Expression/BetweenExpr.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Expression; -/** @psalm-immutable */ class BetweenExpr extends BaseExpr { const BETWEEN = 'BETWEEN'; diff --git a/src/Expression/BinaryExpr.php b/src/Expression/BinaryExpr.php index ca162a9..537b67a 100644 --- a/src/Expression/BinaryExpr.php +++ b/src/Expression/BinaryExpr.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Expression; -/** @psalm-immutable */ class BinaryExpr extends BaseExpr { const EQ = '='; diff --git a/src/Expression/ColumnTerm.php b/src/Expression/ColumnTerm.php index 040004a..f42a024 100644 --- a/src/Expression/ColumnTerm.php +++ b/src/Expression/ColumnTerm.php @@ -2,11 +2,7 @@ namespace RebelCode\Atlas\Expression; -/** - * An expression that represents a column name. - * - * @psalm-immutable - */ +/** An expression that represents a column name. */ class ColumnTerm extends BaseExpr { protected ?string $table; diff --git a/src/Expression/ExprInterface.php b/src/Expression/ExprInterface.php index 351b3c3..9e7cdfa 100644 --- a/src/Expression/ExprInterface.php +++ b/src/Expression/ExprInterface.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Expression; -/** @psalm-immutable */ interface ExprInterface { /** diff --git a/src/Expression/FnExpr.php b/src/Expression/FnExpr.php index d1b459b..da596de 100644 --- a/src/Expression/FnExpr.php +++ b/src/Expression/FnExpr.php @@ -2,11 +2,7 @@ namespace RebelCode\Atlas\Expression; -/** - * Represents a SQL function expression. - * - * @psalm-immutable - */ +/** Represents a SQL function expression. */ class FnExpr extends BaseExpr { protected string $name; diff --git a/src/Expression/Term.php b/src/Expression/Term.php index d92805d..54c997e 100644 --- a/src/Expression/Term.php +++ b/src/Expression/Term.php @@ -5,7 +5,6 @@ use InvalidArgumentException; use Traversable; -/** @psalm-immutable */ class Term extends BaseExpr { public const NUMBER = 0; @@ -77,8 +76,6 @@ protected function toBaseString(): string /** * Creates a term from a value, automatically detecting the type. * - * @psalm-mutation-free - * * @param mixed $value * @return ExprInterface */ @@ -103,10 +100,7 @@ public static function create($value): ExprInterface return new self($type, $value); } - /** - * @psalm-mutation-free - * @psalm-return Term::* - */ + /** @psalm-return Term::* */ public static function detectType($value): int { $type = gettype($value); diff --git a/src/Expression/UnaryExpr.php b/src/Expression/UnaryExpr.php index 82f139d..7719d98 100644 --- a/src/Expression/UnaryExpr.php +++ b/src/Expression/UnaryExpr.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Expression; -/** @psalm-immutable */ class UnaryExpr extends BaseExpr { public const NOT = '!'; diff --git a/src/Join.php b/src/Join.php index 98fe4b9..e0ad351 100644 --- a/src/Join.php +++ b/src/Join.php @@ -4,7 +4,6 @@ use RebelCode\Atlas\Expression\ExprInterface; -/** @psalm-immutable */ class Join { const INNER = 'INNER'; diff --git a/src/Order.php b/src/Order.php index 8d6db8d..676692e 100644 --- a/src/Order.php +++ b/src/Order.php @@ -4,7 +4,6 @@ use RebelCode\Atlas\Expression\ColumnTerm; -/** @psalm-immutable */ class Order { public const ASC = 'ASC'; diff --git a/src/Query.php b/src/Query.php index 53cbfb1..540c794 100644 --- a/src/Query.php +++ b/src/Query.php @@ -6,7 +6,6 @@ use RebelCode\Atlas\Exception\DatabaseException; use RebelCode\Atlas\Exception\QuerySqlException; -/** @psalm-immutable */ abstract class Query { protected ?DatabaseAdapter $adapter; @@ -39,7 +38,6 @@ protected function getAdapter(): DatabaseAdapter /** * Compiles the query into an SQL string. * - * @psalm-mutation-free * @return string The compiled SQL string. * @throws QuerySqlException If an error occurred while compiling the SQL. */ diff --git a/src/Query/CompoundQuery.php b/src/Query/CompoundQuery.php index d947a41..7f45bab 100644 --- a/src/Query/CompoundQuery.php +++ b/src/Query/CompoundQuery.php @@ -9,8 +9,6 @@ * * This is intended to allow multiple queries to be executed in a single call to the database adapter. Rendering the * queries to SQL will concatenate the SQL of each query and a semicolon after each query. - * - * @psalm-immutable */ class CompoundQuery extends Query { diff --git a/src/Query/CreateIndexQuery.php b/src/Query/CreateIndexQuery.php index 1b70d75..0c15d74 100644 --- a/src/Query/CreateIndexQuery.php +++ b/src/Query/CreateIndexQuery.php @@ -10,7 +10,6 @@ use RebelCode\Atlas\Schema\Index; use Throwable; -/** @psalm-immutable */ class CreateIndexQuery extends Query { protected string $table; @@ -37,10 +36,7 @@ public function __construct( $this->index = $index; } - /** - * @inheritDoc - * @psalm-mutation-free - */ + /** @inheritDoc */ public function toSql(): string { try { diff --git a/src/Query/CreateTableQuery.php b/src/Query/CreateTableQuery.php index 7fc4898..27b8cf8 100644 --- a/src/Query/CreateTableQuery.php +++ b/src/Query/CreateTableQuery.php @@ -10,7 +10,6 @@ use Throwable; use UnexpectedValueException; -/** @psalm-immutable */ class CreateTableQuery extends Query { protected string $name; @@ -41,10 +40,7 @@ public function __construct( $this->collate = $collate; } - /** - * @inheritDoc - * @psalm-mutation-free - */ + /** @inheritDoc */ public function toSql(): string { try { @@ -75,8 +71,6 @@ public function toSql(): string /** * Compiles the schema for a table. * - * @psalm-mutation-free - * * @param Schema $schema The table schema. * @return string */ diff --git a/src/Query/DeleteQuery.php b/src/Query/DeleteQuery.php index 8a319a5..40abc43 100644 --- a/src/Query/DeleteQuery.php +++ b/src/Query/DeleteQuery.php @@ -10,7 +10,6 @@ use RebelCode\Atlas\Query; use Throwable; -/** @psalm-immutable */ class DeleteQuery extends Query { use Query\Traits\HasWhereTrait; @@ -45,7 +44,6 @@ public function __construct( /** * Creates a copy with a different FROM clause. * - * @psalm-mutation-free * @param string $from The table name. * @return static The new instance. */ @@ -56,10 +54,7 @@ public function from(string $from): self return $clone; } - /** - * @inheritDoc - * @psalm-mutation-free - */ + /** @inheritDoc */ public function toSql(): string { try { diff --git a/src/Query/DropTableQuery.php b/src/Query/DropTableQuery.php index 76e4ecb..9def937 100644 --- a/src/Query/DropTableQuery.php +++ b/src/Query/DropTableQuery.php @@ -8,7 +8,6 @@ use RebelCode\Atlas\Query; use Throwable; -/** @psalm-immutable */ class DropTableQuery extends Query { protected string $table; @@ -35,10 +34,7 @@ public function __construct( $this->cascade = $cascade; } - /** - * @inheritDoc - * @psalm-mutation-free - */ + /** @inheritDoc */ public function toSql(): string { try { diff --git a/src/Query/InsertQuery.php b/src/Query/InsertQuery.php index 8ad47a6..ae802f6 100644 --- a/src/Query/InsertQuery.php +++ b/src/Query/InsertQuery.php @@ -9,7 +9,6 @@ use RebelCode\Atlas\Query; use Throwable; -/** @psalm-immutable */ class InsertQuery extends Query { use Query\Traits\HasAssignmentTrait { @@ -48,7 +47,6 @@ public function __construct( /** * Creates a copy with a new table to insert into. * - * @psalm-mutation-free * @param string $table The table to insert into. * @return self The new instance. */ @@ -62,7 +60,6 @@ public function into(string $table): self /** * Creates a copy with new columns to insert into. * - * @psalm-mutation-free * @param string[] $columns The columns to insert into. * @return self The new instance. */ @@ -76,7 +73,6 @@ public function columns(array $columns): self /** * Creates a copy with new values to insert. * - * @psalm-mutation-free * @param array[] $values The values to insert. * @return self The new instance. */ @@ -87,10 +83,7 @@ public function values(array $values): self return $new; } - /** - * @inheritDoc - * @psalm-mutation-free - */ + /** @inheritDoc */ public function toSql(): string { try { @@ -121,7 +114,6 @@ public function toSql(): string /** * Compiles the VALUES fragment of the INSERT query. * - * @psalm-mutation-free * @return string */ protected function compileInsertValues(): string diff --git a/src/Query/SelectQuery.php b/src/Query/SelectQuery.php index dbd40a3..d2cceef 100644 --- a/src/Query/SelectQuery.php +++ b/src/Query/SelectQuery.php @@ -12,7 +12,6 @@ use RebelCode\Atlas\Query; use Throwable; -/** @psalm-immutable */ class SelectQuery extends Query implements DataSource { use Query\Traits\HasJoinsTrait; @@ -59,7 +58,6 @@ public function __construct( /** * Creates a copy with a different FROM clause. * - * @psalm-immutable * @param DataSource $source The source for the FROM clause. * @return static The new instance. */ @@ -73,7 +71,6 @@ public function from(DataSource $source): self /** * Creates a copy with a different column selection. * - * @psalm-immutable * @param array $columns The new column selection. * @return static The new instance. */ @@ -87,7 +84,6 @@ public function columns(array $columns): self /** * Creates a copy with a new selection offset, based on the current limit and the given page number. * - * @psalm-immutable * @param int $pageNum The page number, starting from 1. * @param int|null $pageSize The page size (limit). If null, the limit and offset are removed from the query. * @return SelectQuery @@ -117,10 +113,7 @@ public function getAlias(): ?string return $this->alias; } - /** - * @inheritDoc - * @psalm-mutation-free - */ + /** @inheritDoc */ public function toSql(): string { try { @@ -153,7 +146,6 @@ public function toSql(): string /** * Compiles the list of columns. * - * @psalm-mutation-free * @return string */ protected function compileColumnList(): string diff --git a/src/Query/Traits/HasAssignmentTrait.php b/src/Query/Traits/HasAssignmentTrait.php index 7b371e9..ea9372c 100644 --- a/src/Query/Traits/HasAssignmentTrait.php +++ b/src/Query/Traits/HasAssignmentTrait.php @@ -5,7 +5,6 @@ use RebelCode\Atlas\Expression\ExprInterface; use RebelCode\Atlas\Expression\Term; -/** @psalm-immutable */ trait HasAssignmentTrait { /** @var array */ @@ -14,7 +13,6 @@ trait HasAssignmentTrait /** * Creates a copy with a different assign list. * - * @psalm-immutable * @param array $assign An assoc array that maps column names to the update values. * @return static The new instance. */ @@ -28,7 +26,6 @@ public function assign(array $assign): self /** * Compiles an assignment list. Used by "UPDATE" and "INSERT ... ON DUPLICATE KEY UPDATE" queries. * - * @psalm-mutation-free * @param string $prefix The prefix for the compiled fragment. Typically, either SET or UPDATE. * @return string */ diff --git a/src/Query/Traits/HasGroupByTrait.php b/src/Query/Traits/HasGroupByTrait.php index 1b61b0a..9538ff9 100644 --- a/src/Query/Traits/HasGroupByTrait.php +++ b/src/Query/Traits/HasGroupByTrait.php @@ -5,7 +5,6 @@ use InvalidArgumentException; use RebelCode\Atlas\Group; -/** @psalm-immutable */ trait HasGroupByTrait { /** @var Group[] */ @@ -14,7 +13,6 @@ trait HasGroupByTrait /** * Creates a copy with a new GROUP BY clause. * - * @psalm-immutable * @param Group[] $groups An array of {@link Group} instances. * @return static The new instance. */ @@ -28,7 +26,6 @@ public function groupBy(array $groups): self /** * Compiles the GROUP BY fragment of an SQL query. * - * @psalm-mutation-free * @return string */ protected function compileGroupBy(): string diff --git a/src/Query/Traits/HasHavingTrait.php b/src/Query/Traits/HasHavingTrait.php index 8f69184..8a32b98 100644 --- a/src/Query/Traits/HasHavingTrait.php +++ b/src/Query/Traits/HasHavingTrait.php @@ -4,7 +4,6 @@ use RebelCode\Atlas\Expression\ExprInterface; -/** @psalm-immutable */ trait HasHavingTrait { protected ?ExprInterface $having = null; @@ -12,7 +11,6 @@ trait HasHavingTrait /** * Creates a copy with a new HAVING condition. * - * @psalm-immutable * @param ExprInterface|null $having The new HAVING condition. * @return static The new instance. */ @@ -26,7 +24,6 @@ public function having(?ExprInterface $expr): self /** * Compiles the HAVING fragment of an SQL query. * - * @psalm-mutation-free * @return string */ protected function compileHaving(): string diff --git a/src/Query/Traits/HasJoinsTrait.php b/src/Query/Traits/HasJoinsTrait.php index e9c649d..f23cde5 100644 --- a/src/Query/Traits/HasJoinsTrait.php +++ b/src/Query/Traits/HasJoinsTrait.php @@ -4,7 +4,6 @@ use RebelCode\Atlas\Join; -/** @psalm-immutable */ trait HasJoinsTrait { /** @var Join[] */ @@ -23,11 +22,7 @@ public function join(array $joins): self return $new; } - /** - * Compiles the JOIN clauses into an SQL fragment. - * - * @psalm-mutation-free - */ + /** Compiles the JOIN clauses into an SQL fragment. */ protected function compileJoins(): string { if (empty($this->joins)) { diff --git a/src/Query/Traits/HasLimitTrait.php b/src/Query/Traits/HasLimitTrait.php index 2f19658..934bb26 100644 --- a/src/Query/Traits/HasLimitTrait.php +++ b/src/Query/Traits/HasLimitTrait.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Query\Traits; -/** @psalm-immutable */ trait HasLimitTrait { protected ?int $limit = null; @@ -10,7 +9,6 @@ trait HasLimitTrait /** * Creates a copy with a new limit. * - * @psalm-immutable * @param int|null $limit The limit. * @return static The new instance. */ @@ -24,7 +22,6 @@ public function limit(?int $limit): self /** * Compiles the LIMIT fragment of an SQL query. * - * @psalm-mutation-free * @return string */ protected function compileLimit(): string diff --git a/src/Query/Traits/HasOffsetTrait.php b/src/Query/Traits/HasOffsetTrait.php index c7d69a5..a430550 100644 --- a/src/Query/Traits/HasOffsetTrait.php +++ b/src/Query/Traits/HasOffsetTrait.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Query\Traits; -/** @psalm-immutable */ trait HasOffsetTrait { protected ?int $offset = null; @@ -10,7 +9,6 @@ trait HasOffsetTrait /** * Creates a copy with a new selection offset. * - * @psalm-immutable * @param int|null $offset The new selection offset, or null or zero for no offset. * @return static The new instance. */ @@ -24,7 +22,6 @@ public function offset(?int $offset): self /** * Compiles the OFFSET fragment of an SQL query. * - * @psalm-mutation-free * @return string */ protected function compileOffset(): string diff --git a/src/Query/Traits/HasOrderTrait.php b/src/Query/Traits/HasOrderTrait.php index a2be5a4..4891ecb 100644 --- a/src/Query/Traits/HasOrderTrait.php +++ b/src/Query/Traits/HasOrderTrait.php @@ -4,7 +4,6 @@ use RebelCode\Atlas\Order; -/** @psalm-immutable */ trait HasOrderTrait { /** @var Order[] */ @@ -13,7 +12,6 @@ trait HasOrderTrait /** * Creates a copy with new ordering. * - * @psalm-immutable * @param Order[] $order A list of {@link Order} instances. * @return static The new instance. */ @@ -27,7 +25,6 @@ public function orderBy(array $order): self /** * Compiles the ORDER BY fragment of an SQL query. * - * @psalm-mutation-free * @return string */ protected function compileOrder(): string diff --git a/src/Query/Traits/HasWhereTrait.php b/src/Query/Traits/HasWhereTrait.php index b0e16ce..b83a5df 100644 --- a/src/Query/Traits/HasWhereTrait.php +++ b/src/Query/Traits/HasWhereTrait.php @@ -4,7 +4,6 @@ use RebelCode\Atlas\Expression\ExprInterface; -/** @psalm-immutable */ trait HasWhereTrait { protected ?ExprInterface $where = null; @@ -12,7 +11,6 @@ trait HasWhereTrait /** * Creates a copy with a new WHERE condition. * - * @psalm-immutable * @param ExprInterface|null $where The new WHERE condition, or null for no condition. * @return static The new instance. */ @@ -26,7 +24,6 @@ public function where(?ExprInterface $where): self /** * Compiles the WHERE fragment of an SQL query. * - * @psalm-mutation-free * @return string */ protected function compileWhere(): string diff --git a/src/Query/UpdateQuery.php b/src/Query/UpdateQuery.php index baf7068..097a286 100644 --- a/src/Query/UpdateQuery.php +++ b/src/Query/UpdateQuery.php @@ -10,7 +10,6 @@ use RebelCode\Atlas\Query; use Throwable; -/** @psalm-immutable */ class UpdateQuery extends Query { use Query\Traits\HasWhereTrait; @@ -50,7 +49,6 @@ public function __construct( /** * Creates a copy with a different table. * - * @psalm-immutable * @param string $table The table to update. * @return static The new instance. */ @@ -61,10 +59,7 @@ public function table(string $table): self return $new; } - /** - * @inheritDoc - * @psalm-mutation-free - */ + /** @inheritDoc */ public function toSql(): string { try { diff --git a/src/Schema.php b/src/Schema.php index f65179a..c19b3a7 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -6,7 +6,6 @@ use RebelCode\Atlas\Schema\Index; use RebelCode\Atlas\Schema\Key; -/** @psalm-immutable */ class Schema { /** @var array */ diff --git a/src/Schema/Column.php b/src/Schema/Column.php index a2cc7e1..a52147c 100644 --- a/src/Schema/Column.php +++ b/src/Schema/Column.php @@ -5,7 +5,6 @@ use RebelCode\Atlas\Expression\ExprInterface; use RebelCode\Atlas\Expression\Term; -/** @psalm-immutable */ class Column { protected string $type; diff --git a/src/Schema/ForeignKey.php b/src/Schema/ForeignKey.php index ba21184..e472177 100644 --- a/src/Schema/ForeignKey.php +++ b/src/Schema/ForeignKey.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Schema; -/** @psalm-immutable */ class ForeignKey extends Key { public const SET_NULL = 'SET NULL'; diff --git a/src/Schema/Index.php b/src/Schema/Index.php index 6709d76..d3eceba 100644 --- a/src/Schema/Index.php +++ b/src/Schema/Index.php @@ -4,7 +4,6 @@ use RebelCode\Atlas\Order; -/** @psalm-immutable */ class Index { protected bool $isUnique; diff --git a/src/Schema/Key.php b/src/Schema/Key.php index a383801..ef315ba 100644 --- a/src/Schema/Key.php +++ b/src/Schema/Key.php @@ -7,7 +7,6 @@ abstract class Key /** * Converts the key into an SQL fragment string. * - * @psalm-mutation-free * @param string $name The name of the key. * @return string The SQL fragment string. */ diff --git a/src/Schema/PrimaryKey.php b/src/Schema/PrimaryKey.php index 53e929e..e2c71b0 100644 --- a/src/Schema/PrimaryKey.php +++ b/src/Schema/PrimaryKey.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Schema; -/** @psalm-immutable */ class PrimaryKey extends Key { /** @var string[] */ diff --git a/src/Schema/UniqueKey.php b/src/Schema/UniqueKey.php index 69b37d3..29007b6 100644 --- a/src/Schema/UniqueKey.php +++ b/src/Schema/UniqueKey.php @@ -2,7 +2,6 @@ namespace RebelCode\Atlas\Schema; -/** @psalm-immutable */ class UniqueKey extends Key { /** @var string[] */ diff --git a/src/Table.php b/src/Table.php index 9457f48..e444f92 100644 --- a/src/Table.php +++ b/src/Table.php @@ -16,7 +16,6 @@ use RebelCode\Atlas\Query\SelectQuery; use RebelCode\Atlas\Query\UpdateQuery; -/** @psalm-immutable */ class Table implements DataSource { protected string $name; diff --git a/src/TableRef.php b/src/TableRef.php index cbd7923..d2645a9 100644 --- a/src/TableRef.php +++ b/src/TableRef.php @@ -4,11 +4,7 @@ use RebelCode\Atlas\Expression\ColumnTerm; -/** - * A data source that refers to a table by name. This is useful when the {@link Table} instance cannot be obtained. - * - * @psalm-immutable - */ +/** A data source that refers to a table by name. This is useful when the {@link Table} instance cannot be obtained. */ class TableRef implements DataSource { protected string $name;