Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: enable AddFunctionVoidReturnTypeWhereNoReturnRector to add void to functions #9014

Merged
merged 2 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
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;
Expand Down Expand Up @@ -219,6 +220,7 @@
VersionCompareFuncCallToConstantRector::class,
ExplicitBoolCompareRector::class,
AddClosureVoidReturnTypeWhereNoReturnRector::class,
AddFunctionVoidReturnTypeWhereNoReturnRector::class,
])
->withConfiguredRule(StringClassNameToClassConstantRector::class, [
// keep '\\' prefix string on string '\Foo\Bar'
Expand Down
4 changes: 1 addition & 3 deletions system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,8 @@ function lang(string $line, array $args = [], ?string $locale = null)
* - 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
Expand Down
8 changes: 2 additions & 6 deletions system/Helpers/cookie_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
* @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()
*/
function set_cookie(
Expand All @@ -49,7 +47,7 @@ function 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);
}
Expand Down Expand Up @@ -92,11 +90,9 @@ function get_cookie($index, bool $xssClean = false, ?string $prefix = '')
* @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);
}
Expand Down
6 changes: 2 additions & 4 deletions system/Helpers/kint_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @codeCoverageIgnore Can't be tested ... exits
*/
function dd(...$vars)
function dd(...$vars): void
{
// @codeCoverageIgnoreStart
Kint::$aliases[] = 'dd';
Expand Down Expand Up @@ -71,10 +71,8 @@ function d(...$vars)
*/
/**
* trace function
*
* @return void
*/
function trace()
function trace(): void
{
Kint::$aliases[] = 'trace';
Kint::trace();
Expand Down
Loading