8000 cs · symfony/symfony@07d6d40 · GitHub
[go: up one dir, main page]

Skip to content

Commit 07d6d40

Browse files
committed
cs
1 parent 9d40c78 commit 07d6d40

15 files changed

+97
-9
lines changed

src/Symfony/Component/Dsn/Configuration/Dsn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getParameters(): array
4949

5050
public function getParameter(string $key, $default = null)
5151
{
52-
return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;
52+
return \array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;
5353
}
5454

5555
public function getHost(): ?string

src/Symfony/Component/Dsn/Configuration/DsnFunction.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn\Configuration;
@@ -56,7 +65,7 @@ public function getParameters(): array
5665

5766
public function getParameter(string $key, $default = null)
5867
{
59-
return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;
68+
return \array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;
6069
}
6170

6271
/**

src/Symfony/Component/Dsn/Configuration/Path.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn\Configuration;

src/Symfony/Component/Dsn/Configuration/Url.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn\Configuration;

src/Symfony/Component/Dsn/Configuration/UserPasswordTrait.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn\Configuration;

src/Symfony/Component/Dsn/DsnParser.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn;
@@ -40,7 +49,7 @@ public static function parse(string $dsn): DsnFunction
4049
}
4150

4251
if (empty($arguments)) {
43-
throw new SyntaxException($dsn, $functionName === 'dsn' ? 'The DSN is empty' : 'A function must have arguments, an empty string was provided.');
52+
throw new SyntaxException($dsn, 'dsn' === $functionName ? 'The DSN is empty' : 'A function must have arguments, an empty string was provided.');
4453
}
4554

4655
// explode arguments and respect function parentheses

src/Symfony/Component/Dsn/Exception/DsnTypeNotSupported.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
<?php
22

3-
declare(strict_types=1);
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
411

12+
declare(strict_types=1);
513

614
namespace Symfony\Component\Dsn\Exception;
715

src/Symfony/Component/Dsn/Exception/FunctionNotSupportedException.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn\Exception;

src/Symfony/Component/Dsn/Exception/FunctionsNotAllowedException.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn\Exception;

src/Symfony/Component/Dsn/Exception/InvalidDsnException.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn\Exception;

src/Symfony/Component/Dsn/Exception/SyntaxException.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
namespace Symfony\Component\Dsn\Exception;

src/Symfony/Component/Dsn/Tests/DsnParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testParse(string $dsn, $expected)
112112
public function testParseSimple()
113113
{
114114
$result = DsnParser::parseSimple('amqp://user:pass@localhost:5672/%2f/messages');
115-
$this->assertEquals(new Url('amqp', 'localhost', 5672, '/%2f/messages', [], ['username'=>'user', 'password'=>'pass']), $result);
115+
$this->assertEquals(new Url('amqp', 'localhost', 5672, '/%2f/messages', [], ['username' => 'user', 'password' => 'pass']), $result);
116116

117117
$result = DsnParser::parseSimple('dsn(amqp://localhost)');
118118
$this->assertEquals(new Url('amqp', 'localhost'), $result);

src/Symfony/Component/Mailer/Transport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory;
2121
use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory;
2222
use Symfony\Component\Mailer\Bridge\Sendgrid\Transport\SendgridTransportFactory;
23-
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
2423
use Symfony\Component\Mailer\Exception\UnsupportedSchemeException;
2524
use Symfony\Component\Mailer\Transport\Dsn as MailerDsn;
2625
use Symfony\Component\Mailer\Transport\FailoverTransport;
@@ -95,6 +94,7 @@ public function fromString(string $dsn): TransportInterface
9594
if ('dsn' !== $dsnFunction->getName()) {
9695
throw new FunctionNotSupportedException($dsn, $dsnFunction->getName());
9796
}
97+
9898
return $this->fromDsnObject(MailerDsn::fromUrlDsn($dsnFunction->first()));
9999
}
100100

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(string $scheme, string $host, ?string $user = null,
3535
$this->password = $password;
3636
$this->port = $port;
3737
$this->options = $options;
38-
parent::__construct($scheme, $host, $port, null, $options, ['username'=>$user, 'password'=>$password]);
38+
parent::__construct($scheme, $host, $port, null, $options, ['username' => $user, 'password' => $password]);
3939
}
4040

4141
public static function fromString(string $dsn): self

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Messenger\Bridge\Redis\Transport;
1313

1414
use Symfony\Component\Dsn\Configuration\Path;
15-
use Symfony\Component\Dsn\Configuration\Url;
1615
use Symfony\Component\Dsn\DsnParser;
1716
use Symfony\Component\Messenger\Exception\InvalidArgumentException;
1817
use Symfony\Component\Messenger\Exception\LogicException;
@@ -94,7 +93,7 @@ public function __construct(array $configuration, array $connectionCredentials =
9493
public static function fromDsn(string $dsnString, array $redisOptions = [], \Redis $redis = null): self
9594
{
9695
$dsn = DsnParser::parseSimple($dsnString);
97-
if (!empty($dsn->getParameters())) {
96+
if (!empty($dsn->getParameters())) {
9897
$redisOptions = $dsn->getParameters();
9998
}
10099
self::validateOptions($redisOptions);

0 commit comments

Comments
 (0)
0