Skip to content
Open
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/HTTP/Files/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function __construct(string $path, string $originalName, ?string $mimeTyp
* @param bool $overwrite State for indicating whether to overwrite the previously generated file with the same
* name or not.
*
* @return bool
* @return static
*/
public function move(string $targetPath, ?string $name = null, bool $overwrite = false)
{
Expand Down Expand Up @@ -172,7 +172,7 @@ public function move(string $targetPath, ?string $name = null, bool $overwrite =
$this->path = $targetPath;
$this->name = basename($destination);

return true;
return $this;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion system/HTTP/Files/UploadedFileInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(string $path, string $originalName, ?string $mimeTyp
* @param string $targetPath Path to which to move the uploaded file.
* @param string|null $name the name to rename the file to.
*
* @return bool
* @return static
*
* @throws InvalidArgumentException if the $path specified is invalid.
* @throws RuntimeException on the second or subsequent call to the method.
Expand Down
2 changes: 0 additions & 2 deletions system/HTTP/IncomingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class IncomingRequest extends Request
* everything this cares about (and the router, etc) is the portion
* AFTER the baseURL. So, if hosted in a sub-folder this will
* appear different than actual URI path. If you need that use getPath().
*
* @var URI
*/
protected $uri;

Expand Down
6 changes: 3 additions & 3 deletions system/HTTP/OutgoingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class OutgoingRequest extends Message implements OutgoingRequestInterface
/**
* A URI instance.
*
* @var URI|null
* @var URI
*/
protected $uri;

Expand All @@ -40,7 +40,7 @@ class OutgoingRequest extends Message implements OutgoingRequestInterface
*/
public function __construct(
string $method,
?URI $uri = null,
URI $uri,
array $headers = [],
$body = null,
string $version = '1.1',
Expand Down Expand Up @@ -109,7 +109,7 @@ public function withMethod($method)
/**
* Retrieves the URI instance.
*
* @return URI|null
* @return URI
*/
public function getUri()
{
Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/changelogs/v4.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ update your implementations to include the new methods or method changes to ensu
- **Cache:** ``CodeIgniter\Cache\CacheInterface::remember()`` now accepts a TTL callable. Custom implementations of ``CacheInterface`` must update the ``$ttl`` parameter type from ``int`` to ``callable|int``.
- **Database:** ``CodeIgniter\Database\ConnectionInterface`` now requires the ``afterCommit()``, ``afterRollback()``, ``inTransaction()``, and ``transaction()`` methods.
- **HTTP:** ``CodeIgniter\HTTP\ResponseInterface`` now requires the ``stream()`` and ``eventStream()`` methods, which create streaming and SSE responses. See :ref:`streaming-responses`.
- **HTTP:** ``CodeIgniter\HTTP\Files\UploadedFileInterface::move()`` now returns ``static`` instead of ``bool``. The previous ``bool`` return was incompatible with ``CodeIgniter\Files\File::move()``, which ``UploadedFile`` extends, so no implementation could satisfy both.
- **Logging:** ``CodeIgniter\Log\Handlers\HandlerInterface::handle()`` now requires a third parameter ``array $context = []``. Any custom log handler that overrides ``handle()`` - whether implementing ``HandlerInterface`` directly or extending a built-in handler class - must add the parameter to its ``handle()`` method signature.
- **Security:** The ``SecurityInterface``'s ``verify()`` method now has a native return type of ``static``.
- **Validation:** ``CodeIgniter\Validation\ValidationInterface`` now requires the ``getValidatedInput()`` method, which returns a ``CodeIgniter\Input\ValidatedInput`` instance.
Expand All @@ -73,6 +74,7 @@ Method Signature Changes
- **Config:** ``CodeIgniter\Config\Services::request()`` no longer accepts any parameter.
- **Database:** The following methods have had their signatures updated to remove deprecated parameters:
- ``CodeIgniter\Database\Forge::_createTable()`` no longer accepts the deprecated ``$ifNotExists`` parameter. The method signature is now ``_createTable(string $table, array $attributes)``.
- **HTTP:** ``CodeIgniter\HTTP\OutgoingRequest::__construct()`` now requires the ``$uri`` parameter, which was previously ``?URI $uri = null``. Omitting it never worked, as the constructor dereferences the URI to set the ``Host`` header. Consequently ``OutgoingRequest::getUri()`` now returns ``URI`` instead of ``URI|null``, matching ``OutgoingRequestInterface``.
- **Model:** ``CodeIgniter\BaseModel`` now requires the ``chunkRows()``, ``chunkById()``, and ``chunkRowsById()`` methods. Custom classes extending ``BaseModel`` directly must implement them.
- **Session:** The ``$max_lifetime`` parameter of the following ``gc()`` methods now has the native ``int`` type, matching ``SessionHandlerInterface``: ``ArrayHandler::gc()``, ``DatabaseHandler::gc()``, ``FileHandler::gc()``, ``MemcachedHandler::gc()``, ``PostgreHandler::gc()``, ``RedisHandler::gc()``.

Expand Down
3 changes: 1 addition & 2 deletions utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 1492 errors
# total 1489 errors

includes:
- argument.type.neon
Expand All @@ -8,7 +8,6 @@ includes:
- deadCode.unreachable.neon
- function.resultUnused.neon
- method.childParameterType.neon
- method.childReturnType.neon
- method.notFound.neon
- missingType.callable.neon
- missingType.iterableValue.neon
Expand Down
13 changes: 0 additions & 13 deletions utils/phpstan-baseline/method.childReturnType.neon

This file was deleted.

7 changes: 1 addition & 6 deletions utils/phpstan-baseline/property.phpDocType.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 41 errors
# total 40 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -147,11 +147,6 @@ parameters:
count: 1
path: ../../system/HTTP/Files/UploadedFile.php

-
message: '#^PHPDoc type CodeIgniter\\HTTP\\URI of property CodeIgniter\\HTTP\\IncomingRequest\:\:\$uri is not the same as PHPDoc type CodeIgniter\\HTTP\\URI\|null of overridden property CodeIgniter\\HTTP\\OutgoingRequest\:\:\$uri\.$#'
count: 1
path: ../../system/HTTP/IncomingRequest.php

-
message: '#^PHPDoc type string of property CodeIgniter\\Session\\Handlers\\FileHandler\:\:\$savePath is not the same as PHPDoc type array\<string, mixed\>\|string of overridden property CodeIgniter\\Session\\Handlers\\BaseHandler\:\:\$savePath\.$#'
count: 1
Expand Down
Loading