Skip to content

Commit

Permalink
refactor!: remove deprecated properties and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 17, 2023
1 parent 14e6da7 commit 6890e5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 58 deletions.
56 changes: 0 additions & 56 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,6 @@ class CodeIgniter
*/
protected static $cacheTTL = 0;

/**
* Request path to use.
*
* @var string
*
* @deprecated No longer used.
*/
protected $path;

/**
* Should the Response instance "pretend"
* to keep from setting headers/cookies/etc
*
* @var bool
*
* @deprecated No longer used.
*/
protected $useSafeOutput = false;

/**
* Context
* web: Invoked by HTTP request
Expand Down Expand Up @@ -385,22 +366,6 @@ public function run(?RouteCollectionInterface $routes = null, bool $returnRespon
$this->sendResponse();
}

/**
* Set our Response instance to "pretend" mode so that things like
* cookies and headers are not actually sent, allowing PHP 7.2+ to
* not complain when ini_set() function is used.
*
* @return $this
*
* @deprecated No longer used.
*/
public function useSafeOutput(bool $safe = true)
{
$this->useSafeOutput = $safe;

return $this;
}

/**
* Invoked via php-cli command?
*/
Expand Down Expand Up @@ -846,30 +811,9 @@ protected function tryToRouteIt(?RouteCollectionInterface $routes = null)
*/
protected function determinePath()
{
if (! empty($this->path)) {
return $this->path;
}

return method_exists($this->request, 'getPath') ? $this->request->getPath() : $this->request->getUri()->getPath();
}

/**
* Allows the request path to be set from outside the class,
* instead of relying on CLIRequest or IncomingRequest for the path.
*
* This is not used now.
*
* @return $this
*
* @deprecated No longer used.
*/
public function setPath(string $path)
{
$this->path = $path;

return $this;
}

/**
* Now that everything has been setup, this method attempts to run the
* controller method and make the script go. If it's not able to, will
Expand Down
4 changes: 2 additions & 2 deletions tests/system/CodeIgniterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function testRunEmptyDefaultRouteReturnResponse(): void
$_SERVER['argv'] = ['index.php'];
$_SERVER['argc'] = 1;

$response = $this->codeigniter->useSafeOutput(true)->run(null, true);
$response = $this->codeigniter->run(null, true);

$this->assertStringContainsString('Welcome to CodeIgniter', $response->getBody());
}
Expand Down Expand Up @@ -164,7 +164,7 @@ public function testRun404OverrideReturnResponse(): void
$router = Services::router($routes, Services::incomingrequest());
Services::injectMock('router', $router);

$response = $this->codeigniter->useSafeOutput(true)->run($routes, true);
$response = $this->codeigniter->run($routes, true);

$this->assertStringContainsString('Oops', $response->getBody());
}
Expand Down

0 comments on commit 6890e5c

Please sign in to comment.