10000 Merge branch '4.4' into 5.0 · symfony/symfony@c13974c · GitHub
[go: up one dir, main page]

Skip to content

Commit c13974c

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Fix CS Fix CS Fix CS [DependencyInjection][Xml] Fix the attribute 'tag' is not allowed in 'bind' tag
2 parents a652746 + 23e5d1a commit c13974c

File tree

18 files changed

+16
-24
lines changed

18 files changed

+16
-24
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,7 @@ private function getManagerName(ContainerBuilder $container): string
218218
}
219219
}
220220

221-
throw new InvalidArgumentException(sprintf(
222-
'Could not find the manager name parameter in the container. Tried the following parameter names: "%s"',
223-
implode('", "', $this->managerParameters)
224-
));
221+
throw new InvalidArgumentException(sprintf('Could not find the manager name parameter in the container. Tried the following parameter names: "%s"', implode('", "', $this->managerParameters)));
225222
}
226223

227224
/**

src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
<xsd:attribute name="key" type="xsd:string" use="required" />
223223
<xsd:attribute name="on-invalid" type="invalid_sequence" />
224224
<xsd:attribute name="method" type="xsd:string" />
225+
<xsd:attribute name="tag" type="xsd:string" />
225226
</xsd:complexType>
226227

227228
<xsd:complexType name="argument" mixed="true">

src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass;
2020
use Symfony\Component\DependencyInjection\ContainerBuilder;
2121
use Symfony\Component\DependencyInjection\Definition;
22-
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
2322
use Symfony\Component\DependencyInjection\Reference;
2423
use Symfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass;
2524
use Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy;

src/Symfony/Component/DependencyInjection/Tests/Fixtures/Bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Bar implements BarInterface
1515
{
1616
public $quz;
1717

18-
public function __construct($quz = null, \NonExistent $nonExistent = null, BarInterface $decorated = null, array $foo = [])
18+
public function __construct($quz = null, \NonExistent $nonExistent = null, BarInterface $decorated = null, array $foo = [], iterable $baz = [])
1919
{
2020
$this->quz = $quz;
2121
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services_bindings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<bind key="$foo" type="collection">
1313
<bind>null</bind>
1414
</bind>
15+
<bind key="iterable $baz" type="tagged_iterator" tag="bar"/>
1516
</service>
1617

1718
<service id="Symfony\Component\DependencyInjection\Tests\Fixtures\Bar">

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_bindings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
bind:
1313
Symfony\Component\DependencyInjection\Tests\Fixtures\BarInterface: '@Symfony\Component\DependencyInjection\Tests\Fixtures\Bar'
1414
$foo: [ ~ ]
15+
iterable $baz: !tagged_iterator bar
1516

1617
Symfony\Component\DependencyInjection\Tests\Fixtures\Bar:
1718
factory: [ ~, 'create' ]

src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,12 +879,14 @@ public function testBindings()
879879
'$foo' => [null],
880880
'$quz' => 'quz',
881881
'$factory' => 'factory',
882+
'iterable $baz' => new TaggedIteratorArgument('bar'),
882883
], array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings()));
883884
$this->assertEquals([
884885
'quz',
885886
null,
886887
new Reference(Bar::class),
887888
[null],
889+
new TaggedIteratorArgument('bar'),
888890
], $definition->getArguments());
889891

890892
$definition = $container->getDefinition(Bar::class);

src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,12 +769,14 @@ public function testBindings()
769769
'$foo' => [null],
770770
'$quz' => 'quz',
771771
'$factory' => 'factory',
772+
'iterable $baz' => new TaggedIteratorArgument('bar'),
772773
], array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings()));
773774
$this->assertEquals([
774775
'quz',
775776
null,
776777
new Reference(Bar::class),
777778
[null],
779+
new TaggedIteratorArgument('bar'),
778780
], $definition->getArguments());
779781

780782
$definition = $container->getDefinition(Bar::class);

src/Symfony/Component/ErrorHandler/Tests/ErrorRenderer/HtmlErrorRendererTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
16-
use Symfony\Component\ErrorHandler\Exception\FlattenException;
1716

1817
class HtmlErrorRendererTest extends TestCase
1918
{

src/Symfony/Component/ErrorHandler/Tests/ErrorRenderer/SerializerErrorRendererTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer;
16-
use Symfony\Component\ErrorHandler\Exception\FlattenException;
1716
use Symfony\Component\Serializer\Encoder\JsonEncoder;
1817
use Symfony\Component\Serializer\Normalizer\ProblemNormalizer;
1918
use Symfony\Component\Serializer\Serializer;

src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PHPUnit\Framework\MockObject\MockObject;
1515
use PHPUnit\Framework\TestCase;
16-
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
1716
use Symfony\Component\Form\Form;
1817
use Symfony\Component\Form\FormConfigInterface;
1918
use Symfony\Component\Form\FormTypeExtensionInterface;

src/Symfony/Component/HttpKernel/EventListener/LocaleAwareListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\HttpKernel\EventListener;
1313

1414
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
15-
use Symfony\Component\HttpFoundation\Request;
1615
use Symfony\Component\HttpFoundation\RequestStack;
1716
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
1817
use Symfony\Component\HttpKernel\Event\RequestEvent;

src/Symfony/Component/HttpKernel/Tests/Controller/ErrorControllerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
16-
use Symfony\Component\ErrorHandler\Exception\FlattenException;
1716
use Symfony\Component\HttpFoundation\Request;
1817
use Symfony\Component\HttpFoundation\Response;
1918
use Symfony\Component\HttpKernel\Controller\ErrorController;

src/Symfony/Component/Ldap/Ldap.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ public function escape(string $subject, string $ignore = '', int $flags = 0): st
7575
public static function create(string $adapter, array $config = []): self
7676
{
7777
if (!isset(self::$adapterMap[$adapter])) {
78-
throw new DriverNotFoundException(sprintf(
79-
'Adapter 1241 "%s" not found. You should use one of: %s',
80-
$adapter,
81-
implode(', ', self::$adapterMap)
82-
));
78+
throw new DriverNotFoundException(sprintf('Adapter "%s" not found. You should use one of: %s', $adapter, implode(', ', self::$adapterMap)));
8379
}
8480

8581
$class = self::$adapterMap[$adapter];

src/Symfony/Component/Mailer/Transport/AbstractTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
use Psr\Log\LoggerInterface;
1515
use Psr\Log\NullLogger;
16-
use Symfony\Component\Mailer\Envelope;
1716
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
17+
use Symfony\Component\Mailer\Envelope;
1818
use Symfony\Component\Mailer\Event\MessageEvent;
1919
use Symfony\Component\Mailer\SentMessage;
2020
use Symfony\Component\Mime\Address;

src/Symfony/Component/Routing/Matcher/UrlMatcher.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ public function match(string $pathinfo)
9393
throw new NoConfigurationException();
9494
}
9595

96-
throw 0 < \count($this->allow)
97-
? new MethodNotAllowedException(array_unique($this->allow))
98-
: new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
96+
throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
9997
}
10098

10199
/**

src/Symfony/Component/Security/Http/Tests/Firewall/ContextListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function testOnKernelResponseListenerRemovesItself()
222222
->willReturn(true);
223223
$request->expects($this->any())
224224
->method('getSession')
225-
->will($this->returnValue($session));
225+
->willReturn($session);
226226

227227
$event = new ResponseEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MASTER_REQUEST, new Response());
228228

src/Symfony/Component/VarExporter/Internal/Exporter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@ public static function export($value, string $indent = '')
222222
));
223223

224224
if ("'" === $m[2]) {
225-
return substr($m[1], 0, -2);
225+
return substr($m[1], 0, -2);
226226
}
227227

228228
if ('n".\'' === substr($m[1], -4)) {
229-
return substr_replace($m[1], "\n".$subIndent.".'".$m[2], -2);
229+
return substr_replace($m[1], "\n".$subIndent.".'".$m[2], -2);
230230
}
231231

232-
return $m[1].$m[2];
232+
return $m[1].$m[2];
233233
}, $code, -1, $count);
234234

235235
if ($count && 0 === strpos($code, "''.")) {

0 commit comments

Comments
 (0)
0