- *
* @throws LogicException in case the output has been disabled
* @throws LogicException In case the process is not started
*/
@@ -876,7 +872,7 @@ class Process implements \IteratorAggregate
* Stops the process.
*
* @param int|float $timeout The timeout in seconds
- * @param int|null $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9)
+ * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9)
*
* @return int|null The exit-code of the process or null if it's not running
*/
@@ -914,7 +910,7 @@ class Process implements \IteratorAggregate
*
* @internal
*/
- public function addOutput(string $line): void
+ public function addOutput(string $line)
{
$this->lastOutputTime = microtime(true);
@@ -928,7 +924,7 @@ class Process implements \IteratorAggregate
*
* @internal
*/
- public function addErrorOutput(string $line): void
+ public function addErrorOutput(string $line)
{
$this->lastOutputTime = microtime(true);
@@ -950,7 +946,7 @@ class Process implements \IteratorAggregate
*/
public function getCommandLine(): string
{
- return \is_array($this->commandline) ? implode(' ', array_map($this->escapeArgument(...), $this->commandline)) : $this->commandline;
+ return \is_array($this->commandline) ? implode(' ', array_map([$this, 'escapeArgument'], $this->commandline)) : $this->commandline;
}
/**
@@ -1142,8 +1138,6 @@ class Process implements \IteratorAggregate
* In case you run a background process (with the start method), you should
* trigger this method regularly to ensure the process timeout
*
- * @return void
- *
* @throws ProcessTimedOutException In case the timeout was reached
*/
public function checkTimeout()
@@ -1184,8 +1178,6 @@ class Process implements \IteratorAggregate
*
* Enabling the "create_new_console" option allows a subprocess to continue
* to run after the main process exited, on both Windows and *nix
- *
- * @return void
*/
public function setOptions(array $options)
{
@@ -1212,7 +1204,11 @@ class Process implements \IteratorAggregate
{
static $isTtySupported;
- return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT));
+ if (null === $isTtySupported) {
+ $isTtySupported = (bool) @proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes);
+ }
+
+ return $isTtySupported;
}
/**
@@ -1261,7 +1257,9 @@ class Process implements \IteratorAggregate
protected function buildCallback(callable $callback = null): \Closure
{
if ($this->outputDisabled) {
- return fn ($type, $data): bool => null !== $callback && $callback($type, $data);
+ return function ($type, $data) use ($callback): bool {
+ return null !== $callback && $callback($type, $data);
+ };
}
$out = self::OUT;
@@ -1281,8 +1279,6 @@ class Process implements \IteratorAggregate
* Updates the status of the process, reads pipes.
*
* @param bool $blocking Whether to use a blocking read call
- *
- * @return void
*/
protected function updateStatus(bool $blocking)
{
@@ -1331,7 +1327,7 @@ class Process implements \IteratorAggregate
*
* @throws LogicException in case output has been disabled or process is not started
*/
- private function readPipesForOutput(string $caller, bool $blocking = false): void
+ private function readPipesForOutput(string $caller, bool $blocking = false)
{
if ($this->outputDisabled) {
throw new LogicException('Output has been disabled.');
@@ -1366,7 +1362,7 @@ class Process implements \IteratorAggregate
* @param bool $blocking Whether to use blocking calls or not
* @param bool $close Whether to close file handles or not
*/
- private function readPipes(bool $blocking, bool $close): void
+ private function readPipes(bool $blocking, bool $close)
{
$result = $this->processPipes->readAndWrite($blocking, $close);
@@ -1415,7 +1411,7 @@ class Process implements \IteratorAggregate
/**
* Resets data related to the latest run of the process.
*/
- private function resetProcessData(): void
+ private function resetProcessData()
{
$this->starttime = null;
$this->callback = null;
@@ -1488,6 +1484,8 @@ class Process implements \IteratorAggregate
private function prepareWindowsCommandLine(string $cmd, array &$env): string
{
$uid = uniqid('', true);
+ $varCount = 0;
+ $varCache = [];
$cmd = preg_replace_callback(
'/"(?:(
[^"%!^]*+
@@ -1496,9 +1494,7 @@ class Process implements \IteratorAggregate
[^"%!^]*+
)++
) | [^"]*+ )"/x',
- function ($m) use (&$env, $uid) {
- static $varCount = 0;
- static $varCache = [];
+ function ($m) use (&$env, &$varCache, &$varCount, $uid) {
if (!isset($m[1])) {
return $m[0];
}
@@ -1536,7 +1532,7 @@ class Process implements \IteratorAggregate
*
* @throws LogicException if the process has not run
*/
- private function requireProcessIsStarted(string $functionName): void
+ private function requireProcessIsStarted(string $functionName)
{
if (!$this->isStarted()) {
throw new LogicException(sprintf('Process must be started before calling "%s()".', $functionName));
@@ -1548,7 +1544,7 @@ class Process implements \IteratorAggregate
*
* @throws LogicException if the process is not yet terminated
*/
- private function requireProcessIsTerminated(string $functionName): void
+ private function requireProcessIsTerminated(string $functionName)
{
if (!$this->isTerminated()) {
throw new LogicException(sprintf('Process must be terminated before calling "%s()".', $functionName));
@@ -1577,7 +1573,7 @@ class Process implements \IteratorAggregate
return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"';
}
- private function replacePlaceholders(string $commandline, array $env): string
+ private function replacePlaceholders(string $commandline, array $env)
{
return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) {
if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) {
diff --git a/vendor/symfony/process/README.md b/vendor/symfony/process/README.md
index afce5e45..8777de4a 100644
--- a/vendor/symfony/process/README.md
+++ b/vendor/symfony/process/README.md
@@ -3,6 +3,17 @@ Process Component
The Process component executes commands in sub-processes.
+Sponsor
+-------
+
+The Process component for Symfony 5.4/6.0 is [backed][1] by [SensioLabs][2].
+
+As the creator of Symfony, SensioLabs supports companies using Symfony, with an
+offering encompassing consultancy, expertise, services, training, and technical
+assistance to ensure the success of web application development projects.
+
+Help Symfony by [sponsoring][3] its development!
+
Resources
---------
@@ -11,3 +22,7 @@ Resources
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
+
+[1]: https://symfony.com/backers
+[2]: https://sensiolabs.com
+[3]: https://symfony.com/sponsor
diff --git a/vendor/symfony/process/composer.json b/vendor/symfony/process/composer.json
index 317c07e7..9f1aa8cf 100644
--- a/vendor/symfony/process/composer.json
+++ b/vendor/symfony/process/composer.json
@@ -16,7 +16,7 @@
}
],
"require": {
- "php": ">=8.1"
+ "php": ">=8.0.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Process\\": "" },
diff --git a/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/vendor/symfony/service-contracts/Attribute/SubscribedService.php
index d98e1dfd..10d1bc38 100644
--- a/vendor/symfony/service-contracts/Attribute/SubscribedService.php
+++ b/vendor/symfony/service-contracts/Attribute/SubscribedService.php
@@ -11,14 +11,9 @@
namespace Symfony\Contracts\Service\Attribute;
-use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\Contracts\Service\ServiceSubscriberTrait;
/**
- * For use as the return value for {@see ServiceSubscriberInterface}.
- *
- * @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi'))
- *
* Use with {@see ServiceSubscriberTrait} to mark a method's return type
* as a subscribed service.
*
@@ -27,21 +22,12 @@ use Symfony\Contracts\Service\ServiceSubscriberTrait;
#[\Attribute(\Attribute::TARGET_METHOD)]
final class SubscribedService
{
- /** @var object[] */
- public array $attributes;
-
/**
- * @param string|null $key The key to use for the service
- * @param class-string|null $type The service class
- * @param bool $nullable Whether the service is optional
- * @param object|object[] $attributes One or more dependency injection attributes to use
+ * @param string|null $key The key to use for the service
+ * If null, use "ClassName::methodName"
*/
public function __construct(
- public ?string $key = null,
- public ?string $type = null,
- public bool $nullable = false,
- array|object $attributes = [],
+ public ?string $key = null
) {
- $this->attributes = \is_array($attributes) ? $attributes : [$attributes];
}
}
diff --git a/vendor/symfony/service-contracts/LICENSE b/vendor/symfony/service-contracts/LICENSE
index 7536caea..74cdc2db 100644
--- a/vendor/symfony/service-contracts/LICENSE
+++ b/vendor/symfony/service-contracts/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2018-present Fabien Potencier
+Copyright (c) 2018-2022 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/symfony/service-contracts/README.md b/vendor/symfony/service-contracts/README.md
index 42841a57..41e054a1 100644
--- a/vendor/symfony/service-contracts/README.md
+++ b/vendor/symfony/service-contracts/README.md
@@ -3,7 +3,7 @@ Symfony Service Contracts
A set of abstractions extracted out of the Symfony components.
-Can be used to build on semantics that the Symfony components proved useful and
+Can be used to build on semantics that the Symfony components proved useful - and
that already have battle tested implementations.
See https://github.com/symfony/contracts/blob/main/README.md for more information.
diff --git a/vendor/symfony/service-contracts/ResetInterface.php b/vendor/symfony/service-contracts/ResetInterface.php
index a4f389b0..1af1075e 100644
--- a/vendor/symfony/service-contracts/ResetInterface.php
+++ b/vendor/symfony/service-contracts/ResetInterface.php
@@ -26,8 +26,5 @@ namespace Symfony\Contracts\Service;
*/
interface ResetInterface
{
- /**
- * @return void
- */
public function reset();
}
diff --git a/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/vendor/symfony/service-contracts/ServiceLocatorTrait.php
index 45c8d910..19d3e80f 100644
--- a/vendor/symfony/service-contracts/ServiceLocatorTrait.php
+++ b/vendor/symfony/service-contracts/ServiceLocatorTrait.php
@@ -38,11 +38,17 @@ trait ServiceLocatorTrait
$this->factories = $factories;
}
+ /**
+ * {@inheritdoc}
+ */
public function has(string $id): bool
{
return isset($this->factories[$id]);
}
+ /**
+ * {@inheritdoc}
+ */
public function get(string $id): mixed
{
if (!isset($this->factories[$id])) {
@@ -65,6 +71,9 @@ trait ServiceLocatorTrait
}
}
+ /**
+ * {@inheritdoc}
+ */
public function getProvidedServices(): array
{
if (!isset($this->providedTypes)) {
diff --git a/vendor/symfony/service-contracts/ServiceProviderInterface.php b/vendor/symfony/service-contracts/ServiceProviderInterface.php
index c05e4bfe..c60ad0bd 100644
--- a/vendor/symfony/service-contracts/ServiceProviderInterface.php
+++ b/vendor/symfony/service-contracts/ServiceProviderInterface.php
@@ -18,18 +18,9 @@ use Psr\Container\ContainerInterface;
*
* @author Nicolas Grekas
* @author Mateusz Sip
- *
- * @template-covariant T of mixed
*/
interface ServiceProviderInterface extends ContainerInterface
{
- /**
- * @return T
- */
- public function get(string $id): mixed;
-
- public function has(string $id): bool;
-
/**
* Returns an associative array of service types keyed by the identifiers provided by the current container.
*
diff --git a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php
index 3da19169..881ab971 100644
--- a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php
+++ b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php
@@ -11,8 +11,6 @@
namespace Symfony\Contracts\Service;
-use Symfony\Contracts\Service\Attribute\SubscribedService;
-
/**
* A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method.
*
@@ -31,8 +29,7 @@ use Symfony\Contracts\Service\Attribute\SubscribedService;
interface ServiceSubscriberInterface
{
/**
- * Returns an array of service types (or {@see SubscribedService} objects) required
- * by such instances, optionally keyed by the service names used internally.
+ * Returns an array of service types required by such instances, optionally keyed by the service names used internally.
*
* For mandatory dependencies:
*
@@ -50,13 +47,7 @@ interface ServiceSubscriberInterface
* * ['?Psr\Log\LoggerInterface'] is a shortcut for
* * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface']
*
- * additionally, an array of {@see SubscribedService}'s can be returned:
- *
- * * [new SubscribedService('logger', Psr\Log\LoggerInterface::class)]
- * * [new SubscribedService(type: Psr\Log\LoggerInterface::class, nullable: true)]
- * * [new SubscribedService('http_client', HttpClientInterface::class, attributes: new Target('githubApi'))]
- *
- * @return string[]|SubscribedService[] The required service types, optionally keyed by service names
+ * @return string[] The required service types, optionally keyed by service names
*/
public static function getSubscribedServices(): array;
}
diff --git a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php
index f3b450cd..ee9d9d9d 100644
--- a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php
+++ b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php
@@ -12,7 +12,6 @@
namespace Symfony\Contracts\Service;
use Psr\Container\ContainerInterface;
-use Symfony\Contracts\Service\Attribute\Required;
use Symfony\Contracts\Service\Attribute\SubscribedService;
/**
@@ -26,6 +25,9 @@ trait ServiceSubscriberTrait
/** @var ContainerInterface */
protected $container;
+ /**
+ * {@inheritdoc}
+ */
public static function getSubscribedServices(): array
{
$services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : [];
@@ -47,32 +49,29 @@ trait ServiceSubscriberTrait
throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class));
}
- /* @var SubscribedService $attribute */
- $attribute = $attribute->newInstance();
- $attribute->key ??= self::class.'::'.$method->name;
- $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType;
- $attribute->nullable = $returnType->allowsNull();
+ $serviceId = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType;
- if ($attribute->attributes) {
- $services[] = $attribute;
- } else {
- $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type;
+ if ($returnType->allowsNull()) {
+ $serviceId = '?'.$serviceId;
}
+
+ $services[$attribute->newInstance()->key ?? self::class.'::'.$method->name] = $serviceId;
}
return $services;
}
- #[Required]
+ /**
+ * @required
+ */
public function setContainer(ContainerInterface $container): ?ContainerInterface
{
- $ret = null;
- if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) {
- $ret = parent::setContainer($container);
- }
-
$this->container = $container;
- return $ret;
+ if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) {
+ return parent::setContainer($container);
+ }
+
+ return null;
}
}
diff --git a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php
index 07d12b4a..88f6a068 100644
--- a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php
+++ b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php
@@ -11,13 +11,82 @@
namespace Symfony\Contracts\Service\Test;
-class_alias(ServiceLocatorTestCase::class, ServiceLocatorTest::class);
+use PHPUnit\Framework\TestCase;
+use Psr\Container\ContainerInterface;
+use Symfony\Contracts\Service\ServiceLocatorTrait;
-if (false) {
- /**
- * @deprecated since PHPUnit 9.6
- */
- class ServiceLocatorTest
+abstract class ServiceLocatorTest extends TestCase
+{
+ protected function getServiceLocator(array $factories): ContainerInterface
{
+ return new class($factories) implements ContainerInterface {
+ use ServiceLocatorTrait;
+ };
+ }
+
+ public function testHas()
+ {
+ $locator = $this->getServiceLocator([
+ 'foo' => function () { return 'bar'; },
+ 'bar' => function () { return 'baz'; },
+ function () { return 'dummy'; },
+ ]);
+
+ $this->assertTrue($locator->has('foo'));
+ $this->assertTrue($locator->has('bar'));
+ $this->assertFalse($locator->has('dummy'));
+ }
+
+ public function testGet()
+ {
+ $locator = $this->getServiceLocator([
+ 'foo' => function () { return 'bar'; },
+ 'bar' => function () { return 'baz'; },
+ ]);
+
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame('baz', $locator->get('bar'));
+ }
+
+ public function testGetDoesNotMemoize()
+ {
+ $i = 0;
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$i) {
+ ++$i;
+
+ return 'bar';
+ },
+ ]);
+
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame(2, $i);
+ }
+
+ public function testThrowsOnUndefinedInternalService()
+ {
+ if (!$this->getExpectedException()) {
+ $this->expectException(\Psr\Container\NotFoundExceptionInterface::class);
+ $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.');
+ }
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$locator) { return $locator->get('bar'); },
+ ]);
+
+ $locator->get('foo');
+ }
+
+ public function testThrowsOnCircularReference()
+ {
+ $this->expectException(\Psr\Container\ContainerExceptionInterface::class);
+ $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".');
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$locator) { return $locator->get('bar'); },
+ 'bar' => function () use (&$locator) { return $locator->get('baz'); },
+ 'baz' => function () use (&$locator) { return $locator->get('bar'); },
+ ]);
+
+ $locator->get('foo');
}
}
diff --git a/vendor/symfony/service-contracts/composer.json b/vendor/symfony/service-contracts/composer.json
index a64188b5..d3b047f9 100644
--- a/vendor/symfony/service-contracts/composer.json
+++ b/vendor/symfony/service-contracts/composer.json
@@ -16,22 +16,22 @@
}
],
"require": {
- "php": ">=8.1",
+ "php": ">=8.0.2",
"psr/container": "^2.0"
},
"conflict": {
"ext-psr": "<1.1|>=2"
},
+ "suggest": {
+ "symfony/service-implementation": ""
+ },
"autoload": {
- "psr-4": { "Symfony\\Contracts\\Service\\": "" },
- "exclude-from-classmap": [
- "/Test/"
- ]
+ "psr-4": { "Symfony\\Contracts\\Service\\": "" }
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-main": "3.4-dev"
+ "dev-main": "3.0-dev"
},
"thanks": {
"name": "symfony/contracts",
diff --git a/vendor/symfony/stopwatch/LICENSE b/vendor/symfony/stopwatch/LICENSE
index 0138f8f0..00837045 100644
--- a/vendor/symfony/stopwatch/LICENSE
+++ b/vendor/symfony/stopwatch/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-present Fabien Potencier
+Copyright (c) 2004-2023 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/symfony/stopwatch/Stopwatch.php b/vendor/symfony/stopwatch/Stopwatch.php
index 139d6651..3d6c976b 100644
--- a/vendor/symfony/stopwatch/Stopwatch.php
+++ b/vendor/symfony/stopwatch/Stopwatch.php
@@ -57,8 +57,6 @@ class Stopwatch implements ResetInterface
*
* @param string|null $id The id of the session to re-open, null to create a new one
*
- * @return void
- *
* @throws \LogicException When the section to re-open is not reachable
*/
public function openSection(string $id = null)
@@ -81,8 +79,6 @@ class Stopwatch implements ResetInterface
*
* @see getSectionEvents()
*
- * @return void
- *
* @throws \LogicException When there's no started section to be stopped
*/
public function stopSection(string $id)
@@ -149,8 +145,6 @@ class Stopwatch implements ResetInterface
/**
* Resets the stopwatch to its original state.
- *
- * @return void
*/
public function reset()
{
diff --git a/vendor/symfony/stopwatch/StopwatchEvent.php b/vendor/symfony/stopwatch/StopwatchEvent.php
index 3bca2fd6..518937d0 100644
--- a/vendor/symfony/stopwatch/StopwatchEvent.php
+++ b/vendor/symfony/stopwatch/StopwatchEvent.php
@@ -116,8 +116,6 @@ class StopwatchEvent
/**
* Stops all non already stopped periods.
- *
- * @return void
*/
public function ensureStopped()
{
diff --git a/vendor/symfony/stopwatch/composer.json b/vendor/symfony/stopwatch/composer.json
index 4aa02b5f..bb68c24d 100644
--- a/vendor/symfony/stopwatch/composer.json
+++ b/vendor/symfony/stopwatch/composer.json
@@ -16,8 +16,8 @@
}
],
"require": {
- "php": ">=8.1",
- "symfony/service-contracts": "^2.5|^3"
+ "php": ">=8.0.2",
+ "symfony/service-contracts": "^1|^2|^3"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Stopwatch\\": "" },
diff --git a/vendor/symfony/string/AbstractString.php b/vendor/symfony/string/AbstractString.php
index bf491f88..cf96a837 100644
--- a/vendor/symfony/string/AbstractString.php
+++ b/vendor/symfony/string/AbstractString.php
@@ -74,7 +74,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
foreach ($values as $k => $v) {
if (\is_string($k) && '' !== $k && $k !== $j = (string) new static($k)) {
- $keys ??= array_keys($values);
+ $keys = $keys ?? array_keys($values);
$keys[$i] = $j;
}
@@ -452,7 +452,15 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
try {
if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) {
- throw new RuntimeException('Splitting failed with error: '.preg_last_error_msg());
+ $lastError = preg_last_error();
+
+ foreach (get_defined_constants(true)['pcre'] as $k => $v) {
+ if ($lastError === $v && '_ERROR' === substr($k, -6)) {
+ throw new RuntimeException('Splitting failed with '.$k.'.');
+ }
+ }
+
+ throw new RuntimeException('Splitting failed with unknown error code.');
}
} finally {
restore_error_handler();
@@ -550,7 +558,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
*/
public function trimPrefix($prefix): static
{
- if (\is_array($prefix) || $prefix instanceof \Traversable) { // don't use is_iterable(), it's slow
+ if (\is_array($prefix) || $prefix instanceof \Traversable) {
foreach ($prefix as $s) {
$t = $this->trimPrefix($s);
@@ -584,7 +592,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
*/
public function trimSuffix($suffix): static
{
- if (\is_array($suffix) || $suffix instanceof \Traversable) { // don't use is_iterable(), it's slow
+ if (\is_array($suffix) || $suffix instanceof \Traversable) {
foreach ($suffix as $s) {
$t = $this->trimSuffix($s);
diff --git a/vendor/symfony/string/AbstractUnicodeString.php b/vendor/symfony/string/AbstractUnicodeString.php
index d19a61a9..00096df0 100644
--- a/vendor/symfony/string/AbstractUnicodeString.php
+++ b/vendor/symfony/string/AbstractUnicodeString.php
@@ -37,8 +37,12 @@ abstract class AbstractUnicodeString extends AbstractString
private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
// the subset of folded case mappings that is not in lower case mappings
- private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ'];
- private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ'];
+ private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'İ', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ'];
+ private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'i̇', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ'];
+
+ // the subset of upper case mappings that map one code point to many code points
+ private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ'];
+ private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂'];
// the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD
private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆'];
@@ -117,10 +121,10 @@ abstract class AbstractUnicodeString extends AbstractString
$s = preg_replace("/([AUO])\u{0308}(?=\p{Ll})/u", '$1e', $s);
$s = str_replace(["a\u{0308}", "o\u{0308}", "u\u{0308}", "A\u{0308}", "O\u{0308}", "U\u{0308}"], ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], $s);
} elseif (\function_exists('transliterator_transliterate')) {
- if (null === $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule)) {
+ if (null === $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule)) {
if ('any-latin/bgn' === $rule) {
$rule = 'any-latin';
- $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule);
+ $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule);
}
if (null === $transliterator) {
@@ -155,9 +159,7 @@ abstract class AbstractUnicodeString extends AbstractString
public function camel(): static
{
$str = clone $this;
- $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) {
- static $i = 0;
-
+ $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) {
return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8');
}, preg_replace('/[^\pL0-9]++/u', ' ', $this->string)));
@@ -232,7 +234,15 @@ abstract class AbstractUnicodeString extends AbstractString
try {
if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) {
- throw new RuntimeException('Matching failed with error: '.preg_last_error_msg());
+ $lastError = preg_last_error();
+
+ foreach (get_defined_constants(true)['pcre'] as $k => $v) {
+ if ($lastError === $v && '_ERROR' === substr($k, -6)) {
+ throw new RuntimeException('Matching failed with '.$k.'.');
+ }
+ }
+
+ throw new RuntimeException('Matching failed with unknown error code.');
}
} finally {
restore_error_handler();
@@ -319,7 +329,7 @@ abstract class AbstractUnicodeString extends AbstractString
$lastError = preg_last_error();
foreach (get_defined_constants(true)['pcre'] as $k => $v) {
- if ($lastError === $v && str_ends_with($k, '_ERROR')) {
+ if ($lastError === $v && '_ERROR' === substr($k, -6)) {
throw new RuntimeException('Matching failed with '.$k.'.');
}
}
@@ -358,7 +368,9 @@ abstract class AbstractUnicodeString extends AbstractString
$limit = $allWords ? -1 : 1;
- $str->string = preg_replace_callback('/\b./u', static fn (array $m): string => mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'), $str->string, $limit);
+ $str->string = preg_replace_callback('/\b./u', static function (array $m): string {
+ return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8');
+ }, $str->string, $limit);
return $str;
}
@@ -455,7 +467,7 @@ abstract class AbstractUnicodeString extends AbstractString
$width = 0;
$s = str_replace(["\x00", "\x05", "\x07"], '', $this->string);
- if (str_contains($s, "\r")) {
+ if (false !== strpos($s, "\r")) {
$s = str_replace(["\r\n", "\r"], "\n", $s);
}
@@ -546,7 +558,9 @@ abstract class AbstractUnicodeString extends AbstractString
return -1;
}
- self::$tableZero ??= require __DIR__.'/Resources/data/wcswidth_table_zero.php';
+ if (null === self::$tableZero) {
+ self::$tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php';
+ }
if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) {
$lbound = 0;
@@ -563,7 +577,9 @@ abstract class AbstractUnicodeString extends AbstractString
}
}
- self::$tableWide ??= require __DIR__.'/Resources/data/wcswidth_table_wide.php';
+ if (null === self::$tableWide) {
+ self::$tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php';
+ }
if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) {
$lbound = 0;
diff --git a/vendor/symfony/string/ByteString.php b/vendor/symfony/string/ByteString.php
index 212290fe..639d6435 100644
--- a/vendor/symfony/string/ByteString.php
+++ b/vendor/symfony/string/ByteString.php
@@ -48,7 +48,7 @@ class ByteString extends AbstractString
throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length));
}
- $alphabet ??= self::ALPHABET_ALPHANUMERIC;
+ $alphabet = $alphabet ?? self::ALPHABET_ALPHANUMERIC;
$alphabetSize = \strlen($alphabet);
$bits = (int) ceil(log($alphabetSize, 2.0));
if ($bits <= 0 || $bits > 56) {
@@ -240,7 +240,15 @@ class ByteString extends AbstractString
try {
if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) {
- throw new RuntimeException('Matching failed with error: '.preg_last_error_msg());
+ $lastError = preg_last_error();
+
+ foreach (get_defined_constants(true)['pcre'] as $k => $v) {
+ if ($lastError === $v && '_ERROR' === substr($k, -6)) {
+ throw new RuntimeException('Matching failed with '.$k.'.');
+ }
+ }
+
+ throw new RuntimeException('Matching failed with unknown error code.');
}
} finally {
restore_error_handler();
@@ -307,7 +315,7 @@ class ByteString extends AbstractString
$lastError = preg_last_error();
foreach (get_defined_constants(true)['pcre'] as $k => $v) {
- if ($lastError === $v && str_ends_with($k, '_ERROR')) {
+ if ($lastError === $v && '_ERROR' === substr($k, -6)) {
throw new RuntimeException('Matching failed with '.$k.'.');
}
}
@@ -358,7 +366,7 @@ class ByteString extends AbstractString
public function split(string $delimiter, int $limit = null, int $flags = null): array
{
- if (1 > $limit ??= \PHP_INT_MAX) {
+ if (1 > $limit = $limit ?? \PHP_INT_MAX) {
throw new InvalidArgumentException('Split limit must be a positive integer.');
}
diff --git a/vendor/symfony/string/CHANGELOG.md b/vendor/symfony/string/CHANGELOG.md
index 31a3b54d..53af3640 100644
--- a/vendor/symfony/string/CHANGELOG.md
+++ b/vendor/symfony/string/CHANGELOG.md
@@ -1,11 +1,6 @@
CHANGELOG
=========
-6.2
----
-
- * Add support for emoji in `AsciiSlugger`
-
5.4
---
diff --git a/vendor/symfony/string/CodePointString.php b/vendor/symfony/string/CodePointString.php
index f5c900fb..926ff798 100644
--- a/vendor/symfony/string/CodePointString.php
+++ b/vendor/symfony/string/CodePointString.php
@@ -210,7 +210,7 @@ class CodePointString extends AbstractUnicodeString
public function split(string $delimiter, int $limit = null, int $flags = null): array
{
- if (1 > $limit ??= \PHP_INT_MAX) {
+ if (1 > $limit = $limit ?? \PHP_INT_MAX) {
throw new InvalidArgumentException('Split limit must be a positive integer.');
}
diff --git a/vendor/symfony/string/Inflector/EnglishInflector.php b/vendor/symfony/string/Inflector/EnglishInflector.php
index 2cd6bb87..9f2fac67 100644
--- a/vendor/symfony/string/Inflector/EnglishInflector.php
+++ b/vendor/symfony/string/Inflector/EnglishInflector.php
@@ -55,9 +55,6 @@ final class EnglishInflector implements InflectorInterface
// indices (index), appendices (appendix), prices (price)
['seci', 4, false, true, ['ex', 'ix', 'ice']],
- // codes (code)
- ['sedoc', 5, false, true, 'code'],
-
// selfies (selfie)
['seifles', 7, true, true, 'selfie'],
@@ -67,9 +64,6 @@ final class EnglishInflector implements InflectorInterface
// movies (movie)
['seivom', 6, true, true, 'movie'],
- // names (name)
- ['seman', 5, true, false, 'name'],
-
// conspectuses (conspectus), prospectuses (prospectus)
['sesutcep', 8, true, true, 'pectus'],
@@ -94,9 +88,6 @@ final class EnglishInflector implements InflectorInterface
// accesses (access), addresses (address), kisses (kiss)
['sess', 4, true, false, 'ss'],
- // statuses (status)
- ['sesutats', 8, true, true, 'status'],
-
// analyses (analysis), ellipses (ellipsis), fungi (fungus),
// neuroses (neurosis), theses (thesis), emphases (emphasis),
// oases (oasis), crises (crisis), houses (house), bases (base),
@@ -141,9 +132,6 @@ final class EnglishInflector implements InflectorInterface
// shoes (shoe)
['se', 2, true, true, ['', 'e']],
- // status (status)
- ['sutats', 6, true, true, 'status'],
-
// tags (tag)
['s', 1, true, true, ''],
@@ -285,9 +273,6 @@ final class EnglishInflector implements InflectorInterface
// circuses (circus)
['suc', 3, true, true, 'cuses'],
- // status (status)
- ['sutats', 6, true, true, ['status', 'statuses']],
-
// conspectuses (conspectus), prospectuses (prospectus)
['sutcep', 6, true, true, 'pectuses'],
@@ -365,6 +350,9 @@ final class EnglishInflector implements InflectorInterface
'seiceps',
];
+ /**
+ * {@inheritdoc}
+ */
public function singularize(string $plural): array
{
$pluralRev = strrev($plural);
@@ -396,7 +384,7 @@ final class EnglishInflector implements InflectorInterface
if ($j === $suffixLength) {
// Is there any character preceding the suffix in the plural string?
if ($j < $pluralLength) {
- $nextIsVocal = str_contains('aeiou', $lowerPluralRev[$j]);
+ $nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]);
if (!$map[2] && $nextIsVocal) {
// suffix may not succeed a vocal but next char is one
@@ -441,6 +429,9 @@ final class EnglishInflector implements InflectorInterface
return [$plural];
}
+ /**
+ * {@inheritdoc}
+ */
public function pluralize(string $singular): array
{
$singularRev = strrev($singular);
@@ -473,7 +464,7 @@ final class EnglishInflector implements InflectorInterface
if ($j === $suffixLength) {
// Is there any character preceding the suffix in the plural string?
if ($j < $singularLength) {
- $nextIsVocal = str_contains('aeiou', $lowerSingularRev[$j]);
+ $nextIsVocal = false !== strpos('aeiou', $lowerSingularRev[$j]);
if (!$map[2] && $nextIsVocal) {
// suffix may not succeed a vocal but next char is one
diff --git a/vendor/symfony/string/Inflector/FrenchInflector.php b/vendor/symfony/string/Inflector/FrenchInflector.php
index 955abbf4..612c8f2e 100644
--- a/vendor/symfony/string/Inflector/FrenchInflector.php
+++ b/vendor/symfony/string/Inflector/FrenchInflector.php
@@ -110,6 +110,9 @@ final class FrenchInflector implements InflectorInterface
*/
private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i';
+ /**
+ * {@inheritdoc}
+ */
public function singularize(string $plural): array
{
if ($this->isInflectedWord($plural)) {
@@ -127,6 +130,9 @@ final class FrenchInflector implements InflectorInterface
return [$plural];
}
+ /**
+ * {@inheritdoc}
+ */
public function pluralize(string $singular): array
{
if ($this->isInflectedWord($singular)) {
diff --git a/vendor/symfony/string/LICENSE b/vendor/symfony/string/LICENSE
index f37c76b5..5c7ba055 100644
--- a/vendor/symfony/string/LICENSE
+++ b/vendor/symfony/string/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2019-present Fabien Potencier
+Copyright (c) 2019-2023 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/symfony/string/LazyString.php b/vendor/symfony/string/LazyString.php
index 3128ebb3..37330782 100644
--- a/vendor/symfony/string/LazyString.php
+++ b/vendor/symfony/string/LazyString.php
@@ -30,13 +30,11 @@ class LazyString implements \Stringable, \JsonSerializable
}
$lazyString = new static();
- $lazyString->value = static function () use (&$callback, &$arguments): string {
- static $value;
-
+ $lazyString->value = static function () use (&$callback, &$arguments, &$value): string {
if (null !== $arguments) {
if (!\is_callable($callback)) {
$callback[0] = $callback[0]();
- $callback[1] ??= '__invoke';
+ $callback[1] = $callback[1] ?? '__invoke';
}
$value = $callback(...$arguments);
$callback = self::getPrettyName($callback);
@@ -52,7 +50,7 @@ class LazyString implements \Stringable, \JsonSerializable
public static function fromStringable(string|int|float|bool|\Stringable $value): static
{
if (\is_object($value)) {
- return static::fromCallable($value->__toString(...));
+ return static::fromCallable([$value, '__toString']);
}
$lazyString = new static();
@@ -88,7 +86,7 @@ class LazyString implements \Stringable, \JsonSerializable
try {
return $this->value = ($this->value)();
} catch (\Throwable $e) {
- if (\TypeError::class === $e::class && __FILE__ === $e->getFile()) {
+ if (\TypeError::class === \get_class($e) && __FILE__ === $e->getFile()) {
$type = explode(', ', $e->getMessage());
$type = substr(array_pop($type), 0, -\strlen(' returned'));
$r = new \ReflectionFunction($this->value);
@@ -129,7 +127,7 @@ class LazyString implements \Stringable, \JsonSerializable
} elseif ($callback instanceof \Closure) {
$r = new \ReflectionFunction($callback);
- if (str_contains($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
+ if (false !== strpos($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
return $r->name;
}
diff --git a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/vendor/symfony/string/Resources/data/wcswidth_table_wide.php
index 8314c8fd..5a647e67 100644
--- a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php
+++ b/vendor/symfony/string/Resources/data/wcswidth_table_wide.php
@@ -3,8 +3,8 @@
/*
* This file has been auto-generated by the Symfony String Component for internal use.
*
- * Unicode version: 15.1.0
- * Date: 2023-09-13T11:47:12+00:00
+ * Unicode version: 15.0.0
+ * Date: 2022-10-05T17:16:36+02:00
*/
return [
@@ -166,7 +166,7 @@ return [
],
[
12272,
- 12287,
+ 12283,
],
[
12288,
@@ -396,10 +396,6 @@ return [
12736,
12771,
],
- [
- 12783,
- 12783,
- ],
[
12784,
12799,
@@ -1114,14 +1110,6 @@ return [
],
[
191457,
- 191471,
- ],
- [
- 191472,
- 192093,
- ],
- [
- 192094,
194559,
],
[
diff --git a/vendor/symfony/string/Resources/data/wcswidth_table_zero.php b/vendor/symfony/string/Resources/data/wcswidth_table_zero.php
index e5b26a21..9ae73303 100644
--- a/vendor/symfony/string/Resources/data/wcswidth_table_zero.php
+++ b/vendor/symfony/string/Resources/data/wcswidth_table_zero.php
@@ -3,8 +3,8 @@
/*
* This file has been auto-generated by the Symfony String Component for internal use.
*
- * Unicode version: 15.1.0
- * Date: 2023-09-13T11:47:13+00:00
+ * Unicode version: 15.0.0
+ * Date: 2022-10-05T17:16:37+02:00
*/
return [
diff --git a/vendor/symfony/string/Resources/functions.php b/vendor/symfony/string/Resources/functions.php
index 7a970400..c950894f 100644
--- a/vendor/symfony/string/Resources/functions.php
+++ b/vendor/symfony/string/Resources/functions.php
@@ -31,7 +31,7 @@ if (!\function_exists(s::class)) {
*/
function s(?string $string = ''): AbstractString
{
- $string ??= '';
+ $string = $string ?? '';
return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string);
}
diff --git a/vendor/symfony/string/Slugger/AsciiSlugger.php b/vendor/symfony/string/Slugger/AsciiSlugger.php
index 6e550c61..548a6b93 100644
--- a/vendor/symfony/string/Slugger/AsciiSlugger.php
+++ b/vendor/symfony/string/Slugger/AsciiSlugger.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\String\Slugger;
-use Symfony\Component\Intl\Transliterator\EmojiTransliterator;
use Symfony\Component\String\AbstractUnicodeString;
use Symfony\Component\String\UnicodeString;
use Symfony\Contracts\Translation\LocaleAwareInterface;
@@ -59,7 +58,6 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface
private \Closure|array $symbolsMap = [
'en' => ['@' => 'at', '&' => 'and'],
];
- private bool|string $emoji = false;
/**
* Cache of transliterators per locale.
@@ -75,56 +73,43 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface
}
/**
- * @return void
+ * {@inheritdoc}
*/
public function setLocale(string $locale)
{
$this->defaultLocale = $locale;
}
+ /**
+ * {@inheritdoc}
+ */
public function getLocale(): string
{
return $this->defaultLocale;
}
/**
- * @param bool|string $emoji true will use the same locale,
- * false will disable emoji,
- * and a string to use a specific locale
+ * {@inheritdoc}
*/
- public function withEmoji(bool|string $emoji = true): static
- {
- if (false !== $emoji && !class_exists(EmojiTransliterator::class)) {
- throw new \LogicException(sprintf('You cannot use the "%s()" method as the "symfony/intl" package is not installed. Try running "composer require symfony/intl".', __METHOD__));
- }
-
- $new = clone $this;
- $new->emoji = $emoji;
-
- return $new;
- }
-
public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString
{
- $locale ??= $this->defaultLocale;
+ $locale = $locale ?? $this->defaultLocale;
$transliterator = [];
- if ($locale && ('de' === $locale || str_starts_with($locale, 'de_'))) {
+ if ($locale && ('de' === $locale || 0 === strpos($locale, 'de_'))) {
// Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl)
$transliterator = ['de-ASCII'];
} elseif (\function_exists('transliterator_transliterate') && $locale) {
$transliterator = (array) $this->createTransliterator($locale);
}
- if ($emojiTransliterator = $this->createEmojiTransliterator($locale)) {
- $transliterator[] = $emojiTransliterator;
- }
-
if ($this->symbolsMap instanceof \Closure) {
// If the symbols map is passed as a closure, there is no need to fallback to the parent locale
// as the closure can just provide substitutions for all locales of interest.
$symbolsMap = $this->symbolsMap;
- array_unshift($transliterator, static fn ($s) => $symbolsMap($s, $locale));
+ array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) {
+ return $symbolsMap($s, $locale);
+ });
}
$unicodeString = (new UnicodeString($string))->ascii($transliterator);
@@ -176,25 +161,6 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface
return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null;
}
- private function createEmojiTransliterator(?string $locale): ?EmojiTransliterator
- {
- if (\is_string($this->emoji)) {
- $locale = $this->emoji;
- } elseif (!$this->emoji) {
- return null;
- }
-
- while (null !== $locale) {
- try {
- return EmojiTransliterator::create("emoji-$locale");
- } catch (\IntlException) {
- $locale = self::getParentLocale($locale);
- }
- }
-
- return null;
- }
-
private static function getParentLocale(?string $locale): ?string
{
if (!$locale) {
diff --git a/vendor/symfony/string/UnicodeString.php b/vendor/symfony/string/UnicodeString.php
index a64c6a9d..70cf4c54 100644
--- a/vendor/symfony/string/UnicodeString.php
+++ b/vendor/symfony/string/UnicodeString.php
@@ -139,7 +139,7 @@ class UnicodeString extends AbstractUnicodeString
try {
$i = $this->ignoreCase ? grapheme_stripos($this->string, $needle, $offset) : grapheme_strpos($this->string, $needle, $offset);
- } catch (\ValueError) {
+ } catch (\ValueError $e) {
return null;
}
@@ -280,7 +280,7 @@ class UnicodeString extends AbstractUnicodeString
public function split(string $delimiter, int $limit = null, int $flags = null): array
{
- if (1 > $limit ??= 2147483647) {
+ if (1 > $limit = $limit ?? 2147483647) {
throw new InvalidArgumentException('Split limit must be a positive integer.');
}
diff --git a/vendor/symfony/string/composer.json b/vendor/symfony/string/composer.json
index 3545c853..187323f8 100644
--- a/vendor/symfony/string/composer.json
+++ b/vendor/symfony/string/composer.json
@@ -16,7 +16,7 @@
}
],
"require": {
- "php": ">=8.1",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
@@ -24,13 +24,12 @@
},
"require-dev": {
"symfony/error-handler": "^5.4|^6.0",
- "symfony/intl": "^6.2",
"symfony/http-client": "^5.4|^6.0",
- "symfony/translation-contracts": "^2.5|^3.0",
+ "symfony/translation-contracts": "^2.0|^3.0",
"symfony/var-exporter": "^5.4|^6.0"
},
"conflict": {
- "symfony/translation-contracts": "<2.5"
+ "symfony/translation-contracts": "<2.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\String\\": "" },