Skip to content

Commit 8a5d3cb

Browse files
committed
Merge branch 'develop' into 4.8
2 parents 202aacc + 58fed05 commit 8a5d3cb

222 files changed

Lines changed: 1349 additions & 4160 deletions

File tree

Some content is hidden

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

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"phpunit/phpcov": "^9.0.2 || ^10.0",
3030
"phpunit/phpunit": "^10.5.16 || ^11.2",
3131
"predis/predis": "^3.0",
32-
"rector/rector": "2.6.1",
32+
"rector/rector": "2.6.3",
3333
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
3434
},
3535
"replace": {

‎rector.php‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
2626
use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector;
2727
use Rector\DeadCode\Rector\Property\RemoveDefaultValueFromAssignedPropertyRector;
28-
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
29-
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
30-
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
31-
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
3228
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
3329
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
3430
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
@@ -37,7 +33,6 @@
3733
use Rector\Privatization\Rector\Class_\FinalizeTestCaseClassRector;
3834
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
3935
use Rector\Renaming\Rector\ConstFetch\RenameConstantRector;
40-
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
4136
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
4237
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
4338
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
@@ -182,15 +177,10 @@
182177
DeclareStrictTypesRector::class,
183178
UnderscoreToCamelCaseVariableNameRector::class,
184179
SimplifyUselessVariableRector::class,
185-
RemoveAlwaysElseRector::class,
186180
PassStrictParameterToFunctionParameterRector::class,
187-
ChangeNestedForeachIfsToEarlyContinueRector::class,
188-
ChangeIfElseValueAssignToEarlyReturnRector::class,
189-
PreparedValueToEarlyReturnRector::class,
190181
RemoveErrorSuppressInTryCatchStmtsRector::class,
191182
FuncGetArgsToVariadicParamRector::class,
192183
MakeInheritedMethodVisibilitySameAsParentRector::class,
193-
DisallowedEmptyRuleFixerRector::class,
194184
PrivatizeFinalClassPropertyRector::class,
195185
VersionCompareFuncCallToConstantRector::class,
196186
AddClosureVoidReturnTypeWhereNoReturnRector::class,

‎system/CLI/InputOutput.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function input(?string $prefix = null): string
5151
$input = fgets(fopen('php://stdin', 'rb'));
5252

5353
if ($input === false) {
54-
$input = '';
54+
return '';
5555
}
5656

5757
return $input;

‎system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ public function get(): array
9595
/**
9696
* Adding Filters
9797
*
98-
* @param list<array<string, array|string>> $routes
98+
* @param list<array{method: string, route: string, route_params: string, handler: string, params: array<string, bool>, before?: string, after?: string}> $routes
9999
*
100-
* @return list<array<string, array|string>>
100+
* @return list<array{method: string, route: string, route_params: string, handler: string, params: array<string, bool>, before: string, after: string}>
101101
*/
102102
private function addFilters(array $routes): array
103103
{
@@ -134,6 +134,9 @@ private function addFilters(array $routes): array
134134
return $routes;
135135
}
136136

137+
/**
138+
* @param array{method: string, route: string, route_params: string, handler: string, params: array<string, bool>, before?: string, after?: string} $route
139+
*/
137140
private function generateSampleUri(array $route, bool $longest = true): string
138141
{
139142
$sampleUri = '';

‎system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(
4545
*
4646
* @param class-string $class
4747
*
48-
* @return list<array<string, array|string>>
48+
* @return list<array{method: string, route: string, route_params: string, handler: string, params: array<string, bool>}>
4949
*/
5050
public function read(string $class, string $defaultController = 'Home', string $defaultMethod = 'index'): array
5151
{
@@ -128,6 +128,9 @@ public function read(string $class, string $defaultController = 'Home', string $
128128
return $output;
129129
}
130130

131+
/**
132+
* @return array{array<string, bool>, string}
133+
*/
131134
private function getParameters(ReflectionMethod $method): array
132135
{
133136
$params = [];

‎system/Commands/Utilities/Routes/ControllerMethodReader.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ private function getUriByClass(string $classname): string
147147

148148
/**
149149
* Gets a route without default controller.
150+
*
151+
* @return list<array{route: string, handler: string}>
150152
*/
151153
private function getRouteWithoutController(
152154
string $classShortname,

‎system/Commands/Utilities/Routes/FilterFinder.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public function __construct(?Router $router = null, ?Filters $filters = null)
3636
$this->filters = $filters ?? service('filters');
3737
}
3838

39+
/**
40+
* @return list<string>
41+
*/
3942
private function getRouteFilters(string $uri): array
4043
{
4144
$this->router->handle($uri);

‎system/Common.php‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,8 @@ function lang(string $line, array $args = [], ?string $locale = null)
814814
* - notice
815815
* - info
816816
* - debug
817+
*
818+
* @param array<string, mixed> $context
817819
*/
818820
function log_message(string $level, string $message, array $context = []): void
819821
{
@@ -856,7 +858,7 @@ function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn
856858
* @param string|null $default
857859
* @param 'attr'|'css'|'html'|'js'|'raw'|'url'|false $escape
858860
*
859-
* @return array|string|null
861+
* @return array<array-key, mixed>|string|null
860862
*/
861863
function old(string $key, $default = null, $escape = 'html')
862864
{
@@ -1180,7 +1182,7 @@ function slash_item(string $item): ?string
11801182
* Helper function used to convert a string, array, or object
11811183
* of attributes to a string.
11821184
*
1183-
* @param array|object|string $attributes string, array, object that can be cast to array
1185+
* @param array<array-key, mixed>|object|string $attributes
11841186
*/
11851187
function stringify_attributes($attributes, bool $js = false): string
11861188
{
@@ -1247,7 +1249,8 @@ function timer(?string $name = null, ?callable $callable = null)
12471249
* NOTE: Does not provide any escaping of the data, so that must
12481250
* all be handled manually by the developer.
12491251
*
1250-
* @param array $options Options for saveData or third-party extensions.
1252+
* @param array<string, mixed> $data
1253+
* @param array<string, mixed> $options Options for saveData or third-party extensions.
12511254
*/
12521255
function view(string $name, array $data = [], array $options = []): string
12531256
{
@@ -1270,7 +1273,7 @@ function view(string $name, array $data = [], array $options = []): string
12701273
* View cells are used within views to insert HTML chunks that are managed
12711274
* by other classes.
12721275
*
1273-
* @param array|string|null $params
1276+
* @param array<array-key, mixed>|string|null $params
12741277
*
12751278
* @throws ReflectionException
12761279
*/

‎system/Config/BaseConfig.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class BaseConfig
3737
* An optional array of classes that will act as Registrars
3838
* for rapidly setting config class properties.
3939
*
40-
* @var array
40+
* @var list<class-string|object>
4141
*/
4242
public static $registrars = [];
4343

@@ -70,6 +70,9 @@ class BaseConfig
7070
*/
7171
protected static $moduleConfig;
7272

73+
/**
74+
* @param array<string, mixed> $array
75+
*/
7376
public static function __set_state(array $array)
7477
{
7578
static::$override = false;

‎system/Config/BaseService.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
* @method static Security security(App $config = null, $getShared = true)
141141
* @method static Session session(ConfigSession $config = null, $getShared = true)
142142
* @method static SiteURIFactory siteurifactory(App $config = null, Superglobals $superglobals = null, $getShared = true)
143-
* @method static Superglobals superglobals(array $server = null, array $get = null, bool $getShared = true)
143+
* @method static Superglobals superglobals(array<string, mixed> $server = null, array<string, mixed> $get = null, bool $getShared = true)
144144
* @method static Throttler throttler($getShared = true)
145145
* @method static Timer timer($getShared = true)
146146
* @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true)
@@ -314,6 +314,8 @@ public static function locator(bool $getShared = true)
314314
* Provides the ability to perform case-insensitive calling of service
315315
* names.
316316
*
317+
* @param array<array-key, mixed> $arguments
318+
*
317319
* @return object|null
318320
*/
319321
public static function __callStatic(string $name, array $arguments)

0 commit comments

Comments
 (0)