Skip to content

Commit 0d08a92

Browse files
committed
Add order option to phpdoc_order
1 parent d5961a3 commit 0d08a92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+390
-381
lines changed

.php-cs-fixer.dist.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@
6868
],
6969
],
7070
'no_useless_nullsafe_operator' => true,
71-
'phpdoc_separation' => [
71+
'phpdoc_order' => [
72+
'order' => ['param', 'return', 'throws'],
73+
],
74+
'phpdoc_separation' => [
7275
'groups' => [
7376
['immutable', 'psalm-immutable'],
7477
['param', 'phpstan-param', 'psalm-param'],

.php-cs-fixer.no-header.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@
6060
],
6161
],
6262
'no_useless_nullsafe_operator' => true,
63-
'phpdoc_separation' => [
63+
'phpdoc_order' => [
64+
'order' => ['param', 'return', 'throws'],
65+
],
66+
'phpdoc_separation' => [
6467
'groups' => [
6568
['immutable', 'psalm-immutable'],
6669
['param', 'phpstan-param', 'psalm-param'],

.php-cs-fixer.user-guide.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@
6262
],
6363
],
6464
'no_useless_nullsafe_operator' => true,
65-
'phpdoc_separation' => [
65+
'phpdoc_order' => [
66+
'order' => ['param', 'return', 'throws'],
67+
],
68+
'phpdoc_separation' => [
6669
'groups' => [
6770
['immutable', 'psalm-immutable'],
6871
['param', 'phpstan-param', 'psalm-param'],

system/BaseModel.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ abstract protected function doFind(bool $singleton, $id = null);
326326
*
327327
* @param string $columnName Column Name
328328
*
329-
* @throws DataException
330-
*
331329
* @return array|null The resulting row of data, or null if no data found.
330+
*
331+
* @throws DataException
332332
*/
333333
abstract protected function doFindColumn(string $columnName);
334334

@@ -392,9 +392,9 @@ abstract protected function doUpdate($id = null, $data = null): bool;
392392
* @param int $batchSize The size of the batch to run
393393
* @param bool $returnSQL True means SQL is returned, false will execute the query
394394
*
395-
* @throws DatabaseException
396-
*
397395
* @return mixed Number of rows affected or FALSE on failure
396+
*
397+
* @throws DatabaseException
398398
*/
399399
abstract protected function doUpdateBatch(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false);
400400

@@ -405,9 +405,9 @@ abstract protected function doUpdateBatch(?array $set = null, ?string $index = n
405405
* @param array|int|string|null $id The rows primary key(s)
406406
* @param bool $purge Allows overriding the soft deletes setting.
407407
*
408-
* @throws DatabaseException
409-
*
410408
* @return bool|string
409+
*
410+
* @throws DatabaseException
411411
*/
412412
abstract protected function doDelete($id = null, bool $purge = false);
413413

@@ -541,9 +541,9 @@ public function find($id = null)
541541
*
542542
* @param string $columnName Column Name
543543
*
544-
* @throws DataException
545-
*
546544
* @return array|null The resulting row of data, or null if no data found.
545+
*
546+
* @throws DataException
547547
*/
548548
public function findColumn(string $columnName)
549549
{
@@ -693,9 +693,9 @@ public function getInsertID()
693693
* @param array|object|null $data Data
694694
* @param bool $returnID Whether insert ID should be returned or not.
695695
*
696-
* @throws ReflectionException
697-
*
698696
* @return bool|int|string insert ID or true on success. false on failure.
697+
*
698+
* @throws ReflectionException
699699
*/
700700
public function insert($data = null, bool $returnID = true)
701701
{
@@ -767,9 +767,9 @@ public function insert($data = null, bool $returnID = true)
767767
* @param int $batchSize The size of the batch to run
768768
* @param bool $testing True means only number of records is returned, false will execute the query
769769
*
770-
* @throws ReflectionException
771-
*
772770
* @return bool|int Number of rows inserted or FALSE on failure
771+
*
772+
* @throws ReflectionException
773773
*/
774774
public function insertBatch(?array $set = null, ?bool $escape = null, int $batchSize = 100, bool $testing = false)
775775
{
@@ -882,10 +882,10 @@ public function update($id = null, $data = null): bool
882882
* @param int $batchSize The size of the batch to run
883883
* @param bool $returnSQL True means SQL is returned, false will execute the query
884884
*
885+
* @return mixed Number of rows affected or FALSE on failure
886+
*
885887
* @throws DatabaseException
886888
* @throws ReflectionException
887-
*
888-
* @return mixed Number of rows affected or FALSE on failure
889889
*/
890890
public function updateBatch(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false)
891891
{
@@ -937,9 +937,9 @@ public function updateBatch(?array $set = null, ?string $index = null, int $batc
937937
* @param array|int|string|null $id The rows primary key(s)
938938
* @param bool $purge Allows overriding the soft deletes setting.
939939
*
940-
* @throws DatabaseException
941-
*
942940
* @return BaseResult|bool
941+
*
942+
* @throws DatabaseException
943943
*/
944944
public function delete($id = null, bool $purge = false)
945945
{
@@ -1153,9 +1153,9 @@ protected function doProtectFields(array $data): array
11531153
*
11541154
* @param int|null $userData An optional PHP timestamp to be converted.
11551155
*
1156-
* @throws ModelException
1157-
*
11581156
* @return mixed
1157+
*
1158+
* @throws ModelException
11591159
*/
11601160
protected function setDate(?int $userData = null)
11611161
{
@@ -1177,9 +1177,9 @@ protected function setDate(?int $userData = null)
11771177
*
11781178
* @param int $value value
11791179
*
1180-
* @throws ModelException
1181-
*
11821180
* @return int|string
1181+
*
1182+
* @throws ModelException
11831183
*/
11841184
protected function intToDate(int $value)
11851185
{
@@ -1440,9 +1440,9 @@ public function allowCallbacks(bool $val = true)
14401440
* @param string $event Event
14411441
* @param array $eventData Event Data
14421442
*
1443-
* @throws DataException
1444-
*
14451443
* @return mixed
1444+
*
1445+
* @throws DataException
14461446
*/
14471447
protected function trigger(string $event, array $eventData)
14481448
{
@@ -1501,9 +1501,9 @@ public function asObject(string $class = 'object')
15011501
* @param bool $onlyChanged Only Changed Property
15021502
* @param bool $recursive If true, inner entities will be casted as array as well
15031503
*
1504-
* @throws ReflectionException
1505-
*
15061504
* @return array Array
1505+
*
1506+
* @throws ReflectionException
15071507
*/
15081508
protected function objectToArray($data, bool $onlyChanged = true, bool $recursive = false): array
15091509
{
@@ -1531,9 +1531,9 @@ protected function objectToArray($data, bool $onlyChanged = true, bool $recursiv
15311531
* @param bool $onlyChanged Only Changed Property
15321532
* @param bool $recursive If true, inner entities will be casted as array as well
15331533
*
1534-
* @throws ReflectionException
1535-
*
15361534
* @return array|null Array
1535+
*
1536+
* @throws ReflectionException
15371537
*/
15381538
protected function objectToRawArray($data, bool $onlyChanged = true, bool $recursive = false): ?array
15391539
{

system/CLI/BaseCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ abstract public function run(array $params);
103103
/**
104104
* Can be used by a command to run other commands.
105105
*
106-
* @throws ReflectionException
107-
*
108106
* @return mixed
107+
*
108+
* @throws ReflectionException
109109
*/
110110
protected function call(string $command, array $params = [])
111111
{

system/CLI/CommandRunner.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public function __construct()
4242
* @param string $method
4343
* @param array $params
4444
*
45-
* @throws ReflectionException
46-
*
4745
* @return mixed
46+
*
47+
* @throws ReflectionException
4848
*/
4949
public function _remap($method, $params)
5050
{
@@ -54,9 +54,9 @@ public function _remap($method, $params)
5454
/**
5555
* Default command.
5656
*
57-
* @throws ReflectionException
58-
*
5957
* @return mixed
58+
*
59+
* @throws ReflectionException
6060
*/
6161
public function index(array $params)
6262
{

system/CLI/Console.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function __construct(CodeIgniter $app)
3434
/**
3535
* Runs the current command discovered on the CLI.
3636
*
37-
* @throws Exception
38-
*
3937
* @return mixed
38+
*
39+
* @throws Exception
4040
*/
4141
public function run(bool $useSafeOutput = false)
4242
{

system/CodeIgniter.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ protected function initializeKint()
285285
* tries to route the response, loads the controller and generally
286286
* makes all of the pieces work together.
287287
*
288-
* @throws RedirectException
289-
*
290288
* @return ResponseInterface|void
289+
*
290+
* @throws RedirectException
291291
*/
292292
public function run(?RouteCollectionInterface $routes = null, bool $returnResponse = false)
293293
{
@@ -396,10 +396,10 @@ private function isWeb(): bool
396396
/**
397397
* Handles the main request logic and fires the controller.
398398
*
399+
* @return ResponseInterface
400+
*
399401
* @throws PageNotFoundException
400402
* @throws RedirectException
401-
*
402-
* @return ResponseInterface
403403
*/
404404
protected function handleRequest(?RouteCollectionInterface $routes, Cache $cacheConfig, bool $returnResponse = false)
405405
{
@@ -649,9 +649,9 @@ protected function forceSecureAccess($duration = 31_536_000)
649649
/**
650650
* Determines if a response has been cached for the given URI.
651651
*
652-
* @throws Exception
653-
*
654652
* @return false|ResponseInterface
653+
*
654+
* @throws Exception
655655
*/
656656
public function displayCache(Cache $config)
657657
{
@@ -754,9 +754,9 @@ public function displayPerformanceMetrics(string $output): string
754754
* @param RouteCollectionInterface|null $routes An collection interface to use in place
755755
* of the config file.
756756
*
757-
* @throws RedirectException
758-
*
759757
* @return string|string[]|null Route filters, that is, the filters specified in the routes file
758+
*
759+
* @throws RedirectException
760760
*/
761761
protected function tryToRouteIt(?RouteCollectionInterface $routes = null)
762762
{

system/Common.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ function env(string $key, $default = null)
419419
* @param array|string $data
420420
* @param string $encoding
421421
*
422-
* @throws InvalidArgumentException
423-
*
424422
* @return array|string
423+
*
424+
* @throws InvalidArgumentException
425425
*/
426426
function esc($data, string $context = 'html', ?string $encoding = null)
427427
{

system/Cookie/Cookie.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ public static function setDefaults($config = [])
159159
/**
160160
* Create a new Cookie instance from a `Set-Cookie` header.
161161
*
162-
* @throws CookieException
163-
*
164162
* @return static
163+
*
164+
* @throws CookieException
165165
*/
166166
public static function fromHeaderString(string $cookie, bool $raw = false)
167167
{
@@ -575,9 +575,9 @@ public function offsetExists($offset): bool
575575
*
576576
* @param mixed $offset
577577
*
578-
* @throws InvalidArgumentException
579-
*
580578
* @return mixed
579+
*
580+
* @throws InvalidArgumentException
581581
*/
582582
#[ReturnTypeWillChange]
583583
public function offsetGet($offset)

system/Cookie/CookieStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class CookieStore implements Countable, IteratorAggregate
3636
*
3737
* @param string[] $headers
3838
*
39-
* @throws CookieException
40-
*
4139
* @return static
40+
*
41+
* @throws CookieException
4242
*/
4343
public static function fromCookieHeaders(array $headers, bool $raw = false)
4444
{

0 commit comments

Comments
 (0)