8000 Merge branch '4.4' into 5.2 · symfony/symfony@e2185bc · GitHub
[go: up one dir, main page]

Skip to content

Commit e2185bc

Browse files
Merge branch '4.4' into 5.2
* 4.4: Backport type fixes uzb translation [DependencyInjection] Fix doc blocks [DependencyInjection] Turn $defaultDeprecationTemplate into a constant [Form] better form doc types to support static analysis
2 parents 501fa51 + cf0f3c9 commit e2185bc
  • ParameterBag
  • Tests/Compiler
  • ErrorHandler
  • EventDispatcher/Tests
  • Filesystem
  • Finder
  • Form
  • HttpClient/Response
  • HttpFoundation
  • HttpKernel
  • Intl/Resources/bin
  • Messenger/Transport/Serialization
  • Mime
  • OptionsResolver
  • Process/Pipes
  • Routing
  • Security
  • Serializer
  • Translation
  • Validator
  • VarDumper
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    87 files changed

    +147
    -284
    lines changed

    src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php

    Lines changed: 1 addition & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -26,11 +26,8 @@ class ControllerResolver extends ContainerControllerResolver
    2626
    */
    2727
    protected function instantiateController($class): object
    2828
    {
    29-
    return $this->configureController(parent::instantiateController($class), $class);
    30-
    }
    29+
    $controller = parent::instantiateController($class);
    3130

    32-
    private function configureController($controller, string $class): object
    33-
    {
    3431
    if ($controller instanceof ContainerAwareInterface) {
    3532
    $controller->setContainer($this->container);
    3633
    }

    src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php

    Lines changed: 0 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -16,8 +16,6 @@
    1616
    use Symfony\Component\HttpKernel\DataCollector\RouterDataCollector as BaseRouterDataCollector;
    1717

    1818
    /**
    19-
    * RouterDataCollector.
    20-
    *
    2119
    * @author Fabien Potencier <fabien@symfony.com>
    2220
    *
    2321
    * @final

    src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -25,7 +25,7 @@ class AnnotatedRouteControllerLoader extends AnnotationClassLoader
    2525
    /**
    2626
    * Configures the _controller default parameter of a given Route instance.
    2727
    *
    28-
    * @param mixed $annot The annotation class instance
    28+
    * @param object $annot The annotation class instance
    2929
    */
    3030
    protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
    3131
    {

    src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

    Lines changed: 0 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -20,8 +20,6 @@
    2020
    use Symfony\Component\Translation\Translator as BaseTranslator;
    2121

    2222
    /**
    23-
    * Translator.
    24-
    *
    2523
    * @author Fabien Potencier <fabien@symfony.com>
    2624
    */
    2725
    class Translator extends BaseTranslator implements WarmableInterface

    src/Symfony/Component/Config/Resource/ClassExistenceResource.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -42,9 +42,6 @@ public function __construct(string $resource, bool $exists = null)
    4242
    }
    4343
    }
    4444

    45-
    /**
    46-
    * {@inheritdoc}
    47-
    */
    4845
    public function __toString(): string
    4946
    {
    5047
    return $this->resource;

    src/Symfony/Component/Config/Resource/ComposerResource.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -35,9 +35,6 @@ public function getVendors(): array
    3535
    return array_keys($this->vendors);
    3636
    }
    3737

    38-
    /**
    39-
    * {@inheritdoc}
    40-
    */
    4138
    public function __toString(): string
    4239
    {
    4340
    return __CLASS__;

    src/Symfony/Component/Config/Resource/DirectoryResource.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -39,9 +39,6 @@ public function __construct(string $resource, string $pattern = null)
    3939
    }
    4040
    }
    4141

    42-
    /**
    43-
    * {@inheritdoc}
    44-
    */
    4542
    public function __toString(): string
    4643
    {
    4744
    return md5(serialize([$this->resource, $this->pattern]));

    src/Symfony/Component/Config/Resource/FileExistenceResource.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -36,9 +36,6 @@ public function __construct(string $resource)
    3636
    $this->exists = file_exists($resource);
    3737
    }
    3838

    39-
    /**
    40-
    * {@inheritdoc}
    41-
    */
    4239
    public function __toString(): string
    4340
    {
    4441
    return $this->resource;

    src/Symfony/Component/Config/Resource/FileResource.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -41,9 +41,6 @@ public function __construct(string $resource)
    4141
    }
    4242
    }
    4343

    44-
    /**
    45-
    * {@inheritdoc}
    46-
    */
    4744
    public function __toString(): string
    4845
    {
    4946
    return $this->resource;

    src/Symfony/Component/Config/Resource/GlobResource.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -60,9 +60,6 @@ public function getPrefix(): string
    6060
    return $this->prefix;
    6161
    }
    6262

    63-
    /**
    64-
    * {@inheritdoc}
    65-
    */
    6663
    public function __toString(): string
    6764
    {
    6865
    return 'glob.'.$this->prefix.(int) $this->recursive.$this->pattern.(int) $this->forExclusion.implode("\0", $this->excludedPrefixes);

    src/Symfony/Component/Config/Resource/ResourceInterface.php

    Lines changed: 0 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -26,8 +26,6 @@ interface ResourceInterface
    2626
    * to be identical for different ResourceInterface instances referring to the same
    2727
    * resource; and it should be unlikely to collide with that of other, unrelated
    2828
    * resource instances.
    29-
    *
    30-
    * @return string A string representation unique to the underlying Resource
    3129
    */
    3230
    public function __toString();
    3331
    }

    src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php

    Lines changed: 1 addition & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -222,8 +222,6 @@ protected function getTestBuilder(): ExprBuilder
    222222
    *
    223223
    * @param array|null $config The config you want to use for the finalization, if nothing provided
    224224
    * a simple ['key'=>'value'] will be used
    225-
    *
    226-
    * @return array The finalized config values
    227225
    */
    228226
    protected function finalizeTestBuilder(NodeDefinition $nodeDefinition, array $config = null): array
    229227
    {
    @@ -254,7 +252,7 @@ protected function returnClosure($val): \Closure
    254252
    * @param mixed $value The value to test
    255253
    * @param mixed $config The config values that new to be finalized
    256254
    */
    257-
    protected function assertFinalizedValueIs($value, NodeDefinition $nodeDefinition, $config = null)
    255+
    protected function assertFinalizedValueIs($value, NodeDefinition $nodeDefinition, $config = null): void
    258256
    {
    259257
    $this->assertEquals(['key' => $value], $this->finalizeTestBuilder($nodeDefinition, $config));
    260258
    }

    src/Symfony/Component/Console/Command/Command.php

    Lines changed: 5 additions & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -375,8 +375,8 @@ public function getNativeDefinition()
    375375
    /**
    376376
    * Adds an argument.
    377377
    *
    378-
    * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
    379-
    * @param string|string[]|null $default The default value (for InputArgument::OPTIONAL mode only)
    378+
    * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
    379+
    * @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
    380380
    *
    381381
    * @throws InvalidArgumentException When argument mode is not valid
    382382
    *
    @@ -395,9 +395,9 @@ public function addArgument(string $name, int $mode = null, string $description
    395395
    /**
    396396
    * Adds an option.
    397397
    *
    398-
    * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
    399-
    * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
    400-
    * @param string|string[]|bool|null $default The default value (must be null for InputOption::VALUE_NONE)
    398+
    * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
    399+
    * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
    400+
    * @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
    401401
    *
    402402
    * @throws InvalidArgumentException If option mode is invalid or incompatible
    403403
    *

    src/Symfony/Component/Console/Helper/Table.php

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -596,11 +596,11 @@ private function buildTableRows(array $rows): TableRows
    596596

    597597
    return new TableRows(function () use ($rows, $unmergedRows): \Traversable {
    598598
    foreach ($rows as $rowKey => $row) {
    599-
    yield $this->fillCells($row);
    599+
    yield $row instanceof TableSeparator ? $row : $this->fillCells($row);
    600600

    601601
    if (isset($unmergedRows[$rowKey])) {
    602-
    foreach ($unmergedRows[$rowKey] as $unmergedRow) {
    603-
    yield $this->fillCells($unmergedRow);
    602+
    foreach ($unmergedRows[$rowKey] as $row) {
    603+
    yield $row instanceof TableSeparator ? $row : $this->fillCells($row);
    604604
    }
    605605
    }
    606606
    }
    @@ -681,7 +681,7 @@ private function fillNextRows(array $rows, int $line): array
    681681
    /**
    682682
    * fill cells for a row that contains colspan > 1.
    683683
    */
    684-
    private function fillCells($row)
    684+
    private function fillCells(iterable $row)
    685685
    {
    686686
    $newRow = [];
    687687

    src/Symfony/Component/Console/Input/InputArgument.php

    Lines changed: 6 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -31,10 +31,10 @@ class InputArgument
    3131
    private $description;
    3232

    3333
    /**
    34-
    * @param string $name The argument name
    35-
    * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
    36-
    * @param string $description A description text
    37-
    * @param string|string[]|null $default The default value (for self::OPTIONAL mode only)
    34+
    * @param string $name The argument name
    35+
    * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
    36+
    * @param string $description A description text
    37+
    * @param mixed $default The default value (for self::OPTIONAL mode only)
    3838
    *
    3939
    * @throws InvalidArgumentException When argument mode is not valid
    4040
    */
    @@ -86,7 +86,7 @@ public function isArray()
    8686
    /**
    8787
    * Sets the default value.
    8888
    *
    89-
    * @param string|string[]|null $default The default value
    89+
    * @param mixed $default The default value
    9090
    *
    9191
    * @throws LogicException When incorrect default value is given
    9292
    */
    @@ -110,7 +110,7 @@ public function setDefault($default = null)
    110110
    /**
    111111
    * Returns the default value.
    112112
    *
    113-
    * @return string|string[]|null The default value
    113+
    * @return mixed
    114114
    */
    115115
    public function getDefault()
    116116
    {

    src/Symfony/Component/Console/Input/InputInterface.php

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -83,7 +83,7 @@ public function getArguments();
    10000 8383
    /**
    8484
    * Returns the argument value for a given argument name.
    8585
    *
    86-
    * @return string|string[]|null The argument value
    86+
    * @return mixed
    8787
    *
    8888
    * @throws InvalidArgumentException When argument given doesn't exist
    8989
    */
    @@ -92,7 +92,7 @@ public function getArgument(string $name);
    9292
    /**
    9393
    * Sets an argument value by name.
    9494
    *
    95-
    * @param string|string[]|null $value The argument value
    95+
    * @param mixed $value The argument value
    9696
    *
    9797
    * @throws InvalidArgumentException When argument given doesn't exist
    9898
    */
    @@ -117,7 +117,7 @@ public function getOptions();
    117117
    /**
    118118
    * Returns the option value for a given option name.
    119119
    *
    120-
    * @return string|string[]|bool|null The option value
    120+
    * @return mixed
    121121
    *
    122122
    * @throws InvalidArgumentException When option given doesn't exist
    123123
    */
    @@ -126,7 +126,7 @@ public function getOption(string $name);
    126126
    /**
    127127
    * Sets an option value by name.
    128128
    *
    129-
    * @param string|string[]|bool|null $value The option value
    129+
    * @param mixed $value The option value
    130130
    *
    131131
    * @throws InvalidArgumentException When option given doesn't exist
    132132
    */

    src/Symfony/Component/Console/Input/InputOption.php

    Lines changed: 7 additions & 7 deletions
    Original file line numberDiff line numberDiff line change
    @@ -48,11 +48,11 @@ class InputOption
    4848
    private $description;
    4949

    5050
    /**
    51-
    * @param string $name The option name
    52-
    * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
    53-
    * @param int|null $mode The option mode: One of the VALUE_* constants
    54-
    * @param string $description A description text
    55-
    * @param string|string[]|bool|null $default The default value (must be null for self::VALUE_NONE)
    51+
    * @param string $name The option name
    52+
    * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
    53+
    * @param int|null $mode The option mode: One of the VALUE_* constants
    54+
    * @param string $description A description text
    55+
    * @param mixed $default The default value (must be null for self::VALUE_NONE)
    5656
    *
    5757
    * @throws InvalidArgumentException If option mode is invalid or incompatible
    5858
    */
    @@ -164,7 +164,7 @@ public function isArray()
    164164
    /**
    165165
    * Sets the default value.
    166166
    *
    167-
    * @param string|string[]|bool|null $default The default value
    167+
    * @param mixed $default The default value
    168168
    *
    169169
    * @throws LogicException When incorrect default value is given
    170170
    */
    @@ -188,7 +188,7 @@ public function setDefault($default = null)
    188188
    /**
    189189
    * Returns the default value.
    190190
    *
    191-
    * @return string|string[]|bool|null The default value
    191+
    * @return mixed
    192192
    */
    193193
    public function getDefault()
    194194
    {

    src/Symfony/Component/Console/Output/Output.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -163,7 +163,7 @@ public function write($messages, bool $newline = false, int $options = self::OUT
    163163
    break;
    164164
    }
    165165

    166-
    $this->doWrite($message, $newline);
    166+
    $this->doWrite($message ?? '', $newline);
    167167
    }
    168168
    }
    169169

    src/Symfony/Component/CssSelector/Node/AttributeNode.php

    Lines changed: 0 additions & 3 deletions
    < 10000 /div>
    Original file line numberDiff line numberDiff line change
    @@ -71,9 +71,6 @@ public function getSpecificity(): Specificity
    7171
    return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
    7272
    }
    7373

    74-
    /**
    75-
    * {@inheritdoc}
    76-
    */
    7774
    public function __toString(): string
    7875
    {
    7976
    $attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute;

    src/Symfony/Component/CssSelector/Node/ClassNode.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -50,9 +50,6 @@ public function getSpecificity(): Specificity
    5050
    return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
    5151
    }
    5252

    53-
    /**
    54-
    * {@inheritdoc}
    55-
    */
    5653
    public function __toString(): string
    5754
    {
    5855
    return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name);

    src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -57,9 +57,6 @@ public function getSpecificity(): Specificity
    5757
    return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
    5858
    }
    5959

    60-
    /**
    61-
    * {@inheritdoc}
    62-
    */
    6360
    public function __toString(): string
    6461
    {
    6562
    $combinator = ' ' === $this->combinator ? '<followed>' : $this->combinator;

    src/Symfony/Component/CssSelector/Node/ElementNode.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -50,9 +50,6 @@ public function getSpecificity(): Specificity
    5050
    return new Specificity(0, 0, $this->element ? 1 : 0);
    5151
    }
    5252

    53-
    /**
    54-
    * {@inheritdoc}
    55-
    */
    5653
    public function __toString(): string
    5754
    {
    5855
    $element = $this->element ?: '*';

    src/Symfony/Component/CssSelector/Node/FunctionNode.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -65,9 +65,6 @@ public function getSpecificity(): Specificity
    6565
    return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
    6666
    }
    6767

    68-
    /**
    69-
    * {@inheritdoc}
    70-
    */
    7168
    public function __toString(): string
    7269
    {
    7370
    $arguments = implode(', ', array_map(function (Token $token) {

    src/Symfony/Component/CssSelector/Node/HashNode.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -50,9 +50,6 @@ public function getSpecificity(): Specificity
    5050
    return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0));
    5151
    }
    5252

    53-
    /**
    54-
    * {@inheritdoc}
    55-
    */
    5653
    public function __toString(): string
    5754
    {
    5855
    return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id);

    src/Symfony/Component/CssSelector/Node/NegationNode.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -50,9 +50,6 @@ public function getSpecificity(): Specificity
    5050
    return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
    5151
    }
    5252

    53-
    /**
    54-
    * {@inheritdoc}
    55-
    */
    5653
    public function __toString(): string
    5754
    {
    5855
    return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector);

    src/Symfony/Component/CssSelector/Node/PseudoNode.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -50,9 +50,6 @@ public function getSpecificity(): Specificity
    5050
    return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
    5151
    }
    5252

    53-
    /**
    54-
    * {@inheritdoc}
    55-
    */
    5653
    public function __toString(): string
    5754
    {
    5855
    return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier);

    src/Symfony/Component/CssSelector/Node/SelectorNode.php

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -50,9 +50,6 @@ public function getSpecificity(): Specificity
    5050
    return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0));
    5151
    }
    5252

    53-
    /**
    54-
    * {@inheritdoc}
    55-
    */
    5653
    public function __toString(): string
    5754
    {
    5855
    return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : '');

    0 commit comments

    Comments
     (0)
    0