Skip to content

Commit

Permalink
Merge pull request #7998 from kenjis/refactor-service-request
Browse files Browse the repository at this point in the history
refactor: replace deprecated `Services::request(config, false)`
  • Loading branch information
kenjis authored Oct 10, 2023
2 parents eb1e7f6 + 93001f1 commit ff5185a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion system/Commands/Utilities/Routes/FilterCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function get(string $method, string $uri): array
];
}

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

$router = $this->createRouter($request);
Expand Down
4 changes: 2 additions & 2 deletions system/Test/ControllerTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ protected function setUpControllerTestTrait(): void
}

if (empty($this->request)) {
// Do some acrobatics so we can use the Request service with our own URI
// Do some acrobatics, so we can use the Request service with our own URI
$tempUri = Services::uri();
Services::injectMock('uri', $this->uri);

$this->withRequest(Services::request($this->appConfig, false));
$this->withRequest(Services::incomingrequest($this->appConfig, false));

// Restore the URI service
Services::injectMock('uri', $tempUri);
Expand Down
2 changes: 1 addition & 1 deletion system/Test/ControllerTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected function setUpControllerTester(): void
$tempUri = Services::uri();
Services::injectMock('uri', $this->uri);

$this->withRequest(Services::request($this->appConfig, false)->setBody($this->body));
$this->withRequest(Services::incomingrequest($this->appConfig, false)->setBody($this->body));

// Restore the URI service
Services::injectMock('uri', $tempUri);
Expand Down
2 changes: 1 addition & 1 deletion system/Test/FeatureTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ protected function setupRequest(string $method, ?string $path = null): IncomingR

Services::injectMock('uri', $uri);

$request = Services::request($config, false);
$request = Services::incomingrequest($config, false);

$request->setMethod($method);
$request->setProtocolVersion('1.1');
Expand Down

0 comments on commit ff5185a

Please sign in to comment.