Skip to content

Commit 176e622

Browse files
committed
Use import instead of FQCN
1 parent 2fd8fe8 commit 176e622

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Tests/Compiler/ValidateEnvPlaceholdersPassTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\DependencyInjection\Compiler\RegisterEnvVarProcessorsPass;
2121
use Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass;
2222
use Symfony\Component\DependencyInjection\ContainerBuilder;
23+
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
2324
use Symfony\Component\DependencyInjection\Extension\Extension;
2425

2526
class ValidateEnvPlaceholdersPassTest extends TestCase
@@ -59,7 +60,7 @@ public function testDefaultEnvIsValidatedInConfig()
5960

6061
public function testDefaultEnvWithoutPrefixIsValidatedInConfig()
6162
{
62-
$this->expectException(\Symfony\Component\DependencyInjection\Exception\RuntimeException::class);
63+
$this->expectException(RuntimeException::class);
6364
$this->expectExceptionMessage('The default value of an env() parameter must be a string or null, but "float" given to "env(FLOATISH)".');
6465

6566
$container = new ContainerBuilder();
@@ -219,7 +220,7 @@ public function testEmptyEnvWhichCannotBeEmptyForScalarNode()
219220

220221
public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation()
221222
{
222-
$this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class);
223+
$this->expectException(InvalidConfigurationException::class);
223224
$this->expectExceptionMessage('The path "env_extension.scalar_node_not_empty_validated" cannot contain an environment variable when empty values are not allowed by definition and are validated.');
224225

225226
$container = new ContainerBuilder();

Tests/Extension/ExtensionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
17+
use Symfony\Component\DependencyInjection\Exception\LogicException;
1718
use Symfony\Component\DependencyInjection\Extension\Extension;
1819
use Symfony\Component\DependencyInjection\Tests\Fixtures\Extension\InvalidConfig\InvalidConfigExtension;
1920
use Symfony\Component\DependencyInjection\Tests\Fixtures\Extension\SemiValidConfig\SemiValidConfigExtension;
@@ -71,7 +72,7 @@ public function testSemiValidConfiguration()
7172

7273
public function testInvalidConfiguration()
7374
{
74-
$this->expectException(\Symfony\Component\DependencyInjection\Exception\LogicException::class);
75+
$this->expectException(LogicException::class);
7576
$this->expectExceptionMessage('The extension configuration class "Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\Extension\\InvalidConfig\\Configuration" must implement "Symfony\\Component\\Config\\Definition\\ConfigurationInterface".');
7677

7778
$extension = new InvalidConfigExtension();

Tests/ParameterBag/EnvPlaceholderParameterBagTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function testMergeWithDifferentIdentifiersForPlaceholders()
113113

114114
public function testResolveEnvRequiresStrings()
115115
{
116-
$this->expectException(\Symfony\Component\DependencyInjection\Exception\RuntimeException::class);
116+
$this->expectException(RuntimeException::class);
117117
$this->expectExceptionMessage('The default value of env parameter "INT_VAR" must be a string or null, "int" given.');
118118

119119
$bag = new EnvPlaceholderParameterBag();
@@ -124,7 +124,7 @@ public function testResolveEnvRequiresStrings()
124124

125125
public function testGetDefaultScalarEnv()
126126
{
127-
$this->expectException(\Symfony\Component\DependencyInjection\Exception\RuntimeException::class);
127+
$this->expectException(RuntimeException::class);
128128
$this->expectExceptionMessage('The default value of an env() parameter must be a string or null, but "int" given to "env(INT_VAR)".');
129129

130130
$bag = new EnvPlaceholderParameterBag();

0 commit comments

Comments
 (0)