Skip to content

Commit 6c03885

Browse files
committed
Use ::class keyword when possible
1 parent 75935aa commit 6c03885

File tree

7 files changed

+62
-62
lines changed

7 files changed

+62
-62
lines changed

Tests/ChildDefinitionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testSetArgument()
9191

9292
public function testReplaceArgumentShouldRequireIntegerIndex()
9393
{
94-
$this->expectException('InvalidArgumentException');
94+
$this->expectException(\InvalidArgumentException::class);
9595
$def = new ChildDefinition('foo');
9696

9797
$def->replaceArgument('0', 'foo');
@@ -118,7 +118,7 @@ public function testReplaceArgument()
118118

119119
public function testGetArgumentShouldCheckBounds()
120120
{
121-
$this->expectException('OutOfBoundsException');
121+
$this->expectException(\OutOfBoundsException::class);
122122
$def = new ChildDefinition('foo');
123123

124124
$def->setArguments([0 => 'foo']);

Tests/Compiler/ValidateEnvPlaceholdersPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testDefaultEnvIsValidatedInConfig()
5757

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

6363
$container = new ContainerBuilder();
@@ -217,7 +217,7 @@ public function testEmptyEnvWhichCannotBeEmptyForScalarNode()
217217

218218
public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation()
219219
{
220-
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
220+
$this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class);
221221
$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.');
222222

223223
$container = new ContainerBuilder();

Tests/Extension/ExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testSemiValidConfiguration()
7070

7171
public function testInvalidConfiguration()
7272
{
73-
$this->expectException('Symfony\Component\DependencyInjection\Exception\LogicException');
73+
$this->expectException(\Symfony\Component\DependencyInjection\Exception\LogicException::class);
7474
$this->expectExceptionMessage('The extension configuration class "Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\Extension\\InvalidConfig\\Configuration" must implement "Symfony\\Component\\Config\\Definition\\ConfigurationInterface".');
7575

7676
$extension = new InvalidConfigExtension();

Tests/Loader/PhpFileLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testAutoConfigureAndChildDefinition()
9595

9696
public function testFactoryShortNotationNotAllowed()
9797
{
98-
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
98+
$this->expectException(\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException::class);
9999
$this->expectExceptionMessage('Invalid factory "factory:method": the "service:method" notation is not available when using PHP-based DI configuration. Use "[service(\'factory\'), \'method\']" instead.');
100100
$fixtures = realpath(__DIR__.'/../Fixtures');
101101
$container = new ContainerBuilder();

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 25 additions & 25 deletions
Large diffs are not rendered by default.

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 26 additions & 26 deletions
Large diffs are not rendered by default.

Tests/ParameterBag/EnvPlaceholderParameterBagTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class EnvPlaceholderParameterBagTest extends TestCase
1818
{
1919
public function testGetThrowsInvalidArgumentExceptionIfEnvNameContainsNonWordCharacters()
2020
{
21-
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
21+
$this->expectException(\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException::class);
2222
$bag = new EnvPlaceholderParameterBag();
2323
$bag->get('env(%foo%)');
2424
}
@@ -111,7 +111,7 @@ public function testMergeWithDifferentIdentifiersForPlaceholders()
111111

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

117117
$bag = new EnvPlaceholderParameterBag();
@@ -122,7 +122,7 @@ public function testResolveEnvRequiresStrings()
122122

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

128128
$bag = new EnvPlaceholderParameterBag();
@@ -153,7 +153,7 @@ public function testResolveEnvAllowsNull()
153153

154154
public function testResolveThrowsOnBadDefaultValue()
155155
{
156-
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
156+
$this->expectException(\Symfony\Component\DependencyInjection\Exception\RuntimeException::class);
157157
$this->expectExceptionMessage('The default value of env parameter "ARRAY_VAR" must be a string or null, "array" given.');
158158
$bag = new EnvPlaceholderParameterBag();
159159
$bag->get('env(ARRAY_VAR)');
@@ -173,7 +173,7 @@ public function testGetEnvAllowsNull()
173173

174174
public function testGetThrowsOnBadDefaultValue()
175175
{
176-
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
176+
$this->expectException(\Symfony\Component\DependencyInjection\Exception\RuntimeException::class);
177177
$this->expectExceptionMessage('The default value of an env() parameter must be a string or null, but "array" given to "env(ARRAY_VAR)".');
178178
$bag = new EnvPlaceholderParameterBag();
179179
$bag->set('env(ARRAY_VAR)', []);

0 commit comments

Comments
 (0)