1.4.13
diff --git a/vendor/pear/pear-core-minimal/src/PEAR.php b/vendor/pear/pear-core-minimal/src/PEAR.php
index 27b1b4b2..432228bd 100644
--- a/vendor/pear/pear-core-minimal/src/PEAR.php
+++ b/vendor/pear/pear-core-minimal/src/PEAR.php
@@ -219,7 +219,7 @@ public function __call($method, $arguments)
);
}
return call_user_func_array(
- array(self::class, '_' . $method),
+ array(__CLASS__, '_' . $method),
array_merge(array($this), $arguments)
);
}
@@ -232,7 +232,7 @@ public static function __callStatic($method, $arguments)
);
}
return call_user_func_array(
- array(self::class, '_' . $method),
+ array(__CLASS__, '_' . $method),
array_merge(array(null), $arguments)
);
}
diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php
index a64f4ef5..89b0a9b0 100644
--- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php
+++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php
@@ -484,7 +484,7 @@ private static function bcrypt_hash($sha2pass, $sha2salt)
}
}
- return pack('L*', ...$cdata);
+ return pack('V*', ...$cdata);
}
/**
diff --git a/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php b/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
index 738b8e9c..49774629 100644
--- a/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
+++ b/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
@@ -785,14 +785,6 @@ class SSH2
*/
private $keepAlive;
- /**
- * Timestamp for the last sent keep alive message
- *
- * @see self::send_keep_alive()
- * @var float|null
- */
- private $keep_alive_sent = null;
-
/**
* Real-time log file pointer
*
@@ -3489,7 +3481,7 @@ protected function reset_connection()
$this->hmac_check = $this->hmac_create = false;
$this->hmac_size = false;
$this->session_id = false;
- $this->keep_alive_sent = null;
+ $this->last_packet = null;
$this->get_seq_no = $this->send_seq_no = 0;
$this->channel_status = [];
$this->channel_id_last_interactive = 0;
@@ -3507,7 +3499,7 @@ private function get_stream_timeout()
$usec = (int) (1000000 * ($this->curTimeout - $sec));
}
if ($this->keepAlive > 0) {
- $elapsed = microtime(true) - $this->keep_alive_sent;
+ $elapsed = microtime(true) - $this->last_packet;
if ($elapsed < $this->curTimeout) {
$sec = (int) floor($elapsed);
$usec = (int) (1000000 * ($elapsed - $sec));
@@ -3569,7 +3561,7 @@ private function get_binary_packet()
if (!$packet->packet_length) {
$this->get_binary_packet_size($packet);
}
- };
+ }
if (strlen($packet->raw) != $packet->size) {
throw new \RuntimeException('Size of packet was not expected length');
@@ -3701,7 +3693,7 @@ private function get_binary_packet()
$current = microtime(true);
$message_number = isset(self::$message_numbers[ord($payload[0])]) ? self::$message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')';
$message_number = '<- ' . $message_number .
- ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)';
+ ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($elapsed, 4) . 's)';
$this->append_log($message_number, $payload);
$this->last_packet = $current;
}
@@ -4380,10 +4372,11 @@ protected function send_binary_packet($data, $logged = null)
*/
private function send_keep_alive()
{
- $elapsed = microtime(true) - $this->keep_alive_sent;
- if ($this->keepAlive > 0 && $elapsed >= $this->keepAlive) {
- $this->keep_alive_sent = microtime(true);
- $this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0));
+ if ($this->bitmap & self::MASK_CONNECTED) {
+ $elapsed = microtime(true) - $this->last_packet;
+ if ($this->keepAlive > 0 && $elapsed >= $this->keepAlive) {
+ $this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0));
+ }
}
}
diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php
index cf10b8b4..0f213f2f 100644
--- a/vendor/psr/container/src/ContainerExceptionInterface.php
+++ b/vendor/psr/container/src/ContainerExceptionInterface.php
@@ -2,9 +2,11 @@
namespace Psr\Container;
+use Throwable;
+
/**
* Base interface representing a generic exception in a container.
*/
-interface ContainerExceptionInterface
+interface ContainerExceptionInterface extends Throwable
{
}
diff --git a/vendor/psr/container/src/ContainerInterface.php b/vendor/psr/container/src/ContainerInterface.php
index b2cad401..cf8e7fd3 100644
--- a/vendor/psr/container/src/ContainerInterface.php
+++ b/vendor/psr/container/src/ContainerInterface.php
@@ -32,5 +32,5 @@ public function get(string $id);
*
* @return bool
*/
- public function has(string $id): bool;
+ public function has(string $id);
}
diff --git a/vendor/psr/event-dispatcher/.editorconfig b/vendor/psr/event-dispatcher/.editorconfig
new file mode 100644
index 00000000..164f092d
--- /dev/null
+++ b/vendor/psr/event-dispatcher/.editorconfig
@@ -0,0 +1,15 @@
+; This file is for unifying the coding style for different editors and IDEs.
+; More information at http://editorconfig.org
+
+root = true
+
+[*]
+charset = utf-8
+indent_size = 4
+indent_style = space
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[Makefile]
+indent_style = tab
diff --git a/vendor/psr/event-dispatcher/LICENSE b/vendor/psr/event-dispatcher/LICENSE
new file mode 100644
index 00000000..3f1559b2
--- /dev/null
+++ b/vendor/psr/event-dispatcher/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 PHP-FIG
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php b/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php
new file mode 100644
index 00000000..4306fa91
--- /dev/null
+++ b/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+if (!function_exists('trigger_deprecation')) {
+ /**
+ * Triggers a silenced deprecation notice.
+ *
+ * @param string $package The name of the Composer package that is triggering the deprecation
+ * @param string $version The version of the package that introduced the deprecation
+ * @param string $message The message of the deprecation
+ * @param mixed ...$args Values to insert in the message using printf() formatting
+ *
+ * @author Nicolas Grekas
+ */
+ function trigger_deprecation(string $package, string $version, string $message, ...$args): void
+ {
+ @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
+ }
+}
diff --git a/vendor/symfony/event-dispatcher-contracts/Event.php b/vendor/symfony/event-dispatcher-contracts/Event.php
index 84f60f3e..46dcb2ba 100644
--- a/vendor/symfony/event-dispatcher-contracts/Event.php
+++ b/vendor/symfony/event-dispatcher-contracts/Event.php
@@ -13,84 +13,42 @@
use Psr\EventDispatcher\StoppableEventInterface;
-if (interface_exists(StoppableEventInterface::class)) {
+/**
+ * Event is the base class for classes containing event data.
+ *
+ * This class contains no event data. It is used by events that do not pass
+ * state information to an event handler when an event is raised.
+ *
+ * You can call the method stopPropagation() to abort the execution of
+ * further listeners in your event listener.
+ *
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Bernhard Schussek
+ * @author Nicolas Grekas
+ */
+class Event implements StoppableEventInterface
+{
+ private $propagationStopped = false;
+
/**
- * Event is the base class for classes containing event data.
- *
- * This class contains no event data. It is used by events that do not pass
- * state information to an event handler when an event is raised.
- *
- * You can call the method stopPropagation() to abort the execution of
- * further listeners in your event listener.
- *
- * @author Guilherme Blanco
- * @author Jonathan Wage
- * @author Roman Borschel
- * @author Bernhard Schussek
- * @author Nicolas Grekas
+ * {@inheritdoc}
*/
- class Event implements StoppableEventInterface
+ public function isPropagationStopped(): bool
{
- private $propagationStopped = false;
-
- /**
- * Returns whether further event listeners should be triggered.
- */
- public function isPropagationStopped(): bool
- {
- return $this->propagationStopped;
- }
-
- /**
- * Stops the propagation of the event to further event listeners.
- *
- * If multiple event listeners are connected to the same event, no
- * further event listener will be triggered once any trigger calls
- * stopPropagation().
- */
- public function stopPropagation(): void
- {
- $this->propagationStopped = true;
- }
+ return $this->propagationStopped;
}
-} else {
+
/**
- * Event is the base class for classes containing event data.
- *
- * This class contains no event data. It is used by events that do not pass
- * state information to an event handler when an event is raised.
+ * Stops the propagation of the event to further event listeners.
*
- * You can call the method stopPropagation() to abort the execution of
- * further listeners in your event listener.
- *
- * @author Guilherme Blanco
- * @author Jonathan Wage
- * @author Roman Borschel
- * @author Bernhard Schussek
- * @author Nicolas Grekas
+ * If multiple event listeners are connected to the same event, no
+ * further event listener will be triggered once any trigger calls
+ * stopPropagation().
*/
- class Event
+ public function stopPropagation(): void
{
- private $propagationStopped = false;
-
- /**
- * Returns whether further event listeners should be triggered.
- */
- public function isPropagationStopped(): bool
- {
- return $this->propagationStopped;
- }
-
- /**
- * Stops the propagation of the event to further event listeners.
- *
- * If multiple event listeners are connected to the same event, no
- * further event listener will be triggered once any trigger calls
- * stopPropagation().
- */
- public function stopPropagation(): void
- {
- $this->propagationStopped = true;
- }
+ $this->propagationStopped = true;
}
}
diff --git a/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php
index 2d470af9..81f4e89f 100644
--- a/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php
+++ b/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php
@@ -13,46 +13,19 @@
use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface;
-if (interface_exists(PsrEventDispatcherInterface::class)) {
- /**
- * Allows providing hooks on domain-specific lifecycles by dispatching events.
- */
- interface EventDispatcherInterface extends PsrEventDispatcherInterface
- {
- /**
- * Dispatches an event to all registered listeners.
- *
- * For BC with Symfony 4, the $eventName argument is not declared explicitly on the
- * signature of the method. Implementations that are not bound by this BC constraint
- * MUST declare it explicitly, as allowed by PHP.
- *
- * @param object $event The event to pass to the event handlers/listeners
- * @param string|null $eventName The name of the event to dispatch. If not supplied,
- * the class of $event should be used instead.
- *
- * @return object The passed $event MUST be returned
- */
- public function dispatch($event/*, string $eventName = null*/);
- }
-} else {
+/**
+ * Allows providing hooks on domain-specific lifecycles by dispatching events.
+ */
+interface EventDispatcherInterface extends PsrEventDispatcherInterface
+{
/**
- * Allows providing hooks on domain-specific lifecycles by dispatching events.
+ * Dispatches an event to all registered listeners.
+ *
+ * @param object $event The event to pass to the event handlers/listeners
+ * @param string|null $eventName The name of the event to dispatch. If not supplied,
+ * the class of $event should be used instead.
+ *
+ * @return object The passed $event MUST be returned
*/
- interface EventDispatcherInterface
- {
- /**
- * Dispatches an event to all registered listeners.
- *
- * For BC with Symfony 4, the $eventName argument is not declared explicitly on the
- * signature of the method. Implementations that are not bound by this BC constraint
- * MUST declare it explicitly, as allowed by PHP.
- *
- * @param object $event The event to pass to the event handlers/listeners
- * @param string|null $eventName The name of the event to dispatch. If not supplied,
- * the class of $event should be used instead.
- *
- * @return object The passed $event MUST be returned
- */
- public function dispatch($event/*, string $eventName = null*/);
- }
+ public function dispatch(object $event, ?string $eventName = null): object;
}
diff --git a/vendor/symfony/event-dispatcher-contracts/LICENSE b/vendor/symfony/event-dispatcher-contracts/LICENSE
index 74cdc2db..7536caea 100644
--- a/vendor/symfony/event-dispatcher-contracts/LICENSE
+++ b/vendor/symfony/event-dispatcher-contracts/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2018-2022 Fabien Potencier
+Copyright (c) 2018-present 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/event-dispatcher/Attribute/AsEventListener.php b/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php
new file mode 100644
index 00000000..bb931b82
--- /dev/null
+++ b/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php
@@ -0,0 +1,29 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\EventDispatcher\Attribute;
+
+/**
+ * Service tag to autoconfigure event listeners.
+ *
+ * @author Alexander M. Turek
+ */
+#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+class AsEventListener
+{
+ public function __construct(
+ public ?string $event = null,
+ public ?string $method = null,
+ public int $priority = 0,
+ public ?string $dispatcher = null,
+ ) {
+ }
+}
diff --git a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
index 98e7df63..84d6a08a 100644
--- a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
+++ b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
@@ -13,15 +13,12 @@
use Psr\EventDispatcher\StoppableEventInterface;
use Psr\Log\LoggerInterface;
-use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
-use Symfony\Component\EventDispatcher\LegacyEventProxy;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Stopwatch\Stopwatch;
-use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
+use Symfony\Contracts\Service\ResetInterface;
/**
* Collects some data about event listeners.
@@ -30,11 +27,14 @@
*
* @author Fabien Potencier
*/
-class TraceableEventDispatcher implements TraceableEventDispatcherInterface
+class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterface
{
protected $logger;
protected $stopwatch;
+ /**
+ * @var \SplObjectStorage
+ */
private $callStack;
private $dispatcher;
private $wrappedListeners;
@@ -42,9 +42,9 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
private $requestStack;
private $currentRequestHash = '';
- public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null, RequestStack $requestStack = null)
+ public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, ?LoggerInterface $logger = null, ?RequestStack $requestStack = null)
{
- $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
+ $this->dispatcher = $dispatcher;
$this->stopwatch = $stopwatch;
$this->logger = $logger;
$this->wrappedListeners = [];
@@ -55,7 +55,7 @@ public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $sto
/**
* {@inheritdoc}
*/
- public function addListener($eventName, $listener, $priority = 0)
+ public function addListener(string $eventName, $listener, int $priority = 0)
{
$this->dispatcher->addListener($eventName, $listener, $priority);
}
@@ -71,7 +71,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber)
/**
* {@inheritdoc}
*/
- public function removeListener($eventName, $listener)
+ public function removeListener(string $eventName, $listener)
{
if (isset($this->wrappedListeners[$eventName])) {
foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) {
@@ -97,7 +97,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
/**
* {@inheritdoc}
*/
- public function getListeners($eventName = null)
+ public function getListeners(?string $eventName = null)
{
return $this->dispatcher->getListeners($eventName);
}
@@ -105,7 +105,7 @@ public function getListeners($eventName = null)
/**
* {@inheritdoc}
*/
- public function getListenerPriority($eventName, $listener)
+ public function getListenerPriority(string $eventName, $listener)
{
// we might have wrapped listeners for the event (if called while dispatching)
// in that case get the priority by wrapper
@@ -123,39 +123,25 @@ public function getListenerPriority($eventName, $listener)
/**
* {@inheritdoc}
*/
- public function hasListeners($eventName = null)
+ public function hasListeners(?string $eventName = null)
{
return $this->dispatcher->hasListeners($eventName);
}
/**
* {@inheritdoc}
- *
- * @param string|null $eventName
*/
- public function dispatch($event/* , string $eventName = null */)
+ public function dispatch(object $event, ?string $eventName = null): object
{
+ $eventName = $eventName ?? \get_class($event);
+
if (null === $this->callStack) {
$this->callStack = new \SplObjectStorage();
}
$currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';
- $eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
-
- if (\is_object($event)) {
- $eventName = $eventName ?? \get_class($event);
- } else {
- @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), \E_USER_DEPRECATED);
- $swap = $event;
- $event = $eventName ?? new Event();
- $eventName = $swap;
-
- if (!$event instanceof Event) {
- throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of "%s", "%s" given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event)));
- }
- }
- if (null !== $this->logger && ($event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface) && $event->isPropagationStopped()) {
+ if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
$this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
}
@@ -183,17 +169,15 @@ public function dispatch($event/* , string $eventName = null */)
}
/**
- * {@inheritdoc}
- *
- * @param Request|null $request The request to get listeners for
+ * @return array
*/
- public function getCalledListeners(/* Request $request = null */)
+ public function getCalledListeners(?Request $request = null)
{
if (null === $this->callStack) {
return [];
}
- $hash = 1 <= \func_num_args() && null !== ($request = func_get_arg(0)) ? spl_object_hash($request) : null;
+ $hash = $request ? spl_object_hash($request) : null;
$called = [];
foreach ($this->callStack as $listener) {
[$eventName, $requestHash] = $this->callStack->getInfo();
@@ -206,11 +190,9 @@ public function getCalledListeners(/* Request $request = null */)
}
/**
- * {@inheritdoc}
- *
- * @param Request|null $request The request to get listeners for
+ * @return array
*/
- public function getNotCalledListeners(/* Request $request = null */)
+ public function getNotCalledListeners(?Request $request = null)
{
try {
$allListeners = $this->getListeners();
@@ -223,7 +205,7 @@ public function getNotCalledListeners(/* Request $request = null */)
return [];
}
- $hash = 1 <= \func_num_args() && null !== ($request = func_get_arg(0)) ? spl_object_hash($request) : null;
+ $hash = $request ? spl_object_hash($request) : null;
$calledListeners = [];
if (null !== $this->callStack) {
@@ -253,12 +235,9 @@ public function getNotCalledListeners(/* Request $request = null */)
return $notCalled;
}
- /**
- * @param Request|null $request The request to get orphaned events for
- */
- public function getOrphanedEvents(/* Request $request = null */): array
+ public function getOrphanedEvents(?Request $request = null): array
{
- if (1 <= \func_num_args() && null !== $request = func_get_arg(0)) {
+ if ($request) {
return $this->orphanedEvents[spl_object_hash($request)] ?? [];
}
@@ -284,46 +263,26 @@ public function reset()
*
* @return mixed
*/
- public function __call($method, $arguments)
+ public function __call(string $method, array $arguments)
{
return $this->dispatcher->{$method}(...$arguments);
}
/**
* Called before dispatching the event.
- *
- * @param object $event
*/
- protected function beforeDispatch(string $eventName, $event)
+ protected function beforeDispatch(string $eventName, object $event)
{
- $this->preDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
}
/**
* Called after dispatching the event.
- *
- * @param object $event
- */
- protected function afterDispatch(string $eventName, $event)
- {
- $this->postDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
- }
-
- /**
- * @deprecated since Symfony 4.3, will be removed in 5.0, use beforeDispatch instead
- */
- protected function preDispatch($eventName, Event $event)
- {
- }
-
- /**
- * @deprecated since Symfony 4.3, will be removed in 5.0, use afterDispatch instead
*/
- protected function postDispatch($eventName, Event $event)
+ protected function afterDispatch(string $eventName, object $event)
{
}
- private function preProcess(string $eventName)
+ private function preProcess(string $eventName): void
{
if (!$this->dispatcher->hasListeners($eventName)) {
$this->orphanedEvents[$this->currentRequestHash][] = $eventName;
@@ -341,7 +300,7 @@ private function preProcess(string $eventName)
}
}
- private function postProcess(string $eventName)
+ private function postProcess(string $eventName): void
{
unset($this->wrappedListeners[$eventName]);
$skipped = false;
diff --git a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
index 9b910e66..792c1756 100644
--- a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
+++ b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
@@ -12,19 +12,14 @@
namespace Symfony\Component\EventDispatcher\Debug;
use Psr\EventDispatcher\StoppableEventInterface;
-use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\LegacyEventProxy;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\VarDumper\Caster\ClassStub;
-use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
/**
* @author Fabien Potencier
- *
- * @final since Symfony 4.3: the "Event" type-hint on __invoke() will be replaced by "object" in 5.0
*/
-class WrappedListener
+final class WrappedListener
{
private $listener;
private $optimizedListener;
@@ -38,7 +33,7 @@ class WrappedListener
private $priority;
private static $hasClassStub;
- public function __construct($listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
+ public function __construct($listener, ?string $name, Stopwatch $stopwatch, ?EventDispatcherInterface $dispatcher = null)
{
$this->listener = $listener;
$this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? \Closure::fromCallable($listener) : null);
@@ -48,13 +43,13 @@ public function __construct($listener, ?string $name, Stopwatch $stopwatch, Even
$this->stoppedPropagation = false;
if (\is_array($listener)) {
- $this->name = \is_object($listener[0]) ? \get_class($listener[0]) : $listener[0];
+ $this->name = \is_object($listener[0]) ? get_debug_type($listener[0]) : $listener[0];
$this->pretty = $this->name.'::'.$listener[1];
} elseif ($listener instanceof \Closure) {
$r = new \ReflectionFunction($listener);
- if (str_contains($r->name, '{closure}')) {
+ if (str_contains($r->name, '{closure')) {
$this->pretty = $this->name = 'closure';
- } elseif ($class = $r->getClosureScopeClass()) {
+ } elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
$this->name = $class->name;
$this->pretty = $this->name.'::'.$r->name;
} else {
@@ -63,7 +58,7 @@ public function __construct($listener, ?string $name, Stopwatch $stopwatch, Even
} elseif (\is_string($listener)) {
$this->pretty = $this->name = $listener;
} else {
- $this->name = \get_class($listener);
+ $this->name = get_debug_type($listener);
$this->pretty = $this->name.'::__invoke';
}
@@ -81,22 +76,22 @@ public function getWrappedListener()
return $this->listener;
}
- public function wasCalled()
+ public function wasCalled(): bool
{
return $this->called;
}
- public function stoppedPropagation()
+ public function stoppedPropagation(): bool
{
return $this->stoppedPropagation;
}
- public function getPretty()
+ public function getPretty(): string
{
return $this->pretty;
}
- public function getInfo($eventName)
+ public function getInfo(string $eventName): array
{
if (null === $this->stub) {
$this->stub = self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->listener) : $this->pretty.'()';
@@ -110,12 +105,8 @@ public function getInfo($eventName)
];
}
- public function __invoke(Event $event, $eventName, EventDispatcherInterface $dispatcher)
+ public function __invoke(object $event, string $eventName, EventDispatcherInterface $dispatcher): void
{
- if ($event instanceof LegacyEventProxy) {
- $event = $event->getEvent();
- }
-
$dispatcher = $this->dispatcher ?: $dispatcher;
$this->called = true;
@@ -123,13 +114,15 @@ public function __invoke(Event $event, $eventName, EventDispatcherInterface $dis
$e = $this->stopwatch->start($this->name, 'event_listener');
- ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
-
- if ($e->isStarted()) {
- $e->stop();
+ try {
+ ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
+ } finally {
+ if ($e->isStarted()) {
+ $e->stop();
+ }
}
- if (($event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface) && $event->isPropagationStopped()) {
+ if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
$this->stoppedPropagation = true;
}
}
diff --git a/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php b/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php
index c4ea50f7..6e7292b4 100644
--- a/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php
+++ b/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php
@@ -26,6 +26,10 @@ class AddEventAliasesPass implements CompilerPassInterface
public function __construct(array $eventAliases, string $eventAliasesParameter = 'event_dispatcher.event_aliases')
{
+ if (1 < \func_num_args()) {
+ trigger_deprecation('symfony/event-dispatcher', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
+ }
+
$this->eventAliases = $eventAliases;
$this->eventAliasesParameter = $eventAliasesParameter;
}
diff --git a/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php b/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php
index 1c4e12ec..5f44ff09 100644
--- a/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php
+++ b/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php
@@ -16,7 +16,6 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\EventDispatcher\Event as LegacyEvent;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Contracts\EventDispatcher\Event;
@@ -32,20 +31,48 @@ class RegisterListenersPass implements CompilerPassInterface
protected $eventAliasesParameter;
private $hotPathEvents = [];
- private $hotPathTagName;
+ private $hotPathTagName = 'container.hot_path';
+ private $noPreloadEvents = [];
+ private $noPreloadTagName = 'container.no_preload';
public function __construct(string $dispatcherService = 'event_dispatcher', string $listenerTag = 'kernel.event_listener', string $subscriberTag = 'kernel.event_subscriber', string $eventAliasesParameter = 'event_dispatcher.event_aliases')
{
+ if (0 < \func_num_args()) {
+ trigger_deprecation('symfony/event-dispatcher', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
+ }
+
$this->dispatcherService = $dispatcherService;
$this->listenerTag = $listenerTag;
$this->subscriberTag = $subscriberTag;
$this->eventAliasesParameter = $eventAliasesParameter;
}
- public function setHotPathEvents(array $hotPathEvents, $tagName = 'container.hot_path')
+ /**
+ * @return $this
+ */
+ public function setHotPathEvents(array $hotPathEvents)
{
$this->hotPathEvents = array_flip($hotPathEvents);
- $this->hotPathTagName = $tagName;
+
+ if (1 < \func_num_args()) {
+ trigger_deprecation('symfony/event-dispatcher', '5.4', 'Configuring "$tagName" in "%s" is deprecated.', __METHOD__);
+ $this->hotPathTagName = func_get_arg(1);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @return $this
+ */
+ public function setNoPreloadEvents(array $noPreloadEvents): self
+ {
+ $this->noPreloadEvents = array_flip($noPreloadEvents);
+
+ if (1 < \func_num_args()) {
+ trigger_deprecation('symfony/event-dispatcher', '5.4', 'Configuring "$tagName" in "%s" is deprecated.', __METHOD__);
+ $this->noPreloadTagName = func_get_arg(1);
+ }
return $this;
}
@@ -62,9 +89,11 @@ public function process(ContainerBuilder $container)
$aliases = $container->getParameter($this->eventAliasesParameter);
}
- $definition = $container->findDefinition($this->dispatcherService);
+ $globalDispatcherDefinition = $container->findDefinition($this->dispatcherService);
foreach ($container->findTaggedServiceIds($this->listenerTag, true) as $id => $events) {
+ $noPreload = 0;
+
foreach ($events as $event) {
$priority = $event['priority'] ?? 0;
@@ -86,22 +115,37 @@ public function process(ContainerBuilder $container)
], function ($matches) { return strtoupper($matches[0]); }, $event['event']);
$event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']);
- if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) {
+ if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method'])) {
+ if (!$r->hasMethod('__invoke')) {
+ throw new InvalidArgumentException(sprintf('None of the "%s" or "__invoke" methods exist for the service "%s". Please define the "method" attribute on "%s" tags.', $event['method'], $id, $this->listenerTag));
+ }
+
$event['method'] = '__invoke';
}
}
- $definition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]);
+ $dispatcherDefinition = $globalDispatcherDefinition;
+ if (isset($event['dispatcher'])) {
+ $dispatcherDefinition = $container->findDefinition($event['dispatcher']);
+ }
+
+ $dispatcherDefinition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]);
if (isset($this->hotPathEvents[$event['event']])) {
$container->getDefinition($id)->addTag($this->hotPathTagName);
+ } elseif (isset($this->noPreloadEvents[$event['event']])) {
+ ++$noPreload;
}
}
+
+ if ($noPreload && \count($events) === $noPreload) {
+ $container->getDefinition($id)->addTag($this->noPreloadTagName);
+ }
}
$extractingDispatcher = new ExtractingEventDispatcher();
- foreach ($container->findTaggedServiceIds($this->subscriberTag, true) as $id => $attributes) {
+ foreach ($container->findTaggedServiceIds($this->subscriberTag, true) as $id => $tags) {
$def = $container->getDefinition($id);
// We must assume that the class value has been correctly filled, even if the service is created by a factory
@@ -115,17 +159,38 @@ public function process(ContainerBuilder $container)
}
$class = $r->name;
+ $dispatcherDefinitions = [];
+ foreach ($tags as $attributes) {
+ if (!isset($attributes['dispatcher']) || isset($dispatcherDefinitions[$attributes['dispatcher']])) {
+ continue;
+ }
+
+ $dispatcherDefinitions[$attributes['dispatcher']] = $container->findDefinition($attributes['dispatcher']);
+ }
+
+ if (!$dispatcherDefinitions) {
+ $dispatcherDefinitions = [$globalDispatcherDefinition];
+ }
+
+ $noPreload = 0;
ExtractingEventDispatcher::$aliases = $aliases;
ExtractingEventDispatcher::$subscriber = $class;
$extractingDispatcher->addSubscriber($extractingDispatcher);
foreach ($extractingDispatcher->listeners as $args) {
$args[1] = [new ServiceClosureArgument(new Reference($id)), $args[1]];
- $definition->addMethodCall('addListener', $args);
+ foreach ($dispatcherDefinitions as $dispatcherDefinition) {
+ $dispatcherDefinition->addMethodCall('addListener', $args);
+ }
if (isset($this->hotPathEvents[$args[0]])) {
$container->getDefinition($id)->addTag($this->hotPathTagName);
+ } elseif (isset($this->noPreloadEvents[$args[0]])) {
+ ++$noPreload;
}
}
+ if ($noPreload && \count($extractingDispatcher->listeners) === $noPreload) {
+ $container->getDefinition($id)->addTag($this->noPreloadTagName);
+ }
$extractingDispatcher->listeners = [];
ExtractingEventDispatcher::$aliases = [];
}
@@ -141,7 +206,6 @@ private function getEventFromTypeDeclaration(ContainerBuilder $container, string
|| !($type = $m->getParameters()[0]->getType()) instanceof \ReflectionNamedType
|| $type->isBuiltin()
|| Event::class === ($name = $type->getName())
- || LegacyEvent::class === $name
) {
throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag));
}
@@ -160,7 +224,7 @@ class ExtractingEventDispatcher extends EventDispatcher implements EventSubscrib
public static $aliases = [];
public static $subscriber;
- public function addListener($eventName, $listener, $priority = 0)
+ public function addListener(string $eventName, $listener, int $priority = 0)
{
$this->listeners[] = [$eventName, $listener[1], $priority];
}
diff --git a/vendor/symfony/event-dispatcher/EventDispatcher.php b/vendor/symfony/event-dispatcher/EventDispatcher.php
index 3d8ac428..9c86bd95 100644
--- a/vendor/symfony/event-dispatcher/EventDispatcher.php
+++ b/vendor/symfony/event-dispatcher/EventDispatcher.php
@@ -13,7 +13,6 @@
use Psr\EventDispatcher\StoppableEventInterface;
use Symfony\Component\EventDispatcher\Debug\WrappedListener;
-use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
/**
* The EventDispatcherInterface is the central point of Symfony's event listener system.
@@ -45,25 +44,12 @@ public function __construct()
/**
* {@inheritdoc}
- *
- * @param string|null $eventName
*/
- public function dispatch($event/* , string $eventName = null */)
+ public function dispatch(object $event, ?string $eventName = null): object
{
- $eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
-
- if (\is_object($event)) {
- $eventName = $eventName ?? \get_class($event);
- } elseif (\is_string($event) && (null === $eventName || $eventName instanceof ContractsEvent || $eventName instanceof Event)) {
- @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.', EventDispatcherInterface::class), \E_USER_DEPRECATED);
- $swap = $event;
- $event = $eventName ?? new Event();
- $eventName = $swap;
- } else {
- throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an object, "%s" given.', EventDispatcherInterface::class, \is_object($event) ? \get_class($event) : \gettype($event)));
- }
+ $eventName = $eventName ?? \get_class($event);
- if (null !== $this->optimized && null !== $eventName) {
+ if (null !== $this->optimized) {
$listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName));
} else {
$listeners = $this->getListeners($eventName);
@@ -79,7 +65,7 @@ public function dispatch($event/* , string $eventName = null */)
/**
* {@inheritdoc}
*/
- public function getListeners($eventName = null)
+ public function getListeners(?string $eventName = null)
{
if (null !== $eventName) {
if (empty($this->listeners[$eventName])) {
@@ -105,7 +91,7 @@ public function getListeners($eventName = null)
/**
* {@inheritdoc}
*/
- public function getListenerPriority($eventName, $listener)
+ public function getListenerPriority(string $eventName, $listener)
{
if (empty($this->listeners[$eventName])) {
return null;
@@ -134,7 +120,7 @@ public function getListenerPriority($eventName, $listener)
/**
* {@inheritdoc}
*/
- public function hasListeners($eventName = null)
+ public function hasListeners(?string $eventName = null)
{
if (null !== $eventName) {
return !empty($this->listeners[$eventName]);
@@ -152,7 +138,7 @@ public function hasListeners($eventName = null)
/**
* {@inheritdoc}
*/
- public function addListener($eventName, $listener, $priority = 0)
+ public function addListener(string $eventName, $listener, int $priority = 0)
{
$this->listeners[$eventName][$priority][] = $listener;
unset($this->sorted[$eventName], $this->optimized[$eventName]);
@@ -161,7 +147,7 @@ public function addListener($eventName, $listener, $priority = 0)
/**
* {@inheritdoc}
*/
- public function removeListener($eventName, $listener)
+ public function removeListener(string $eventName, $listener)
{
if (empty($this->listeners[$eventName])) {
return;
@@ -233,34 +219,14 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
* @param string $eventName The name of the event to dispatch
* @param object $event The event object to pass to the event handlers/listeners
*/
- protected function callListeners(iterable $listeners, string $eventName, $event)
+ protected function callListeners(iterable $listeners, string $eventName, object $event)
{
- if ($event instanceof Event) {
- $this->doDispatch($listeners, $eventName, $event);
-
- return;
- }
-
- $stoppable = $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;
+ $stoppable = $event instanceof StoppableEventInterface;
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
- // @deprecated: the ternary operator is part of a BC layer and should be removed in 5.0
- $listener($listener instanceof WrappedListener ? new LegacyEventProxy($event) : $event, $eventName, $this);
- }
- }
-
- /**
- * @deprecated since Symfony 4.3, use callListeners() instead
- */
- protected function doDispatch($listeners, $eventName, Event $event)
- {
- foreach ($listeners as $listener) {
- if ($event->isPropagationStopped()) {
- break;
- }
$listener($event, $eventName, $this);
}
}
diff --git a/vendor/symfony/event-dispatcher/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php
index ceaa62ae..4b65e5a6 100644
--- a/vendor/symfony/event-dispatcher/EventDispatcherInterface.php
+++ b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php
@@ -25,12 +25,10 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface
/**
* Adds an event listener that listens on the specified events.
*
- * @param string $eventName The event to listen on
- * @param callable $listener The listener
- * @param int $priority The higher this value, the earlier an event
- * listener will be triggered in the chain (defaults to 0)
+ * @param int $priority The higher this value, the earlier an event
+ * listener will be triggered in the chain (defaults to 0)
*/
- public function addListener($eventName, $listener, $priority = 0);
+ public function addListener(string $eventName, callable $listener, int $priority = 0);
/**
* Adds an event subscriber.
@@ -42,41 +40,31 @@ public function addSubscriber(EventSubscriberInterface $subscriber);
/**
* Removes an event listener from the specified events.
- *
- * @param string $eventName The event to remove a listener from
- * @param callable $listener The listener to remove
*/
- public function removeListener($eventName, $listener);
+ public function removeListener(string $eventName, callable $listener);
public function removeSubscriber(EventSubscriberInterface $subscriber);
/**
* Gets the listeners of a specific event or all listeners sorted by descending priority.
*
- * @param string|null $eventName The name of the event
- *
- * @return array The event listeners for the specified event, or all event listeners by event name
+ * @return array
*/
- public function getListeners($eventName = null);
+ public function getListeners(?string $eventName = null);
/**
* Gets the listener priority for a specific event.
*
* Returns null if the event or the listener does not exist.
*
- * @param string $eventName The name of the event
- * @param callable $listener The listener
- *
- * @return int|null The event listener priority
+ * @return int|null
*/
- public function getListenerPriority($eventName, $listener);
+ public function getListenerPriority(string $eventName, callable $listener);
/**
* Checks whether an event has any registered listeners.
*
- * @param string|null $eventName The name of the event
- *
- * @return bool true if the specified event has any listeners, false otherwise
+ * @return bool
*/
- public function hasListeners($eventName = null);
+ public function hasListeners(?string $eventName = null);
}
diff --git a/vendor/symfony/event-dispatcher/EventSubscriberInterface.php b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php
index a0fc96df..2085e428 100644
--- a/vendor/symfony/event-dispatcher/EventSubscriberInterface.php
+++ b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php
@@ -43,7 +43,7 @@ interface EventSubscriberInterface
* The code must not depend on runtime state as it will only be called at compile time.
* All logic depending on runtime state must be put into the individual methods handling the events.
*
- * @return array The event names to listen to
+ * @return array>
*/
public static function getSubscribedEvents();
}
diff --git a/vendor/symfony/event-dispatcher/GenericEvent.php b/vendor/symfony/event-dispatcher/GenericEvent.php
index 23333bc2..4ecd29e3 100644
--- a/vendor/symfony/event-dispatcher/GenericEvent.php
+++ b/vendor/symfony/event-dispatcher/GenericEvent.php
@@ -11,12 +11,17 @@
namespace Symfony\Component\EventDispatcher;
+use Symfony\Contracts\EventDispatcher\Event;
+
/**
* Event encapsulation class.
*
* Encapsulates events thus decoupling the observer from the subject they encapsulate.
*
* @author Drak
+ *
+ * @implements \ArrayAccess
+ * @implements \IteratorAggregate
*/
class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
{
@@ -24,7 +29,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
protected $arguments;
/**
- * Encapsulate an event with $subject and $args.
+ * Encapsulate an event with $subject and $arguments.
*
* @param mixed $subject The subject of the event, usually an object or a callable
* @param array $arguments Arguments to store in the event
@@ -38,7 +43,7 @@ public function __construct($subject = null, array $arguments = [])
/**
* Getter for subject property.
*
- * @return mixed The observer subject
+ * @return mixed
*/
public function getSubject()
{
@@ -48,13 +53,11 @@ public function getSubject()
/**
* Get argument by key.
*
- * @param string $key Key
- *
- * @return mixed Contents of array key
+ * @return mixed
*
* @throws \InvalidArgumentException if key is not found
*/
- public function getArgument($key)
+ public function getArgument(string $key)
{
if ($this->hasArgument($key)) {
return $this->arguments[$key];
@@ -66,12 +69,11 @@ public function getArgument($key)
/**
* Add argument to event.
*
- * @param string $key Argument name
- * @param mixed $value Value
+ * @param mixed $value Value
*
* @return $this
*/
- public function setArgument($key, $value)
+ public function setArgument(string $key, $value)
{
$this->arguments[$key] = $value;
@@ -91,8 +93,6 @@ public function getArguments()
/**
* Set args property.
*
- * @param array $args Arguments
- *
* @return $this
*/
public function setArguments(array $args = [])
@@ -105,11 +105,9 @@ public function setArguments(array $args = [])
/**
* Has argument.
*
- * @param string $key Key of arguments array
- *
* @return bool
*/
- public function hasArgument($key)
+ public function hasArgument(string $key)
{
return \array_key_exists($key, $this->arguments);
}
@@ -174,7 +172,7 @@ public function offsetExists($key)
/**
* IteratorAggregate for iterating over the object like an array.
*
- * @return \ArrayIterator
+ * @return \ArrayIterator
*/
#[\ReturnTypeWillChange]
public function getIterator()
diff --git a/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php b/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
index f3d04d25..4e00bfa4 100644
--- a/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
+++ b/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
@@ -22,32 +22,21 @@ class ImmutableEventDispatcher implements EventDispatcherInterface
public function __construct(EventDispatcherInterface $dispatcher)
{
- $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
+ $this->dispatcher = $dispatcher;
}
/**
* {@inheritdoc}
- *
- * @param string|null $eventName
*/
- public function dispatch($event/* , string $eventName = null */)
+ public function dispatch(object $event, ?string $eventName = null): object
{
- $eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
-
- if (\is_scalar($event)) {
- // deprecated
- $swap = $event;
- $event = $eventName ?? new Event();
- $eventName = $swap;
- }
-
return $this->dispatcher->dispatch($event, $eventName);
}
/**
* {@inheritdoc}
*/
- public function addListener($eventName, $listener, $priority = 0)
+ public function addListener(string $eventName, $listener, int $priority = 0)
{
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
}
@@ -63,7 +52,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber)
/**
* {@inheritdoc}
*/
- public function removeListener($eventName, $listener)
+ public function removeListener(string $eventName, $listener)
{
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
}
@@ -79,7 +68,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
/**
* {@inheritdoc}
*/
- public function getListeners($eventName = null)
+ public function getListeners(?string $eventName = null)
{
return $this->dispatcher->getListeners($eventName);
}
@@ -87,7 +76,7 @@ public function getListeners($eventName = null)
/**
* {@inheritdoc}
*/
- public function getListenerPriority($eventName, $listener)
+ public function getListenerPriority(string $eventName, $listener)
{
return $this->dispatcher->getListenerPriority($eventName, $listener);
}
@@ -95,7 +84,7 @@ public function getListenerPriority($eventName, $listener)
/**
* {@inheritdoc}
*/
- public function hasListeners($eventName = null)
+ public function hasListeners(?string $eventName = null)
{
return $this->dispatcher->hasListeners($eventName);
}
diff --git a/vendor/symfony/event-dispatcher/LICENSE b/vendor/symfony/event-dispatcher/LICENSE
index 88bf75bb..0138f8f0 100644
--- a/vendor/symfony/event-dispatcher/LICENSE
+++ b/vendor/symfony/event-dispatcher/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2022 Fabien Potencier
+Copyright (c) 2004-present 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/event-dispatcher/LegacyEventDispatcherProxy.php b/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php
index a802c993..6e17c8fc 100644
--- a/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php
+++ b/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php
@@ -11,137 +11,21 @@
namespace Symfony\Component\EventDispatcher;
-use Psr\EventDispatcher\StoppableEventInterface;
-use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
-use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface;
+use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
+
+trigger_deprecation('symfony/event-dispatcher', '5.1', '%s is deprecated, use the event dispatcher without the proxy.', LegacyEventDispatcherProxy::class);
/**
* A helper class to provide BC/FC with the legacy signature of EventDispatcherInterface::dispatch().
*
- * This class should be deprecated in Symfony 5.1
- *
* @author Nicolas Grekas
+ *
+ * @deprecated since Symfony 5.1
*/
-final class LegacyEventDispatcherProxy implements EventDispatcherInterface
+final class LegacyEventDispatcherProxy
{
- private $dispatcher;
-
- public static function decorate(?ContractsEventDispatcherInterface $dispatcher): ?ContractsEventDispatcherInterface
- {
- if (null === $dispatcher) {
- return null;
- }
- $r = new \ReflectionMethod($dispatcher, 'dispatch');
- $param2 = $r->getParameters()[1] ?? null;
-
- if (!$param2 || !$param2->hasType() || $param2->getType()->isBuiltin()) {
- return $dispatcher;
- }
-
- @trigger_error(sprintf('The signature of the "%s::dispatch()" method should be updated to "dispatch($event, string $eventName = null)", not doing so is deprecated since Symfony 4.3.', $r->class), \E_USER_DEPRECATED);
-
- $self = new self();
- $self->dispatcher = $dispatcher;
-
- return $self;
- }
-
- /**
- * {@inheritdoc}
- *
- * @param string|null $eventName
- *
- * @return object
- */
- public function dispatch($event/* , string $eventName = null */)
- {
- $eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
-
- if (\is_object($event)) {
- $eventName = $eventName ?? \get_class($event);
- } elseif (\is_string($event) && (null === $eventName || $eventName instanceof ContractsEvent || $eventName instanceof Event)) {
- @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.', ContractsEventDispatcherInterface::class), \E_USER_DEPRECATED);
- $swap = $event;
- $event = $eventName ?? new Event();
- $eventName = $swap;
- } else {
- throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an object, "%s" given.', ContractsEventDispatcherInterface::class, \is_object($event) ? \get_class($event) : \gettype($event)));
- }
-
- $listeners = $this->getListeners($eventName);
- $stoppable = $event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;
-
- foreach ($listeners as $listener) {
- if ($stoppable && $event->isPropagationStopped()) {
- break;
- }
- $listener($event, $eventName, $this);
- }
-
- return $event;
- }
-
- /**
- * {@inheritdoc}
- */
- public function addListener($eventName, $listener, $priority = 0)
- {
- return $this->dispatcher->addListener($eventName, $listener, $priority);
- }
-
- /**
- * {@inheritdoc}
- */
- public function addSubscriber(EventSubscriberInterface $subscriber)
- {
- return $this->dispatcher->addSubscriber($subscriber);
- }
-
- /**
- * {@inheritdoc}
- */
- public function removeListener($eventName, $listener)
- {
- return $this->dispatcher->removeListener($eventName, $listener);
- }
-
- /**
- * {@inheritdoc}
- */
- public function removeSubscriber(EventSubscriberInterface $subscriber)
- {
- return $this->dispatcher->removeSubscriber($subscriber);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getListeners($eventName = null): array
- {
- return $this->dispatcher->getListeners($eventName);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getListenerPriority($eventName, $listener): ?int
- {
- return $this->dispatcher->getListenerPriority($eventName, $listener);
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasListeners($eventName = null): bool
- {
- return $this->dispatcher->hasListeners($eventName);
- }
-
- /**
- * Proxies all method calls to the original event dispatcher.
- */
- public function __call($method, $arguments)
+ public static function decorate(?EventDispatcherInterface $dispatcher): ?EventDispatcherInterface
{
- return $this->dispatcher->{$method}(...$arguments);
+ return $dispatcher;
}
}
diff --git a/vendor/symfony/polyfill-intl-idn/Idn.php b/vendor/symfony/polyfill-intl-idn/Idn.php
index 3dc06120..eb6bada0 100644
--- a/vendor/symfony/polyfill-intl-idn/Idn.php
+++ b/vendor/symfony/polyfill-intl-idn/Idn.php
@@ -280,10 +280,6 @@ private static function mapCodePoints($input, array $options, Info $info)
switch ($data['status']) {
case 'disallowed':
- $info->errors |= self::ERROR_DISALLOWED;
-
- // no break.
-
case 'valid':
$str .= mb_chr($codePoint, 'utf-8');
@@ -294,7 +290,7 @@ private static function mapCodePoints($input, array $options, Info $info)
break;
case 'mapped':
- $str .= $data['mapping'];
+ $str .= $transitional && 0x1E9E === $codePoint ? 'ss' : $data['mapping'];
break;
@@ -346,6 +342,18 @@ private static function process($domain, array $options, Info $info)
$validationOptions = $options;
if ('xn--' === substr($label, 0, 4)) {
+ // Step 4.1. If the label contains any non-ASCII code point (i.e., a code point greater than U+007F),
+ // record that there was an error, and continue with the next label.
+ if (preg_match('/[^\x00-\x7F]/', $label)) {
+ $info->errors |= self::ERROR_PUNYCODE;
+
+ continue;
+ }
+
+ // Step 4.2. Attempt to convert the rest of the label to Unicode according to Punycode [RFC3492]. If
+ // that conversion fails, record that there was an error, and continue
+ // with the next label. Otherwise replace the original label in the string by the results of the
+ // conversion.
try {
$label = self::punycodeDecode(substr($label, 4));
} catch (\Exception $e) {
@@ -516,6 +524,8 @@ private static function validateLabel($label, Info $info, array $options, $canBe
if ('-' === substr($label, -1, 1)) {
$info->errors |= self::ERROR_TRAILING_HYPHEN;
}
+ } elseif ('xn--' === substr($label, 0, 4)) {
+ $info->errors |= self::ERROR_PUNYCODE;
}
// Step 4. The label must not contain a U+002E (.) FULL STOP.
diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php
index 2e0b9694..1ad33a86 100644
--- a/vendor/symfony/polyfill-mbstring/Mbstring.php
+++ b/vendor/symfony/polyfill-mbstring/Mbstring.php
@@ -48,6 +48,8 @@
* - mb_strstr - Finds first occurrence of a string within another
* - mb_strwidth - Return width of string
* - mb_substr_count - Count the number of substring occurrences
+ * - mb_ucfirst - Make a string's first character uppercase
+ * - mb_lcfirst - Make a string's first character lowercase
*
* Not implemented:
* - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more)
@@ -80,6 +82,21 @@ final class Mbstring
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
{
+ if (\is_array($s)) {
+ if (PHP_VERSION_ID < 70200) {
+ trigger_error('mb_convert_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING);
+
+ return null;
+ }
+
+ $r = [];
+ foreach ($s as $str) {
+ $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding);
+ }
+
+ return $r;
+ }
+
if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) {
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
} else {
@@ -410,7 +427,7 @@ public static function mb_encoding_aliases($encoding)
public static function mb_check_encoding($var = null, $encoding = null)
{
- if (PHP_VERSION_ID < 70200 && \is_array($var)) {
+ if (\PHP_VERSION_ID < 70200 && \is_array($var)) {
trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING);
return null;
@@ -437,7 +454,6 @@ public static function mb_check_encoding($var = null, $encoding = null)
}
return true;
-
}
public static function mb_detect_encoding($str, $encodingList = null, $strict = false)
@@ -827,7 +843,7 @@ public static function mb_ord($s, $encoding = null)
return $code;
}
- public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string
+ public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string
{
if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) {
throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH');
@@ -835,17 +851,8 @@ public static function mb_str_pad(string $string, int $length, string $pad_strin
if (null === $encoding) {
$encoding = self::mb_internal_encoding();
- }
-
- try {
- $validEncoding = @self::mb_check_encoding('', $encoding);
- } catch (\ValueError $e) {
- throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding));
- }
-
- // BC for PHP 7.3 and lower
- if (!$validEncoding) {
- throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding));
+ } else {
+ self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given');
}
if (self::mb_strlen($pad_string, $encoding) <= 0) {
@@ -871,6 +878,34 @@ public static function mb_str_pad(string $string, int $length, string $pad_strin
}
}
+ public static function mb_ucfirst(string $string, ?string $encoding = null): string
+ {
+ if (null === $encoding) {
+ $encoding = self::mb_internal_encoding();
+ } else {
+ self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given');
+ }
+
+ $firstChar = mb_substr($string, 0, 1, $encoding);
+ $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding);
+
+ return $firstChar.mb_substr($string, 1, null, $encoding);
+ }
+
+ public static function mb_lcfirst(string $string, ?string $encoding = null): string
+ {
+ if (null === $encoding) {
+ $encoding = self::mb_internal_encoding();
+ } else {
+ self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given');
+ }
+
+ $firstChar = mb_substr($string, 0, 1, $encoding);
+ $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding);
+
+ return $firstChar.mb_substr($string, 1, null, $encoding);
+ }
+
private static function getSubpart($pos, $part, $haystack, $encoding)
{
if (false === $pos) {
@@ -944,4 +979,18 @@ private static function getEncoding($encoding)
return $encoding;
}
+
+ private static function assertEncoding(string $encoding, string $errorFormat): void
+ {
+ try {
+ $validEncoding = @self::mb_check_encoding('', $encoding);
+ } catch (\ValueError $e) {
+ throw new \ValueError(\sprintf($errorFormat, $encoding));
+ }
+
+ // BC for PHP 7.3 and lower
+ if (!$validEncoding) {
+ throw new \ValueError(\sprintf($errorFormat, $encoding));
+ }
+ }
}
diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php
index ecf1a035..6e4b5fce 100644
--- a/vendor/symfony/polyfill-mbstring/bootstrap.php
+++ b/vendor/symfony/polyfill-mbstring/bootstrap.php
@@ -136,6 +136,14 @@ function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstrin
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
}
+if (!function_exists('mb_ucfirst')) {
+ function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
+}
+
+if (!function_exists('mb_lcfirst')) {
+ function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
+}
+
if (extension_loaded('mbstring')) {
return;
}
diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php
index 2f9fb5b4..ec2ae427 100644
--- a/vendor/symfony/polyfill-mbstring/bootstrap80.php
+++ b/vendor/symfony/polyfill-mbstring/bootstrap80.php
@@ -132,6 +132,14 @@ function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = nul
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
}
+if (!function_exists('mb_ucfirst')) {
+ function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
+}
+
+if (!function_exists('mb_lcfirst')) {
+ function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
+}
+
if (extension_loaded('mbstring')) {
return;
}
diff --git a/vendor/symfony/polyfill-php72/Php72.php b/vendor/symfony/polyfill-php72/Php72.php
index 7bf96c99..e97b1b27 100644
--- a/vendor/symfony/polyfill-php72/Php72.php
+++ b/vendor/symfony/polyfill-php72/Php72.php
@@ -141,6 +141,7 @@ public static function stream_isatty($stream)
if ('\\' === \DIRECTORY_SEPARATOR) {
$stat = @fstat($stream);
+
// Check if formatted mode is S_IFCHR
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
}
diff --git a/views/notice/easycron_update.php b/views/notice/easycron_update.php
new file mode 100644
index 00000000..fb73437b
--- /dev/null
+++ b/views/notice/easycron_update.php
@@ -0,0 +1,6 @@
+
BackWpUp
+Dismiss
+
+
+
+
diff --git a/views/notice/restore_feature_information.php b/views/notice/restore_feature_information.php
new file mode 100644
index 00000000..c937440a
--- /dev/null
+++ b/views/notice/restore_feature_information.php
@@ -0,0 +1,5 @@
+
+Dismiss
+
+
+
diff --git a/views/restore/steps/step1_action.php b/views/restore/steps/step1_action.php
index b75441c1..a6eefa81 100644
--- a/views/restore/steps/step1_action.php
+++ b/views/restore/steps/step1_action.php
@@ -13,9 +13,7 @@ class="metabox-holder postbox backwpup-cleared-postbox backwpup-full-width actio
decrypt_key_input();
?>