Skip to content

Commit bf55cde

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
Conflicts: system/CLI/CommandRunner.php system/CLI/Console.php system/Database/Forge.php system/I18n/Time.php system/Validation/Validation.php
2 parents 8239612 + 46ddce5 commit bf55cde

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

+433
-385
lines changed

.php-cs-fixer.dist.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,20 @@
4848
'space_before_parenthesis' => true,
4949
'inline_constructor_arguments' => true,
5050
],
51-
'control_structure_braces' => true,
51+
'control_structure_braces' => true,
52+
'curly_braces_position' => [
53+
'control_structures_opening_brace' => 'same_line',
54+
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
55+
'anonymous_functions_opening_brace' => 'same_line',
56+
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
57+
'anonymous_classes_opening_brace' => 'same_line',
58+
'allow_single_line_empty_anonymous_classes' => true,
59+
'allow_single_line_anonymous_functions' => true,
60+
],
61+
'function_declaration' => [
62+
'closure_function_spacing' => 'one',
63+
'trailing_comma_single_line' => false,
64+
],
5265
'no_multiple_statements_per_line' => true,
5366
'no_trailing_comma_in_singleline' => [
5467
'elements' => [
@@ -59,7 +72,10 @@
5972
],
6073
],
6174
'no_useless_nullsafe_operator' => true,
62-
'phpdoc_separation' => [
75+
'phpdoc_order' => [
76+
'order' => ['param', 'return', 'throws'],
77+
],
78+
'phpdoc_separation' => [
6379
'groups' => [
6480
['immutable', 'psalm-immutable'],
6581
['param', 'phpstan-param', 'psalm-param'],

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,20 @@
4040
'space_before_parenthesis' => true,
4141
'inline_constructor_arguments' => true,
4242
],
43-
'control_structure_braces' => true,
43+
'control_structure_braces' => true,
44+
'curly_braces_position' => [
45+
'control_structures_opening_brace' => 'same_line',
46+
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
47+
'anonymous_functions_opening_brace' => 'same_line',
48+
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
49+
'anonymous_classes_opening_brace' => 'same_line',
50+
'allow_single_line_empty_anonymous_classes' => true,
51+
'allow_single_line_anonymous_functions' => true,
52+
],
53+
'function_declaration' => [
54+
'closure_function_spacing' => 'one',
55+
'trailing_comma_single_line' => false,
56+
],
4457
'no_multiple_statements_per_line' => true,
4558
'no_trailing_comma_in_singleline' => [
4659
'elements' => [
@@ -51,7 +64,10 @@
5164
],
5265
],
5366
'no_useless_nullsafe_operator' => true,
54-
'phpdoc_separation' => [
67+
'phpdoc_order' => [
68+
'order' => ['param', 'return', 'throws'],
69+
],
70+
'phpdoc_separation' => [
5571
'groups' => [
5672
['immutable', 'psalm-immutable'],
5773
['param', 'phpstan-param', 'psalm-param'],

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,20 @@
4242
'space_before_parenthesis' => true,
4343
'inline_constructor_arguments' => true,
4444
],
45-
'control_structure_braces' => true,
45+
'control_structure_braces' => true,
46+
'curly_braces_position' => [
47+
'control_structures_opening_brace' => 'same_line',
48+
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
49+
'anonymous_functions_opening_brace' => 'same_line',
50+
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
51+
'anonymous_classes_opening_brace' => 'same_line',
52+
'allow_single_line_empty_anonymous_classes' => true,
53+
'allow_single_line_anonymous_functions' => true,
54+
],
55+
'function_declaration' => [
56+
'closure_function_spacing' => 'one',
57+
'trailing_comma_single_line' => false,
58+
],
4659
'no_multiple_statements_per_line' => true,
4760
'no_trailing_comma_in_singleline' => [
4861
'elements' => [
@@ -53,7 +66,10 @@
5366
],
5467
],
5568
'no_useless_nullsafe_operator' => true,
56-
'phpdoc_separation' => [
69+
'phpdoc_order' => [
70+
'order' => ['param', 'return', 'throws'],
71+
],
72+
'phpdoc_separation' => [
5773
'groups' => [
5874
['immutable', 'psalm-immutable'],
5975
['param', 'phpstan-param', 'psalm-param'],

system/BaseModel.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ abstract protected function doFind(bool $singleton, $id = null);
358358
*
359359
* @param string $columnName Column Name
360360
*
361-
* @throws DataException
362-
*
363361
* @return array|null The resulting row of data, or null if no data found.
362+
*
363+
* @throws DataException
364364
*/
365365
abstract protected function doFindColumn(string $columnName);
366366

@@ -424,9 +424,9 @@ abstract protected function doUpdate($id = null, $data = null): bool;
424424
* @param int $batchSize The size of the batch to run
425425
* @param bool $returnSQL True means SQL is returned, false will execute the query
426426
*
427-
* @throws DatabaseException
428-
*
429427
* @return mixed Number of rows affected or FALSE on failure
428+
*
429+
* @throws DatabaseException
430430
*/
431431
abstract protected function doUpdateBatch(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false);
432432

@@ -437,9 +437,9 @@ abstract protected function doUpdateBatch(?array $set = null, ?string $index = n
437437
* @param array|int|string|null $id The rows primary key(s)
438438
* @param bool $purge Allows overriding the soft deletes setting.
439439
*
440-
* @throws DatabaseException
441-
*
442440
* @return bool|string
441+
*
442+
* @throws DatabaseException
443443
*/
444444
abstract protected function doDelete($id = null, bool $purge = false);
445445

@@ -573,9 +573,9 @@ public function find($id = null)
573573
*
574574
* @param string $columnName Column Name
575575
*
576-
* @throws DataException
577-
*
578576
* @return array|null The resulting row of data, or null if no data found.
577+
*
578+
* @throws DataException
579579
*/
580580
public function findColumn(string $columnName)
581581
{
@@ -725,9 +725,9 @@ public function getInsertID()
725725
* @param array|object|null $data Data
726726
* @param bool $returnID Whether insert ID should be returned or not.
727727
*
728-
* @throws ReflectionException
729-
*
730728
* @return bool|int|string insert ID or true on success. false on failure.
729+
*
730+
* @throws ReflectionException
731731
*/
732732
public function insert($data = null, bool $returnID = true)
733733
{
@@ -799,9 +799,9 @@ public function insert($data = null, bool $returnID = true)
799799
* @param int $batchSize The size of the batch to run
800800
* @param bool $testing True means only number of records is returned, false will execute the query
801801
*
802-
* @throws ReflectionException
803-
*
804802
* @return bool|int Number of rows inserted or FALSE on failure
803+
*
804+
* @throws ReflectionException
805805
*/
806806
public function insertBatch(?array $set = null, ?bool $escape = null, int $batchSize = 100, bool $testing = false)
807807
{
@@ -934,10 +934,10 @@ public function update($id = null, $data = null): bool
934934
* @param int $batchSize The size of the batch to run
935935
* @param bool $returnSQL True means SQL is returned, false will execute the query
936936
*
937+
* @return mixed Number of rows affected or FALSE on failure
938+
*
937939
* @throws DatabaseException
938940
* @throws ReflectionException
939-
*
940-
* @return mixed Number of rows affected or FALSE on failure
941941
*/
942942
public function updateBatch(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false)
943943
{
@@ -1009,9 +1009,9 @@ public function updateBatch(?array $set = null, ?string $index = null, int $batc
10091009
* @param array|int|string|null $id The rows primary key(s)
10101010
* @param bool $purge Allows overriding the soft deletes setting.
10111011
*
1012-
* @throws DatabaseException
1013-
*
10141012
* @return BaseResult|bool
1013+
*
1014+
* @throws DatabaseException
10151015
*/
10161016
public function delete($id = null, bool $purge = false)
10171017
{
@@ -1225,9 +1225,9 @@ protected function doProtectFields(array $data): array
12251225
*
12261226
* @param int|null $userData An optional PHP timestamp to be converted.
12271227
*
1228-
* @throws ModelException
1229-
*
12301228
* @return mixed
1229+
*
1230+
* @throws ModelException
12311231
*/
12321232
protected function setDate(?int $userData = null)
12331233
{
@@ -1249,9 +1249,9 @@ protected function setDate(?int $userData = null)
12491249
*
12501250
* @param int $value value
12511251
*
1252-
* @throws ModelException
1253-
*
12541252
* @return int|string
1253+
*
1254+
* @throws ModelException
12551255
*/
12561256
protected function intToDate(int $value)
12571257
{
@@ -1512,9 +1512,9 @@ public function allowCallbacks(bool $val = true)
15121512
* @param string $event Event
15131513
* @param array $eventData Event Data
15141514
*
1515-
* @throws DataException
1516-
*
15171515
* @return mixed
1516+
*
1517+
* @throws DataException
15181518
*/
15191519
protected function trigger(string $event, array $eventData)
15201520
{
@@ -1573,9 +1573,9 @@ public function asObject(string $class = 'object')
15731573
* @param bool $onlyChanged Only Changed Property
15741574
* @param bool $recursive If true, inner entities will be casted as array as well
15751575
*
1576-
* @throws ReflectionException
1577-
*
15781576
* @return array Array
1577+
*
1578+
* @throws ReflectionException
15791579
*/
15801580
protected function objectToArray($data, bool $onlyChanged = true, bool $recursive = false): array
15811581
{
@@ -1603,9 +1603,9 @@ protected function objectToArray($data, bool $onlyChanged = true, bool $recursiv
16031603
* @param bool $onlyChanged Only Changed Property
16041604
* @param bool $recursive If true, inner entities will be casted as array as well
16051605
*
1606-
* @throws ReflectionException
1607-
*
16081606
* @return array|null Array
1607+
*
1608+
* @throws ReflectionException
16091609
*/
16101610
protected function objectToRawArray($data, bool $onlyChanged = true, bool $recursive = false): ?array
16111611
{

system/CLI/BaseCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ abstract public function run(array $params);
105105
/**
106106
* Can be used by a command to run other commands.
107107
*
108-
* @throws ReflectionException
109-
*
110108
* @return mixed
109+
*
110+
* @throws ReflectionException
111111
*/
112112
protected function call(string $command, array $params = [])
113113
{

system/CLI/Console.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class Console
2323
/**
2424
* Runs the current command discovered on the CLI.
2525
*
26-
* @throws Exception
27-
*
2826
* @return int|void
27+
*
28+
* @throws Exception
2929
*/
3030
public function run()
3131
{

system/CodeIgniter.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ private function configureKint(): void
297297
* tries to route the response, loads the controller and generally
298298
* makes all of the pieces work together.
299299
*
300-
* @throws RedirectException
301-
*
302300
* @return ResponseInterface|void
301+
*
302+
* @throws RedirectException
303303
*/
304304
public function run(?RouteCollectionInterface $routes = null, bool $returnResponse = false)
305305
{
@@ -398,10 +398,10 @@ private function isWeb(): bool
398398
/**
399399
* Handles the main request logic and fires the controller.
400400
*
401+
* @return ResponseInterface
402+
*
401403
* @throws PageNotFoundException
402404
* @throws RedirectException
403-
*
404-
* @return ResponseInterface
405405
*/
406406
protected function handleRequest(?RouteCollectionInterface $routes, Cache $cacheConfig, bool $returnResponse = false)
407407
{
@@ -638,9 +638,9 @@ protected function forceSecureAccess($duration = 31_536_000)
638638
/**
639639
* Determines if a response has been cached for the given URI.
640640
*
641-
* @throws Exception
642-
*
643641
* @return false|ResponseInterface
642+
*
643+
* @throws Exception
644644
*/
645645
public function displayCache(Cache $config)
646646
{
@@ -743,9 +743,9 @@ public function displayPerformanceMetrics(string $output): string
743743
* @param RouteCollectionInterface|null $routes An collection interface to use in place
744744
* of the config file.
745745
*
746-
* @throws RedirectException
747-
*
748746
* @return string|string[]|null Route filters, that is, the filters specified in the routes file
747+
*
748+
* @throws RedirectException
749749
*/
750750
protected function tryToRouteIt(?RouteCollectionInterface $routes = null)
751751
{

system/Common.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,9 @@ function env(string $key, $default = null)
400400
* @param array|string $data
401401
* @param string $encoding
402402
*
403-
* @throws InvalidArgumentException
404-
*
405403
* @return array|string
404+
*
405+
* @throws InvalidArgumentException
406406
*/
407407
function esc($data, string $context = 'html', ?string $encoding = null)
408408
{

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)