mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix: remove declare(strict_types=1)
This commit is contained in:
parent
4b923d5dbf
commit
db98b1194d
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
@ -921,6 +919,8 @@ class CodeIgniter
|
||||
// This is a Web request or PHP CLI request
|
||||
$params = $this->router->params();
|
||||
|
||||
// The controller method param types may not be string.
|
||||
// So cannot set `declare(strict_types=1)` in this file.
|
||||
$output = method_exists($class, '_remap')
|
||||
? $class->_remap($this->method, ...$params)
|
||||
: $class->{$this->method}(...$params);
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
@ -166,6 +164,9 @@ class BaseConfig
|
||||
$value = (float) $value;
|
||||
}
|
||||
|
||||
// If the default value of the property is `null` and the type is not
|
||||
// `string`, TypeError will happen.
|
||||
// So cannot set `declare(strict_types=1)` in this file.
|
||||
$property = $value;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
@ -163,6 +161,8 @@ trait ControllerTestTrait
|
||||
|
||||
try {
|
||||
ob_start();
|
||||
// The controller method param types may not be string.
|
||||
// So cannot set `declare(strict_types=1)` in this file.
|
||||
$response = $this->controller->{$method}(...$params);
|
||||
} catch (Throwable $e) {
|
||||
$code = $e->getCode();
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
@ -618,6 +616,7 @@ class Parser extends View
|
||||
}
|
||||
|
||||
// Filter it....
|
||||
// We can't know correct param types, so can't set `declare(strict_types=1)`.
|
||||
$replace = $this->config->filters[$filter]($replace, ...$param);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
@ -73,6 +71,7 @@ final class ExceptionsTest extends CIUnitTestCase
|
||||
$maybeNull = PHP_VERSION_ID >= 80100 ? null : 'random string';
|
||||
|
||||
try {
|
||||
// We test DEPRECATED error, so cannot set `declare(strict_types=1)` in this file.
|
||||
strlen($maybeNull);
|
||||
$this->assertLogContains('error', '[DEPRECATED] strlen(): ');
|
||||
} catch (ErrorException $e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user