-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
43 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ jobs: | |
php-version: | ||
- "8.2" | ||
- "8.3" | ||
- "8.4" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the ICanBoogie package. | ||
* | ||
* (c) Olivier Laviale <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ICanBoogie\HTTP; | ||
|
||
use ICanBoogie\Accessor\AccessorTrait; | ||
|
@@ -37,8 +28,8 @@ | |
* | ||
* @property-read string $name Name of the file. | ||
* @property-read string $type MIME type of the file. | ||
* @property-read string $size Size of the file. | ||
* @property-read string $error Error code, one of `UPLOAD_ERR_*`. | ||
* @property-read int|false $size Size of the file. | ||
* @property-read int|null $error Error code, one of `UPLOAD_ERR_*`. | ||
* @property-read string $error_message A formatted message representing the error. | ||
* @property-read string $pathname Pathname of the file. | ||
* @property-read string $extension The extension of the file. If any, the dot is included e.g. | ||
|
@@ -116,17 +107,15 @@ private static function filter_initial_properties(array $properties): array | |
* | ||
* @param string $format The format of the string. | ||
* @param array $args The arguments. | ||
* @param array $options Some options. | ||
* | ||
* @return FormattedString|string | ||
*/ | ||
private static function format( | ||
string $format, | ||
array $args = [], | ||
array $options = [] | ||
): string|FormattedString { | ||
if (class_exists(FormattedString::class, true)) { | ||
return new FormattedString($format, $args, $options); | ||
if (class_exists(FormattedString::class)) { | ||
return new FormattedString($format, $args); | ||
} | ||
|
||
return format($format, $args); // @codeCoverageIgnore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the ICanBoogie package. | ||
* | ||
* (c) Olivier Laviale <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ICanBoogie\HTTP; | ||
|
||
use ICanBoogie\DateTime; | ||
|
@@ -332,11 +323,6 @@ private function make_etag(): string | |
return self::hash_file($this->file->getPathname()); | ||
} | ||
|
||
private function ensure_etag(): string | ||
{ | ||
return $this->headers->etag ??= $this->make_etag(); | ||
} | ||
|
||
/** | ||
* If the date returned by the parent is empty the method returns a date created from | ||
* {@link DEFAULT_EXPIRES}. | ||
|
@@ -349,7 +335,7 @@ protected function get_expires(): Headers\Date | |
return $expires; | ||
} | ||
|
||
return Headers\Date::from(self::DEFAULT_EXPIRES); // @phpstan-ignore-line | ||
return Headers\Date::from(self::DEFAULT_EXPIRES); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the ICanBoogie package. | ||
* | ||
* (c) Olivier Laviale <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ICanBoogie\HTTP\Headers; | ||
|
||
use DateTimeInterface; | ||
|
@@ -27,8 +18,7 @@ class Date extends DateTime | |
public static function from( | ||
self|\DateTime|string|null $source, | ||
DateTimeZone|string|null $timezone = null | ||
): static | ||
{ | ||
): static { | ||
if ($source === null) { | ||
return static::none(); | ||
} | ||
|
@@ -62,7 +52,7 @@ public function __construct($time = 'now', $timezone = null) | |
* | ||
* @inheritdoc | ||
*/ | ||
public function __toString() | ||
public function __toString(): string | ||
{ | ||
return $this->is_empty ? '' : $this->utc->as_rfc1123; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the ICanBoogie package. | ||
* | ||
* (c) Olivier Laviale <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ICanBoogie\HTTP; | ||
|
||
use ICanBoogie\DateTime; | ||
|
@@ -259,7 +250,7 @@ public function test_get_is_modified( | |
bool $expected, | ||
array $request_headers, | ||
false|int $modified_time = false, | ||
string $etag = null | ||
?string $etag = null | ||
): void { | ||
$file = create_file(); | ||
if ($modified_time) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters