Skip to content

Commit 0505252

Browse files
committed
style: apply new options to phpdoc_align fixer
1 parent ffb2027 commit 0505252

27 files changed

+137
-137
lines changed

system/BaseModel.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ abstract protected function doFirst();
400400
* Inserts data into the current database.
401401
* This method works only with dbCalls.
402402
*
403-
* @param array $row Row data
403+
* @param array $row Row data
404404
* @phpstan-param row_array $row
405405
*
406406
* @return bool
@@ -424,9 +424,9 @@ abstract protected function doInsertBatch(?array $set = null, ?bool $escape = nu
424424
* Updates a single record in the database.
425425
* This method works only with dbCalls.
426426
*
427-
* @param array|int|string|null $id ID
428-
* @param array|null $row Row data
429-
* @phpstan-param row_array|null $row
427+
* @param array|int|string|null $id ID
428+
* @param array|null $row Row data
429+
* @phpstan-param row_array|null $row
430430
*/
431431
abstract protected function doUpdate($id = null, $row = null): bool;
432432

@@ -480,9 +480,9 @@ abstract protected function doOnlyDeleted();
480480
* Compiles a replace and runs the query.
481481
* This method works only with dbCalls.
482482
*
483-
* @param array|null $row Row data
483+
* @param array|null $row Row data
484484
* @phpstan-param row_array|null $row
485-
* @param bool $returnSQL Set to true to return Query String
485+
* @param bool $returnSQL Set to true to return Query String
486486
*
487487
* @return BaseResult|false|Query|string
488488
*/
@@ -511,7 +511,7 @@ abstract protected function idValue($data);
511511
* Public getter to return the id value using the idValue() method.
512512
* For example with SQL this will return $data->$this->primaryKey.
513513
*
514-
* @param array|object $row Row data
514+
* @param array|object $row Row data
515515
* @phpstan-param row_array|object $row
516516
*
517517
* @return array|int|string|null
@@ -552,7 +552,7 @@ abstract public function chunk(int $size, Closure $userFunc);
552552
*
553553
* @param array|int|string|null $id One primary key or an array of primary keys
554554
*
555-
* @return array|object|null The resulting row of data, or null.
555+
* @return array|object|null The resulting row of data, or null.
556556
* @phpstan-return ($id is int|string ? row_array|object|null : list<row_array|object>)
557557
*/
558558
public function find($id = null)
@@ -696,7 +696,7 @@ public function first()
696696
* you must ensure that the class will provide access to the class
697697
* variables, even if through a magic method.
698698
*
699-
* @param array|object $row Row data
699+
* @param array|object $row Row data
700700
* @phpstan-param row_array|object $row
701701
*
702702
* @throws ReflectionException
@@ -724,7 +724,7 @@ public function save($row): bool
724724
* This method is called on save to determine if entry have to be updated.
725725
* If this method returns false insert operation will be executed
726726
*
727-
* @param array|object $row Row data
727+
* @param array|object $row Row data
728728
* @phpstan-param row_array|object $row
729729
*/
730730
protected function shouldUpdate($row): bool
@@ -748,11 +748,11 @@ public function getInsertID()
748748
* Inserts data into the database. If an object is provided,
749749
* it will attempt to convert it to an array.
750750
*
751-
* @param array|object|null $row Row data
751+
* @param array|object|null $row Row data
752752
* @phpstan-param row_array|object|null $row
753-
* @param bool $returnID Whether insert ID should be returned or not.
753+
* @param bool $returnID Whether insert ID should be returned or not.
754754
*
755-
* @return bool|int|string insert ID or true on success. false on failure.
755+
* @return bool|int|string insert ID or true on success. false on failure.
756756
* @phpstan-return ($returnID is true ? int|string|false : bool)
757757
*
758758
* @throws ReflectionException
@@ -826,8 +826,8 @@ public function insert($row = null, bool $returnID = true)
826826
/**
827827
* Set datetime to created field.
828828
*
829-
* @phpstan-param row_array $row
830-
* @param int|string $date timestamp or datetime string
829+
* @phpstan-param row_array $row
830+
* @param int|string $date timestamp or datetime string
831831
*/
832832
protected function setCreatedField(array $row, $date): array
833833
{
@@ -841,8 +841,8 @@ protected function setCreatedField(array $row, $date): array
841841
/**
842842
* Set datetime to updated field.
843843
*
844-
* @phpstan-param row_array $row
845-
* @param int|string $date timestamp or datetime string
844+
* @phpstan-param row_array $row
845+
* @param int|string $date timestamp or datetime string
846846
*/
847847
protected function setUpdatedField(array $row, $date): array
848848
{
@@ -856,11 +856,11 @@ protected function setUpdatedField(array $row, $date): array
856856
/**
857857
* Compiles batch insert runs the queries, validating each row prior.
858858
*
859-
* @param list<array|object>|null $set an associative array of insert values
859+
* @param list<array|object>|null $set an associative array of insert values
860860
* @phpstan-param list<row_array|object>|null $set
861-
* @param bool|null $escape Whether to escape values
862-
* @param int $batchSize The size of the batch to run
863-
* @param bool $testing True means only number of records is returned, false will execute the query
861+
* @param bool|null $escape Whether to escape values
862+
* @param int $batchSize The size of the batch to run
863+
* @param bool $testing True means only number of records is returned, false will execute the query
864864
*
865865
* @return bool|int Number of rows inserted or FALSE on failure
866866
*
@@ -937,8 +937,8 @@ public function insertBatch(?array $set = null, ?bool $escape = null, int $batch
937937
* Updates a single record in the database. If an object is provided,
938938
* it will attempt to convert it into an array.
939939
*
940-
* @param array|int|string|null $id
941-
* @param array|object|null $row Row data
940+
* @param array|int|string|null $id
941+
* @param array|object|null $row Row data
942942
* @phpstan-param row_array|object|null $row
943943
*
944944
* @throws ReflectionException
@@ -999,11 +999,11 @@ public function update($id = null, $row = null): bool
999999
/**
10001000
* Compiles an update and runs the query.
10011001
*
1002-
* @param list<array|object>|null $set an associative array of insert values
1002+
* @param list<array|object>|null $set an associative array of insert values
10031003
* @phpstan-param list<row_array|object>|null $set
1004-
* @param string|null $index The where key
1005-
* @param int $batchSize The size of the batch to run
1006-
* @param bool $returnSQL True means SQL is returned, false will execute the query
1004+
* @param string|null $index The where key
1005+
* @param int $batchSize The size of the batch to run
1006+
* @param bool $returnSQL True means SQL is returned, false will execute the query
10071007
*
10081008
* @return false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
10091009
*
@@ -1173,9 +1173,9 @@ public function onlyDeleted()
11731173
/**
11741174
* Compiles a replace and runs the query.
11751175
*
1176-
* @param array|null $row Row data
1176+
* @param array|null $row Row data
11771177
* @phpstan-param row_array|null $row
1178-
* @param bool $returnSQL Set to true to return Query String
1178+
* @param bool $returnSQL Set to true to return Query String
11791179
*
11801180
* @return BaseResult|false|Query|string
11811181
*/
@@ -1279,7 +1279,7 @@ public function protect(bool $protect = true)
12791279
* @used-by update() to protect against mass assignment vulnerabilities.
12801280
* @used-by updateBatch() to protect against mass assignment vulnerabilities.
12811281
*
1282-
* @param array $row Row data
1282+
* @param array $row Row data
12831283
* @phpstan-param row_array $row
12841284
*
12851285
* @throws DataException
@@ -1310,7 +1310,7 @@ protected function doProtectFields(array $row): array
13101310
* @used-by insert() to protect against mass assignment vulnerabilities.
13111311
* @used-by insertBatch() to protect against mass assignment vulnerabilities.
13121312
*
1313-
* @param array $row Row data
1313+
* @param array $row Row data
13141314
* @phpstan-param row_array $row
13151315
*
13161316
* @throws DataException
@@ -1505,7 +1505,7 @@ public function cleanRules(bool $choice = false)
15051505
* Validate the row data against the validation rules (or the validation group)
15061506
* specified in the class property, $validationRules.
15071507
*
1508-
* @param array|object $row Row data
1508+
* @param array|object $row Row data
15091509
* @phpstan-param row_array|object $row
15101510
*/
15111511
public function validate($row): bool
@@ -1575,8 +1575,8 @@ public function getValidationMessages(): array
15751575
* currently so that rules don't block updating when only updating
15761576
* a partial row.
15771577
*
1578-
* @param array $rules Array containing field name and rule
1579-
* @param array $row Row data (@TODO Remove null in param type)
1578+
* @param array $rules Array containing field name and rule
1579+
* @param array $row Row data (@TODO Remove null in param type)
15801580
* @phpstan-param row_array $row
15811581
*/
15821582
protected function cleanValidationRules(array $rules, ?array $row = null): array
@@ -1760,9 +1760,9 @@ protected function objectToRawArray($object, bool $onlyChanged = true, bool $rec
17601760
/**
17611761
* Transform data to array.
17621762
*
1763-
* @param array|object|null $row Row data
1763+
* @param array|object|null $row Row data
17641764
* @phpstan-param row_array|object|null $row
1765-
* @param string $type Type of data (insert|update)
1765+
* @param string $type Type of data (insert|update)
17661766
*
17671767
* @throws DataException
17681768
* @throws InvalidArgumentException

system/Common.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function app_timezone(): string
6464
* cache()->save('foo', 'bar');
6565
* $foo = cache('bar');
6666
*
67-
* @return array|bool|CacheInterface|float|int|object|string|null
67+
* @return array|bool|CacheInterface|float|int|object|string|null
6868
* @phpstan-return ($key is null ? CacheInterface : array|bool|float|int|object|string|null)
6969
*/
7070
function cache(?string $key = null)
@@ -207,7 +207,7 @@ function command(string $command)
207207
*
208208
* @param class-string<ConfigTemplate>|string $name
209209
*
210-
* @return ConfigTemplate|null
210+
* @return ConfigTemplate|null
211211
* @phpstan-return ($name is class-string<ConfigTemplate> ? ConfigTemplate : object|null)
212212
*/
213213
function config(string $name, bool $getShared = true)
@@ -414,11 +414,11 @@ function env(string $key, $default = null)
414414
* If $data is an array, then it loops over it, escaping each
415415
* 'value' of the key/value pairs.
416416
*
417-
* @param array|string $data
417+
* @param array|string $data
418418
* @phpstan-param 'html'|'js'|'css'|'url'|'attr'|'raw' $context
419-
* @param string|null $encoding Current encoding for escaping.
420-
* If not UTF-8, we convert strings from this encoding
421-
* pre-escaping and back to this encoding post-escaping.
419+
* @param string|null $encoding Current encoding for escaping.
420+
* If not UTF-8, we convert strings from this encoding
421+
* pre-escaping and back to this encoding post-escaping.
422422
*
423423
* @return array|string
424424
*
@@ -805,7 +805,7 @@ function log_message(string $level, string $message, array $context = [])
805805
*
806806
* @param class-string<ModelTemplate>|string $name
807807
*
808-
* @return ModelTemplate|null
808+
* @return ModelTemplate|null
809809
* @phpstan-return ($name is class-string<ModelTemplate> ? ModelTemplate : object|null)
810810
*/
811811
function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn = null)
@@ -819,8 +819,8 @@ function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn
819819
* Provides access to "old input" that was set in the session
820820
* during a redirect()->withInput().
821821
*
822-
* @param string|null $default
823-
* @param false|string $escape
822+
* @param string|null $default
823+
* @param false|string $escape
824824
* @phpstan-param false|'attr'|'css'|'html'|'js'|'raw'|'url' $escape
825825
*
826826
* @return array|string|null
@@ -974,7 +974,7 @@ function route_to(string $method, ...$params)
974974
* session()->set('foo', 'bar');
975975
* $foo = session('bar');
976976
*
977-
* @return array|bool|float|int|object|Session|string|null
977+
* @return array|bool|float|int|object|Session|string|null
978978
* @phpstan-return ($val is null ? Session : array|bool|float|int|object|string|null)
979979
*/
980980
function session(?string $val = null)
@@ -1128,7 +1128,7 @@ function stringify_attributes($attributes, bool $js = false): string
11281128
* @param non-empty-string|null $name
11291129
* @param (callable(): mixed)|null $callable
11301130
*
1131-
* @return mixed|Timer
1131+
* @return mixed|Timer
11321132
* @phpstan-return ($name is null ? Timer : ($callable is (callable(): mixed) ? mixed : Timer))
11331133
*/
11341134
function timer(?string $name = null, ?callable $callable = null)

system/Database/BaseConnection.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ abstract protected function _close();
457457
/**
458458
* Create a persistent database connection.
459459
*
460-
* @return false|object|resource
460+
* @return false|object|resource
461461
* @phpstan-return false|TConnection
462462
*/
463463
public function persistentConnect()
@@ -471,7 +471,7 @@ public function persistentConnect()
471471
* get that connection. If you pass either alias in and only a single
472472
* connection is present, it must return the sole connection.
473473
*
474-
* @return false|object|resource
474+
* @return false|object|resource
475475
* @phpstan-return TConnection
476476
*/
477477
public function getConnection(?string $alias = null)
@@ -547,7 +547,7 @@ public function addTableAlias(string $table)
547547
/**
548548
* Executes the query against the database.
549549
*
550-
* @return false|object|resource
550+
* @return false|object|resource
551551
* @phpstan-return false|TResult
552552
*/
553553
abstract protected function execute(string $sql);
@@ -562,7 +562,7 @@ abstract protected function execute(string $sql);
562562
*
563563
* @param array|string|null $binds
564564
*
565-
* @return BaseResult|bool|Query BaseResult when “read” type query, bool when “write” type query, Query when prepared query
565+
* @return BaseResult|bool|Query BaseResult when “read” type query, bool when “write” type query, Query when prepared query
566566
* @phpstan-return BaseResult<TConnection, TResult>|bool|Query
567567
*
568568
* @todo BC set $queryClass default as null in 4.1
@@ -681,7 +681,7 @@ public function query(string $sql, $binds = null, bool $setEscapeFlags = true, s
681681
* is performed, nor are transactions handled. Simply takes a raw
682682
* query string and returns the database-specific result id.
683683
*
684-
* @return false|object|resource
684+
* @return false|object|resource
685685
* @phpstan-return false|TResult
686686
*/
687687
public function simpleQuery(string $sql)
@@ -1006,7 +1006,7 @@ public function getConnectDuration(int $decimals = 6): string
10061006
* @param bool $protectIdentifiers Protect table or column names?
10071007
* @param bool $fieldExists Supplied $item contains a column name?
10081008
*
1009-
* @return array|string
1009+
* @return array|string
10101010
* @phpstan-return ($item is array ? array : string)
10111011
*/
10121012
public function protectIdentifiers($item, bool $prefixSingle = false, ?bool $protectIdentifiers = null, bool $fieldExists = true)
@@ -1166,7 +1166,7 @@ private function protectDotItem(string $item, string $alias, bool $protectIdenti
11661166
*
11671167
* @param array|string $item
11681168
*
1169-
* @return array|string
1169+
* @return array|string
11701170
* @phpstan-return ($item is array ? array : string)
11711171
*/
11721172
public function escapeIdentifiers($item)
@@ -1251,7 +1251,7 @@ abstract public function affectedRows(): int;
12511251
*
12521252
* @param array|bool|float|int|object|string|null $str
12531253
*
1254-
* @return array|float|int|string
1254+
* @return array|float|int|string
12551255
* @phpstan-return ($str is array ? array : float|int|string)
12561256
*/
12571257
public function escape($str)
@@ -1665,7 +1665,7 @@ public function isWriteType($sql): bool
16651665
*
16661666
* Must return an array with keys 'code' and 'message':
16671667
*
1668-
* @return array<string, int|string|null>
1668+
* @return array<string, int|string|null>
16691669
* @phpstan-return array{code: int|string|null, message: string|null}
16701670
*/
16711671
abstract public function error(): array;

system/Database/BasePreparedQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ abstract public function _prepare(string $sql, array $options = []);
110110
* Takes a new set of data and runs it against the currently
111111
* prepared query. Upon success, will return a Results object.
112112
*
113-
* @return bool|ResultInterface
113+
* @return bool|ResultInterface
114114
* @phpstan-return bool|ResultInterface<TConnection, TResult>
115115
*
116116
* @throws DatabaseException

0 commit comments

Comments
 (0)