Upgrade to 4.2.0

This commit is contained in:
Bastian Allgeier
2024-04-10 11:09:52 +02:00
parent 77d9337371
commit 7f4eb7509d
88 changed files with 1187 additions and 490 deletions

View File

@@ -1616,12 +1616,12 @@ class SimpleImage
* @param int $width The ellipse width.
* @param int $height The ellipse height.
* @param string|array $color The ellipse color.
* @param int|array $thickness Line thickness in pixels or 'filled' (default 1).
* @param string|int|array $thickness Line thickness in pixels or 'filled' (default 1).
* @return SimpleImage
*
* @throws Exception
*/
public function ellipse(int $x, int $y, int $width, int $height, string|array $color, int|array $thickness = 1): static
public function ellipse(int $x, int $y, int $width, int $height, string|array $color, string|int|array $thickness = 1): static
{
// Allocate the color
$tempColor = $this->allocateColor($color);
@@ -2337,18 +2337,24 @@ class SimpleImage
$hex = strval(preg_replace('/^#/', '', $color));
// Support short and standard hex codes
if (strlen($hex) === 3) {
if (strlen($hex) === 3 || strlen($hex) === 4) {
[$red, $green, $blue] = [
$hex[0].$hex[0],
$hex[1].$hex[1],
$hex[2].$hex[2],
];
} elseif (strlen($hex) === 6) {
if (strlen($hex) === 4) {
$alpha = hexdec($hex[3]) / 255;
}
} elseif (strlen($hex) === 6 || strlen($hex) === 8) {
[$red, $green, $blue] = [
$hex[0].$hex[1],
$hex[2].$hex[3],
$hex[4].$hex[5],
];
if (strlen($hex) === 8) {
$alpha = hexdec($hex[6].$hex[7]) / 255;
}
} else {
throw new Exception("Invalid color value: $color", self::ERR_INVALID_COLOR);
}

View File

@@ -64,17 +64,17 @@
},
{
"name": "claviska/simpleimage",
"version": "4.0.6",
"version_normalized": "4.0.6.0",
"version": "4.1.0",
"version_normalized": "4.1.0.0",
"source": {
"type": "git",
"url": "https://github.com/claviska/SimpleImage.git",
"reference": "969de5e61810ef91f6f83c475b192c4841367dfa"
"reference": "1dcb9c785c44960890970d26e25c437a2a252bbf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/969de5e61810ef91f6f83c475b192c4841367dfa",
"reference": "969de5e61810ef91f6f83c475b192c4841367dfa",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/1dcb9c785c44960890970d26e25c437a2a252bbf",
"reference": "1dcb9c785c44960890970d26e25c437a2a252bbf",
"shasum": ""
},
"require": {
@@ -86,7 +86,7 @@
"laravel/pint": "^1.5",
"phpstan/phpstan": "^1.10"
},
"time": "2023-07-27T16:48:12+00:00",
"time": "2024-03-04T15:41:11+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -108,7 +108,7 @@
"description": "A PHP class that makes working with images as simple as possible.",
"support": {
"issues": "https://github.com/claviska/SimpleImage/issues",
"source": "https://github.com/claviska/SimpleImage/tree/4.0.6"
"source": "https://github.com/claviska/SimpleImage/tree/4.1.0"
},
"funding": [
{
@@ -721,17 +721,17 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.28.0",
"version_normalized": "1.28.0.0",
"version": "v1.29.0",
"version_normalized": "1.29.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"
"reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4",
"reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4",
"shasum": ""
},
"require": {
@@ -743,12 +743,9 @@
"suggest": {
"ext-ctype": "For best performance"
},
"time": "2023-01-26T09:26:14+00:00",
"time": "2024-01-29T20:11:03+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -786,7 +783,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0"
},
"funding": [
{
@@ -806,17 +803,17 @@
},
{
"name": "symfony/polyfill-intl-idn",
"version": "v1.28.0",
"version_normalized": "1.28.0.0",
"version": "v1.29.0",
"version_normalized": "1.29.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "ecaafce9f77234a6a449d29e49267ba10499116d"
"reference": "a287ed7475f85bf6f61890146edbc932c0fff919"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/ecaafce9f77234a6a449d29e49267ba10499116d",
"reference": "ecaafce9f77234a6a449d29e49267ba10499116d",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a287ed7475f85bf6f61890146edbc932c0fff919",
"reference": "a287ed7475f85bf6f61890146edbc932c0fff919",
"shasum": ""
},
"require": {
@@ -827,12 +824,9 @@
"suggest": {
"ext-intl": "For best performance"
},
"time": "2023-01-26T09:30:37+00:00",
"time": "2024-01-29T20:11:03+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -876,7 +870,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.28.0"
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.29.0"
},
"funding": [
{
@@ -896,17 +890,17 @@
},
{
"name": "symfony/polyfill-intl-normalizer",
"version": "v1.28.0",
"version_normalized": "1.28.0.0",
"version": "v1.29.0",
"version_normalized": "1.29.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
"reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92"
"reference": "bc45c394692b948b4d383a08d7753968bed9a83d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92",
"reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d",
"reference": "bc45c394692b948b4d383a08d7753968bed9a83d",
"shasum": ""
},
"require": {
@@ -915,12 +909,9 @@
"suggest": {
"ext-intl": "For best performance"
},
"time": "2023-01-26T09:26:14+00:00",
"time": "2024-01-29T20:11:03+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -963,7 +954,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0"
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0"
},
"funding": [
{
@@ -983,17 +974,17 @@
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.28.0",
"version_normalized": "1.28.0.0",
"version": "v1.29.0",
"version_normalized": "1.29.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "42292d99c55abe617799667f454222c54c60e229"
"reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229",
"reference": "42292d99c55abe617799667f454222c54c60e229",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"shasum": ""
},
"require": {
@@ -1005,12 +996,9 @@
"suggest": {
"ext-mbstring": "For best performance"
},
"time": "2023-07-28T09:04:16+00:00",
"time": "2024-01-29T20:11:03+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -1049,7 +1037,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
},
"funding": [
{
@@ -1069,17 +1057,17 @@
},
{
"name": "symfony/yaml",
"version": "v6.4.0",
"version_normalized": "6.4.0.0",
"version": "v6.4.3",
"version_normalized": "6.4.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "4f9237a1bb42455d609e6687d2613dde5b41a587"
"reference": "d75715985f0f94f978e3a8fa42533e10db921b90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4f9237a1bb42455d609e6687d2613dde5b41a587",
"reference": "4f9237a1bb42455d609e6687d2613dde5b41a587",
"url": "https://api.github.com/repos/symfony/yaml/zipball/d75715985f0f94f978e3a8fa42533e10db921b90",
"reference": "d75715985f0f94f978e3a8fa42533e10db921b90",
"shasum": ""
},
"require": {
@@ -1093,7 +1081,7 @@
"require-dev": {
"symfony/console": "^5.4|^6.0|^7.0"
},
"time": "2023-11-06T11:00:25+00:00",
"time": "2024-01-23T14:51:35+00:00",
"bin": [
"Resources/bin/yaml-lint"
],
@@ -1124,7 +1112,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v6.4.0"
"source": "https://github.com/symfony/yaml/tree/v6.4.3"
},
"funding": [
{

View File

@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'getkirby/cms',
'pretty_version' => '4.1.2',
'version' => '4.1.2.0',
'pretty_version' => '4.2.0',
'version' => '4.2.0.0',
'reference' => null,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
@@ -20,9 +20,9 @@
'dev_requirement' => false,
),
'claviska/simpleimage' => array(
'pretty_version' => '4.0.6',
'version' => '4.0.6.0',
'reference' => '969de5e61810ef91f6f83c475b192c4841367dfa',
'pretty_version' => '4.1.0',
'version' => '4.1.0.0',
'reference' => '1dcb9c785c44960890970d26e25c437a2a252bbf',
'type' => 'library',
'install_path' => __DIR__ . '/../claviska/simpleimage',
'aliases' => array(),
@@ -47,8 +47,8 @@
'dev_requirement' => false,
),
'getkirby/cms' => array(
'pretty_version' => '4.1.2',
'version' => '4.1.2.0',
'pretty_version' => '4.2.0',
'version' => '4.2.0.0',
'reference' => null,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
@@ -125,36 +125,36 @@
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.28.0',
'version' => '1.28.0.0',
'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb',
'pretty_version' => 'v1.29.0',
'version' => '1.29.0.0',
'reference' => 'ef4d7e442ca910c4764bce785146269b30cb5fc4',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-intl-idn' => array(
'pretty_version' => 'v1.28.0',
'version' => '1.28.0.0',
'reference' => 'ecaafce9f77234a6a449d29e49267ba10499116d',
'pretty_version' => 'v1.29.0',
'version' => '1.29.0.0',
'reference' => 'a287ed7475f85bf6f61890146edbc932c0fff919',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-intl-normalizer' => array(
'pretty_version' => 'v1.28.0',
'version' => '1.28.0.0',
'reference' => '8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92',
'pretty_version' => 'v1.29.0',
'version' => '1.29.0.0',
'reference' => 'bc45c394692b948b4d383a08d7753968bed9a83d',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
'pretty_version' => 'v1.28.0',
'version' => '1.28.0.0',
'reference' => '42292d99c55abe617799667f454222c54c60e229',
'pretty_version' => 'v1.29.0',
'version' => '1.29.0.0',
'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
@@ -167,9 +167,9 @@
),
),
'symfony/yaml' => array(
'pretty_version' => 'v6.4.0',
'version' => '6.4.0.0',
'reference' => '4f9237a1bb42455d609e6687d2613dde5b41a587',
'pretty_version' => 'v6.4.3',
'version' => '6.4.3.0',
'reference' => 'd75715985f0f94f978e3a8fa42533e10db921b90',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/yaml',
'aliases' => array(),

View File

@@ -30,9 +30,6 @@
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"

View File

@@ -33,9 +33,6 @@
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"

View File

@@ -28,9 +28,6 @@
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"

View File

@@ -30,9 +30,6 @@
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"

View File

@@ -42,7 +42,7 @@ class LintCommand extends Command
private ?\Closure $directoryIteratorProvider;
private ?\Closure $isReadableProvider;
public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null)
public function __construct(?string $name = null, ?callable $directoryIteratorProvider = null, ?callable $isReadableProvider = null)
{
parent::__construct($name);
@@ -127,7 +127,7 @@ EOF
return $this->display($io, $filesInfo);
}
private function validate(string $content, int $flags, string $file = null): array
private function validate(string $content, int $flags, ?string $file = null): array
{
$prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) {
if (\E_USER_DEPRECATED === $level) {

View File

@@ -29,7 +29,7 @@ class ParseException extends RuntimeException
* @param string|null $snippet The snippet of code near the problem
* @param string|null $parsedFile The file name where the error occurred
*/
public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null)
public function __construct(string $message, int $parsedLine = -1, ?string $snippet = null, ?string $parsedFile = null, ?\Throwable $previous = null)
{
$this->parsedFile = $parsedFile;
$this->parsedLine = $parsedLine;

View File

@@ -34,7 +34,7 @@ class Inline
private static bool $objectForMap = false;
private static bool $constantSupport = false;
public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null): void
public static function initialize(int $flags, ?int $parsedLineNumber = null, ?string $parsedFilename = null): void
{
self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags);
self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags);
@@ -267,7 +267,7 @@ class Inline
*
* @throws ParseException When malformed inline YAML string is parsed
*/
public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null): mixed
public static function parseScalar(string $scalar, int $flags = 0, ?array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], ?bool &$isQuoted = null): mixed
{
if (\in_array($scalar[$i], ['"', "'"], true)) {
// quoted scalar
@@ -556,7 +556,7 @@ class Inline
*
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved
*/
private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null): mixed
private static function evaluateScalar(string $scalar, int $flags, array &$references = [], ?bool &$isQuotedString = null): mixed
{
$isQuotedString = false;
$scalar = trim($scalar);

View File

@@ -561,7 +561,7 @@ class Parser
*
* @throws ParseException When indentation problem are detected
*/
private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): string
private function getNextEmbedBlock(?int $indentation = null, bool $inSequence = false): string
{
$oldLineIndentation = $this->getCurrentLineIndentation();
@@ -1043,7 +1043,7 @@ class Parser
*
* @internal
*/
public static function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int
public static function preg_match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int
{
if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) {
throw new ParseException(preg_last_error_msg());