From df89373e620aa6ead49622245825e92aab017fd5 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 16 Aug 2019 02:25:14 +0200 Subject: [PATCH 1/5] Fix some docblocks. --- .../Command/AbstractConfigCommand.php | 4 +++ src/Symfony/Component/BrowserKit/Cookie.php | 7 +++++ .../Component/BrowserKit/CookieJar.php | 4 +-- .../Component/Filesystem/Filesystem.php | 5 ++++ src/Symfony/Component/Process/Process.php | 26 +++++++++---------- .../Http/Logout/LogoutUrlGenerator.php | 10 +++---- src/Symfony/Component/Workflow/Registry.php | 7 +++++ 7 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php index fe0d60b555..c038133975 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php @@ -14,6 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Command; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\StyleInterface; use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; @@ -26,6 +27,9 @@ use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; */ abstract class AbstractConfigCommand extends ContainerDebugCommand { + /** + * @param OutputInterface|StyleInterface $output + */ protected function listBundles($output) { $title = 'Available registered bundles with their extension alias if available'; diff --git a/src/Symfony/Component/BrowserKit/Cookie.php b/src/Symfony/Component/BrowserKit/Cookie.php index b012330335..9a3e2580eb 100644 --- a/src/Symfony/Component/BrowserKit/Cookie.php +++ b/src/Symfony/Component/BrowserKit/Cookie.php @@ -190,6 +190,11 @@ class Cookie ); } + /** + * @param string $dateValue + * + * @return string|null + */ private static function parseDate($dateValue) { // trim single quotes around date if present @@ -207,6 +212,8 @@ class Cookie if (false !== $date = date_create($dateValue, new \DateTimeZone('GMT'))) { return $date->format('U'); } + + return null; } /** diff --git a/src/Symfony/Component/BrowserKit/CookieJar.php b/src/Symfony/Component/BrowserKit/CookieJar.php index bce66197d3..835af19574 100644 --- a/src/Symfony/Component/BrowserKit/CookieJar.php +++ b/src/Symfony/Component/BrowserKit/CookieJar.php @@ -111,8 +111,8 @@ class CookieJar /** * Updates the cookie jar from a response Set-Cookie headers. * - * @param array $setCookies Set-Cookie headers from an HTTP response - * @param string $uri The base URL + * @param string[] $setCookies Set-Cookie headers from an HTTP response + * @param string $uri The base URL */ public function updateFromSetCookie(array $setCookies, $uri = null) { diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index eedd6fbda7..cd456c7848 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -743,6 +743,11 @@ class Filesystem return 2 === \count($components) ? [$components[0], $components[1]] : [null, $components[0]]; } + /** + * @param callable $func + * + * @return mixed + */ private static function box($func) { self::$lastError = null; diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 05873c0e7b..84f238d1b3 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -217,7 +217,7 @@ class Process implements \IteratorAggregate * This is identical to run() except that an exception is thrown if the process * exits with a non-zero exit code. * - * @return self + * @return $this * * @throws RuntimeException if PHP was compiled with --enable-sigchild and the enhanced sigchild compatibility mode is not enabled * @throws ProcessFailedException if the process didn't terminate successfully @@ -942,7 +942,7 @@ class Process implements \IteratorAggregate * * @param string|array $commandline The command to execute * - * @return self The current Process instance + * @return $this */ public function setCommandLine($commandline) { @@ -978,7 +978,7 @@ class Process implements \IteratorAggregate * * @param int|float|null $timeout The timeout in seconds * - * @return self The current Process instance + * @return $this * * @throws InvalidArgumentException if the timeout is negative */ @@ -996,7 +996,7 @@ class Process implements \IteratorAggregate * * @param int|float|null $timeout The timeout in seconds * - * @return self The current Process instance + * @return $this * * @throws LogicException if the output is disabled * @throws InvalidArgumentException if the timeout is negative @@ -1017,7 +1017,7 @@ class Process implements \IteratorAggregate * * @param bool $tty True to enabled and false to disable * - * @return self The current Process instance + * @return $this * * @throws RuntimeException In case the TTY mode is not supported */ @@ -1058,7 +1058,7 @@ class Process implements \IteratorAggregate * * @param bool $bool * - * @return self + * @return $this */ public function setPty($bool) { @@ -1098,7 +1098,7 @@ class Process implements \IteratorAggregate * * @param string $cwd The new working directory * - * @return self The current Process instance + * @return $this */ public function setWorkingDirectory($cwd) { @@ -1130,7 +1130,7 @@ class Process implements \IteratorAggregate * * @param array $env The new environment variables * - * @return self The current Process instance + * @return $this */ public function setEnv(array $env) { @@ -1161,7 +1161,7 @@ class Process implements \IteratorAggregate * * @param string|int|float|bool|resource|\Traversable|null $input The content * - * @return self The current Process instance + * @return $this * * @throws LogicException In case the process is running */ @@ -1195,7 +1195,7 @@ class Process implements \IteratorAggregate * * @param array $options The new options * - * @return self The current Process instance + * @return $this * * @deprecated since version 3.3, to be removed in 4.0. */ @@ -1229,7 +1229,7 @@ class Process implements \IteratorAggregate * * @param bool $enhance * - * @return self The current Process instance + * @return $this * * @deprecated since version 3.3, to be removed in 4.0. Enhanced Windows compatibility will always be enabled. */ @@ -1265,7 +1265,7 @@ class Process implements \IteratorAggregate * * @param bool $enhance * - * @return self The current Process instance + * @return $this * * @deprecated since version 3.3, to be removed in 4.0. */ @@ -1283,7 +1283,7 @@ class Process implements \IteratorAggregate * * @param bool $inheritEnv * - * @return self The current Process instance + * @return $this */ public function inheritEnvironmentVariables($inheritEnv = true) { diff --git a/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php b/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php index 95ccdbf87f..71a071f350 100644 --- a/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php +++ b/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php @@ -41,11 +41,11 @@ class LogoutUrlGenerator /** * Registers a firewall's LogoutListener, allowing its URL to be generated. * - * @param string $key The firewall key - * @param string $logoutPath The path that starts the logout process - * @param string $csrfTokenId The ID of the CSRF token - * @param string $csrfParameter The CSRF token parameter name - * @param CsrfTokenManagerInterface|null $csrfTokenManager A CsrfTokenManagerInterface instance + * @param string $key The firewall key + * @param string $logoutPath The path that starts the logout process + * @param string|null $csrfTokenId The ID of the CSRF token + * @param string|null $csrfParameter The CSRF token parameter name + * @param string|null $context The listener context */ public function registerListener($key, $logoutPath, $csrfTokenId, $csrfParameter, CsrfTokenManagerInterface $csrfTokenManager = null/*, string $context = null*/) { diff --git a/src/Symfony/Component/Workflow/Registry.php b/src/Symfony/Component/Workflow/Registry.php index 8d3d19a7a3..a2e7b8b230 100644 --- a/src/Symfony/Component/Workflow/Registry.php +++ b/src/Symfony/Component/Workflow/Registry.php @@ -63,6 +63,13 @@ class Registry return $matched; } + /** + * @param SupportStrategyInterface $supportStrategy + * @param object $subject + * @param string|null $workflowName + * + * @return bool + */ private function supports(Workflow $workflow, $supportStrategy, $subject, $workflowName) { if (null !== $workflowName && $workflowName !== $workflow->getName()) { From fed395de4e13611751855819e35ffba78d5eda78 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 18 Aug 2019 11:12:38 +0200 Subject: [PATCH 2/5] [Process] Doc block backport. --- src/Symfony/Component/Process/Process.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 84f238d1b3..9da1acefa4 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -972,7 +972,7 @@ class Process implements \IteratorAggregate } /** - * Sets the process timeout (max. runtime). + * Sets the process timeout (max. runtime) in seconds. * * To disable the timeout, set this value to null. * From f6623c11bd3234c2a4a5ce58614944995ca46ce6 Mon Sep 17 00:00:00 2001 From: Amine Yakoubi Date: Sun, 18 Aug 2019 17:34:57 +0100 Subject: [PATCH 3/5] Add missing translations for Armenian locale --- .../Resources/translations/validators.hy.xlf | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf index bc0daced86..b005518f35 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf @@ -314,6 +314,58 @@ This is not a valid Business Identifier Code (BIC). Սա վավեր Business Identifier Code (BIC) չէ։ + + Error + Սխալ + + + This is not a valid UUID. + Սա վավեր UUID չէ: + + + This value should be a multiple of {{ compared_value }}. + Այս արժեքը պետք է լինի բազմակի {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Բիզնեսի նույնականացման կոդը (BIC) կապված չէ IBAN- ի հետ {{ iban }}. + + + This value should be valid JSON. + Այս արժեքը պետք է լինի վավեր JSON: + + + This collection should contain only unique elements. + Այս հավաքածուն պետք է պարունակի միայն եզակի տարրեր: + + + This value should be positive. + Այս արժեքը պետք է լինի դրական: + + + This value should be either positive or zero. + Այս արժեքը պետք է լինի դրական կամ զրոյական: + + + This value should be negative. + Այս արժեքը պետք է լինի բացասական: + + + This value should be either negative or zero. + Այս արժեքը պետք է լինի բացասական կամ զրոյական: + + + This value is not a valid timezone. + Այս արժեքը վավեր ժամանակի գոտի չէ: + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Այս գաղտնաբառն արտահոսվել է տվյալների խախտման մեջ, այն չպետք է օգտագործվի: Խնդրում ենք օգտագործել մեկ այլ գաղտնաբառ: + + + This value should be between {{ min }} and {{ max }}. + Այս արժեքը պետք է լինի միջև {{ min }} և {{ max }}. + From a8842072a58db3ac1e4b4c2761c6c7d092dbe2d4 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 18 Aug 2019 22:04:16 +0200 Subject: [PATCH 4/5] [DI] fix docblock --- src/Symfony/Component/DependencyInjection/ChildDefinition.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/ChildDefinition.php b/src/Symfony/Component/DependencyInjection/ChildDefinition.php index 29fbd48f2d..123b387475 100644 --- a/src/Symfony/Component/DependencyInjection/ChildDefinition.php +++ b/src/Symfony/Component/DependencyInjection/ChildDefinition.php @@ -89,7 +89,7 @@ class ChildDefinition extends Definition * @param int|string $index * @param mixed $value * - * @return self the current instance + * @return $this * * @throws InvalidArgumentException when $index isn't an integer */ From 5d26f4c72e2eed17065e22010d6ae4dfc6583617 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 19 Aug 2019 11:00:11 +0200 Subject: [PATCH 5/5] [Routing] Add a param annotation for $annot. --- .../Component/Routing/Loader/AnnotationClassLoader.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php index 9ecb554df8..2a715e35d7 100644 --- a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php +++ b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php @@ -15,6 +15,7 @@ use Doctrine\Common\Annotations\Reader; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderResolverInterface; use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Routing\Annotation\Route as RouteAnnotation; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; @@ -129,6 +130,10 @@ abstract class AnnotationClassLoader implements LoaderInterface return $collection; } + /** + * @param RouteAnnotation $annot or an object that exposes a similar interface + * @param array $globals + */ protected function addRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method) { $name = $annot->getName();