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

fix: code issues after merging develop #9284

Merged
merged 3 commits into from
Nov 17, 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
4 changes: 2 additions & 2 deletions system/Commands/Utilities/Routes/FilterCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function getClasses(string $method, string $uri): array
];
}

$request = Services::incomingrequest(null, false);
$request = service('incomingrequest', null, false);
$request->setMethod($method);

$router = $this->createRouter($request);
Expand Down Expand Up @@ -145,7 +145,7 @@ public function getRequiredFilters(): array
*/
public function getRequiredFilterClasses(): array
{
$request = Services::incomingrequest(null, false);
$request = service('incomingrequest', null, false);
$request->setMethod(Method::GET);

$router = $this->createRouter($request);
Expand Down
2 changes: 1 addition & 1 deletion system/Validation/StrictRules/FileRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FileRules
*/
public function __construct(?RequestInterface $request = null)
{
if ($request === null) {
if (! $request instanceof RequestInterface) {
$request = service('request');
}

Expand Down
12 changes: 6 additions & 6 deletions tests/system/Database/Live/MySQLi/FoundRowsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testAffectedRowsAfterEnableFoundRowsWithNoChange(): void

$affectedRows = $db1->affectedRows();

$this->assertSame($affectedRows, 2);
$this->assertSame(2, $affectedRows);
}

public function testAffectedRowsAfterDisableFoundRowsWithNoChange(): void
Expand All @@ -97,7 +97,7 @@ public function testAffectedRowsAfterDisableFoundRowsWithNoChange(): void

$affectedRows = $db1->affectedRows();

$this->assertSame($affectedRows, 0);
$this->assertSame(0, $affectedRows);
}

public function testAffectedRowsAfterEnableFoundRowsWithChange(): void
Expand All @@ -113,7 +113,7 @@ public function testAffectedRowsAfterEnableFoundRowsWithChange(): void

$affectedRows = $db1->affectedRows();

$this->assertSame($affectedRows, 2);
$this->assertSame(2, $affectedRows);
}

public function testAffectedRowsAfterDisableFoundRowsWithChange(): void
Expand All @@ -129,7 +129,7 @@ public function testAffectedRowsAfterDisableFoundRowsWithChange(): void

$affectedRows = $db1->affectedRows();

$this->assertSame($affectedRows, 2);
$this->assertSame(2, $affectedRows);
}

public function testAffectedRowsAfterEnableFoundRowsWithPartialChange(): void
Expand All @@ -145,7 +145,7 @@ public function testAffectedRowsAfterEnableFoundRowsWithPartialChange(): void

$affectedRows = $db1->affectedRows();

$this->assertSame($affectedRows, 2);
$this->assertSame(2, $affectedRows);
}

public function testAffectedRowsAfterDisableFoundRowsWithPartialChange(): void
Expand All @@ -161,6 +161,6 @@ public function testAffectedRowsAfterDisableFoundRowsWithPartialChange(): void

$affectedRows = $db1->affectedRows();

$this->assertSame($affectedRows, 1);
$this->assertSame(1, $affectedRows);
}
}
4 changes: 2 additions & 2 deletions tests/system/Router/RouteCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ public function testRouteMatchingHostMultipleCorrect(): void
service('request')->setMethod(Method::GET);

$routes = $this->getCollector();
$router = new Router($routes, Services::request());
$router = new Router($routes, service('request'));

$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Home');
Expand All @@ -1770,7 +1770,7 @@ public function testRouteMatchingHostMultipleFail(): void
service('request')->setMethod(Method::GET);

$routes = $this->getCollector();
$router = new Router($routes, Services::request());
$router = new Router($routes, service('request'));

$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Home');
Expand Down
2 changes: 1 addition & 1 deletion tests/system/View/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace CodeIgniter\View;

use CodeIgniter\Exceptions\RuntimeException;
use CodeIgniter\Autoloader\FileLocatorInterface;
use CodeIgniter\Exceptions\RuntimeException;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\View\Exceptions\ViewException;
use Config;
Expand Down
Loading