From f7613d9f6a6b9410ec168e3bf556d5312b209f20 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sat, 22 Jun 2024 09:51:48 +0700 Subject: [PATCH] Revert "Apply Rector changes (CI)" This reverts commit 00c8377fa2f3c63ca826bfc923776d3fe4ede9a7. --- src/Cache/SchemaCache.php | 7 +++++++ src/Command/CommandInterface.php | 4 ++++ src/Command/ParamInterface.php | 1 + src/Constraint/DefaultValueConstraint.php | 2 ++ src/Expression/ArrayExpression.php | 6 ++++++ src/Query/Query.php | 1 + src/QueryBuilder/AbstractDQLQueryBuilder.php | 2 ++ src/QueryBuilder/DDLQueryBuilderInterface.php | 2 ++ src/Schema/AbstractSchema.php | 3 +++ src/Schema/Builder/ColumnInterface.php | 2 ++ src/Schema/QuoterInterface.php | 1 + src/Schema/SchemaInterface.php | 2 ++ tests/Support/Assert.php | 1 + 13 files changed, 34 insertions(+) diff --git a/src/Cache/SchemaCache.php b/src/Cache/SchemaCache.php index 438245d88..fcfbab66d 100644 --- a/src/Cache/SchemaCache.php +++ b/src/Cache/SchemaCache.php @@ -48,6 +48,7 @@ public function __construct(private CacheInterface $psrCache) /** * Remove a value with the specified key from cache. * + * @param mixed $key A key identifying the value to delete from cache. * * @throws InvalidArgumentException */ @@ -60,6 +61,7 @@ public function remove(mixed $key): void /** * Retrieve value from cache. * + * @param mixed $key The key identifying the value to cache. * @throws InvalidArgumentException * @return mixed Cache value. */ @@ -72,7 +74,10 @@ public function get(mixed $key): mixed /** * Persists data in the cache, uniquely referenced by a key with an optional tag. * + * @param mixed $key The key of the item to store. + * @param mixed $value The value of the item to store. * @param string|null $tag Cache tag. + * * @throws InvalidArgumentException If the $key string isn't a legal value. * @throws RuntimeException If cache value isn't set. */ @@ -185,8 +190,10 @@ public function setExclude(array $value): void * * @link https://www.php-fig.org/psr/psr-16/#12-definitions * + * @param mixed $key A key to normalize. * * @throws InvalidArgumentException For invalid key. + * * @return string The normalized cache key. */ private function normalize(mixed $key): string diff --git a/src/Command/CommandInterface.php b/src/Command/CommandInterface.php index 2d8b4c917..57bcc5828 100644 --- a/src/Command/CommandInterface.php +++ b/src/Command/CommandInterface.php @@ -84,6 +84,7 @@ public function addCommentOnTable(string $table, string $comment): static; * @param string $table The name of the table to add constraint to. * @param string $name The name of the default value constraint. * @param string $column The name of the column to add constraint to. + * @param mixed $value Default value. * * @throws Exception * @throws NotSupportedException @@ -206,10 +207,12 @@ public function insertBatch(string $table, iterable $rows, array $columns = []): * @param int|string $name The parameter identifier. For a prepared statement using named placeholders, this will be * a parameter name of the form `:name`. For a prepared statement using question mark placeholders, this will be the * 1-indexed position of the parameter. + * @param mixed $value The PHP variable to bind to the SQL statement parameter (passed by reference). * @param int|null $dataType The {@see DataType SQL data type} of the parameter. If `null`, the type is determined * by the PHP type of the value. * @param int|null $length The length of the data type. * @param mixed|null $driverOptions The driver-specific options. + * * @throws Exception */ public function bindParam( @@ -238,6 +241,7 @@ public function addUnique(string $table, string $name, array|string $columns): s * @param int|string $name Parameter identifier. For a prepared statement using named placeholders, this will be a * parameter name of the form `:name`. For a prepared statement using question mark placeholders, this will be the * 1-indexed position of the parameter. + * @param mixed $value The value to bind to the parameter. * @param int|null $dataType The {@see DataType SQL data type} of the parameter. If null, the type is determined * by the PHP type of the value. */ diff --git a/src/Command/ParamInterface.php b/src/Command/ParamInterface.php index 3cea399b8..68ae5d75d 100644 --- a/src/Command/ParamInterface.php +++ b/src/Command/ParamInterface.php @@ -10,6 +10,7 @@ interface ParamInterface { /** + * @param mixed $value The value to bind to the parameter. * @param int $type The SQL data type of the parameter. * If `null`, the type is determined by the PHP type of the value. */ diff --git a/src/Constraint/DefaultValueConstraint.php b/src/Constraint/DefaultValueConstraint.php index 1f46be69f..0bcd07d64 100644 --- a/src/Constraint/DefaultValueConstraint.php +++ b/src/Constraint/DefaultValueConstraint.php @@ -30,6 +30,8 @@ public function getValue(): mixed /** * Set the default value as returned by the DBMS. + * + * @param mixed $value The default value as returned by the DBMS. */ public function value(mixed $value): self { diff --git a/src/Expression/ArrayExpression.php b/src/Expression/ArrayExpression.php index c7ed6e7f4..52e1d6788 100644 --- a/src/Expression/ArrayExpression.php +++ b/src/Expression/ArrayExpression.php @@ -70,8 +70,10 @@ public function getDimension(): int * * @link https://php.net/manual/en/arrayaccess.offsetexists.php * + * @param mixed $offset An offset to check for. * * @throws InvalidConfigException If offset isn't an integer. + * * @return bool Its `true` on success or `false` on failure. The return value will be cast to boolean if non-boolean * was returned. */ @@ -86,8 +88,10 @@ public function offsetExists(mixed $offset): bool * * @link https://php.net/manual/en/arrayaccess.offsetget.php * + * @param mixed $offset The offset to retrieve. * * @throws InvalidConfigException If offset isn't an integer. + * * @return mixed Can return all value types. */ public function offsetGet(mixed $offset): mixed @@ -102,6 +106,8 @@ public function offsetGet(mixed $offset): mixed * * @link https://php.net/manual/en/arrayaccess.offsetset.php * + * @param mixed $offset The offset to assign the value to. + * @param mixed $value The value to set. * * @throws InvalidConfigException If offset isn't an integer. */ diff --git a/src/Query/Query.php b/src/Query/Query.php index 2ba0c899e..60d635159 100644 --- a/src/Query/Query.php +++ b/src/Query/Query.php @@ -821,6 +821,7 @@ private function filterCondition(array|string $condition): array|string * - a string containing only space characters, * - or an empty array. * + * @param mixed $value The value to check. * * @return bool If the value is empty. */ diff --git a/src/QueryBuilder/AbstractDQLQueryBuilder.php b/src/QueryBuilder/AbstractDQLQueryBuilder.php index 35fb544b5..9119ffa7d 100644 --- a/src/QueryBuilder/AbstractDQLQueryBuilder.php +++ b/src/QueryBuilder/AbstractDQLQueryBuilder.php @@ -544,6 +544,7 @@ protected function extractAlias(string $table): array|bool /** * Checks to see if the given limit is effective. * + * @param mixed $limit The given limit. * * @return bool Whether the limit is effective. */ @@ -555,6 +556,7 @@ protected function hasLimit(mixed $limit): bool /** * Checks to see if the given offset is effective. * + * @param mixed $offset The given offset. * * @return bool Whether the offset is effective. */ diff --git a/src/QueryBuilder/DDLQueryBuilderInterface.php b/src/QueryBuilder/DDLQueryBuilderInterface.php index 6bc86a543..c6e97fb7d 100644 --- a/src/QueryBuilder/DDLQueryBuilderInterface.php +++ b/src/QueryBuilder/DDLQueryBuilderInterface.php @@ -84,9 +84,11 @@ public function addCommentOnTable(string $table, string $comment): string; * @param string $table The table toi add the default value constraint to. * @param string $name The name of the default value constraint. * @param string $column The name of the column to add constraint on. + * @param mixed $value The default value to set for the column. * * @throws Exception * @throws NotSupportedException If this isn't supported by the underlying DBMS. + * * @return string the SQL statement for adding a default value constraint to an existing table. * * Note: The method will quote the `name`, `table`, and `column` parameters before using them in the generated SQL. diff --git a/src/Schema/AbstractSchema.php b/src/Schema/AbstractSchema.php index 3e3efc1ef..2b6abea37 100644 --- a/src/Schema/AbstractSchema.php +++ b/src/Schema/AbstractSchema.php @@ -378,7 +378,9 @@ protected function findTableNames(string $schema): array * This method may be overridden by child classes to create a DBMS-specific column schema. * * @param string $type The abstract data type. + * @param mixed ...$info The column information. * @psalm-param array{unsigned?: bool} $info The set of parameters may be different for a specific DBMS. + * * @return ColumnSchemaInterface */ protected function createColumnSchema(string $type, mixed ...$info): ColumnSchemaInterface @@ -567,6 +569,7 @@ protected function resolveTableName(string $name): TableSchemaInterface * * @param string $name The table name. * @param string $type The metadata type. + * @param mixed $data The metadata to set. */ protected function setTableMetadata(string $name, string $type, mixed $data): void { diff --git a/src/Schema/Builder/ColumnInterface.php b/src/Schema/Builder/ColumnInterface.php index 1bc785889..220c6bdb9 100644 --- a/src/Schema/Builder/ColumnInterface.php +++ b/src/Schema/Builder/ColumnInterface.php @@ -57,6 +57,8 @@ public function defaultExpression(string $sql): self; /** * Specify the default value for the column. + * + * @param mixed $default The default value to use. */ public function defaultValue(mixed $default): self; diff --git a/src/Schema/QuoterInterface.php b/src/Schema/QuoterInterface.php index 31ac28a96..7f2325928 100644 --- a/src/Schema/QuoterInterface.php +++ b/src/Schema/QuoterInterface.php @@ -140,6 +140,7 @@ public function quoteTableName(string $name): string; * Attention: The usage of this method isn't safe. * Use prepared statements. * + * @param mixed $value The value to quote. * * @return mixed The quoted value. */ diff --git a/src/Schema/SchemaInterface.php b/src/Schema/SchemaInterface.php index 446cb83b4..d03341fb4 100644 --- a/src/Schema/SchemaInterface.php +++ b/src/Schema/SchemaInterface.php @@ -261,8 +261,10 @@ public function getDefaultSchema(): string|null; /** * Determines the SQL data type for the given PHP data value. * + * @param mixed $data The data to find a type for. * * @return int The type. + * * @see DataType */ public function getDataType(mixed $data): int; diff --git a/tests/Support/Assert.php b/tests/Support/Assert.php index ab9708c8b..92d398f72 100644 --- a/tests/Support/Assert.php +++ b/tests/Support/Assert.php @@ -65,6 +65,7 @@ public static function getInaccessibleProperty(object $object, string $propertyN * * @param object $object The object to set the property on. * @param string $propertyName The name of the property to set. + * @param mixed $value The value to set. */ public static function setInaccessibleProperty(object $object, string $propertyName, mixed $value): void {