mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: enable AddFunctionVoidReturnTypeWhereNoReturnRector to add void to functions
This commit is contained in:
parent
1638990042
commit
e792d438cf
@ -58,6 +58,7 @@ use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector;
|
||||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
|
||||
use Rector\TypeDeclaration\Rector\Closure\AddClosureVoidReturnTypeWhereNoReturnRector;
|
||||
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
|
||||
use Rector\TypeDeclaration\Rector\Function_\AddFunctionVoidReturnTypeWhereNoReturnRector;
|
||||
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
|
||||
use Utils\Rector\PassStrictParameterToFunctionParameterRector;
|
||||
use Utils\Rector\RemoveErrorSuppressInTryCatchStmtsRector;
|
||||
@ -219,6 +220,7 @@ return RectorConfig::configure()
|
||||
VersionCompareFuncCallToConstantRector::class,
|
||||
ExplicitBoolCompareRector::class,
|
||||
AddClosureVoidReturnTypeWhereNoReturnRector::class,
|
||||
AddFunctionVoidReturnTypeWhereNoReturnRector::class,
|
||||
])
|
||||
->withConfiguredRule(StringClassNameToClassConstantRector::class, [
|
||||
// keep '\\' prefix string on string '\Foo\Bar'
|
||||
|
@ -766,10 +766,8 @@ if (! function_exists('log_message')) {
|
||||
* - notice
|
||||
* - info
|
||||
* - debug
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function log_message(string $level, string $message, array $context = [])
|
||||
function log_message(string $level, string $message, array $context = []): void
|
||||
{
|
||||
// When running tests, we want to always ensure that the
|
||||
// TestLogger is running, which provides utilities for
|
||||
|
@ -35,7 +35,6 @@ if (! function_exists('set_cookie')) {
|
||||
* @param bool|null $httpOnly True makes the cookie accessible via http(s) only (no javascript)
|
||||
* @param string|null $sameSite The cookie SameSite value
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @see \CodeIgniter\HTTP\Response::setCookie()
|
||||
*/
|
||||
@ -49,7 +48,7 @@ if (! function_exists('set_cookie')) {
|
||||
?bool $secure = null,
|
||||
?bool $httpOnly = null,
|
||||
?string $sameSite = null
|
||||
) {
|
||||
): void {
|
||||
$response = service('response');
|
||||
$response->setCookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httpOnly, $sameSite);
|
||||
}
|
||||
@ -92,11 +91,10 @@ if (! function_exists('delete_cookie')) {
|
||||
* @param string $path the cookie path
|
||||
* @param string $prefix the cookie prefix
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @see \CodeIgniter\HTTP\Response::deleteCookie()
|
||||
*/
|
||||
function delete_cookie($name, string $domain = '', string $path = '/', string $prefix = '')
|
||||
function delete_cookie($name, string $domain = '', string $path = '/', string $prefix = ''): void
|
||||
{
|
||||
service('response')->deleteCookie($name, $domain, $path, $prefix);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ if (! function_exists('dd')) {
|
||||
*
|
||||
* @codeCoverageIgnore Can't be tested ... exits
|
||||
*/
|
||||
function dd(...$vars)
|
||||
function dd(...$vars): void
|
||||
{
|
||||
// @codeCoverageIgnoreStart
|
||||
Kint::$aliases[] = 'dd';
|
||||
@ -71,10 +71,8 @@ if (! function_exists('trace')) {
|
||||
*/
|
||||
/**
|
||||
* trace function
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function trace()
|
||||
function trace(): void
|
||||
{
|
||||
Kint::$aliases[] = 'trace';
|
||||
Kint::trace();
|
||||
|
Loading…
x
Reference in New Issue
Block a user