Skip to content

Commit d347660

Browse files
authored
Merge pull request #226 from symfony-cmf/analysis-wykpOE
Apply fixes from StyleCI
2 parents cc58210 + bfcc669 commit d347660

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

bootstrap/kernel_bootstrap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@
1818
$phpUnitFile = $rootDir.'/phpunit.xml.dist';
1919

2020
if (!file_exists($phpUnitFile)) {
21-
throw new \Exception(sprintf(
21+
throw new Exception(sprintf(
2222
'Cannot find phpunit.xml.dist file in "%s"',
2323
$phpUnitFile
2424
));
2525
}
2626

27-
$xml = new \SimpleXMLElement(file_get_contents($phpUnitFile));
27+
$xml = new SimpleXMLElement(file_get_contents($phpUnitFile));
2828

2929
$envClass = $xml->xpath("//php/env[@name='KERNEL_CLASS']");
3030
if (count($envClass)) {
3131
$kernelClass = (string) $envClass[0]['value'];
3232
} else {
3333
$envDir = $xml->xpath("//php/server[@name='KERNEL_DIR']");
3434
if (!count($envDir)) {
35-
throw new \Exception(
35+
throw new Exception(
3636
'KERNEL_CLASS must be set via <env name"KERNEL_CLASS" value="..."/>'
3737
);
3838
}
3939
$kernelClass = 'AppKernel';
4040
$kernelFile = $rootDir.'/'.$envDir[0]['value'].'/'.$kernelClass.'.php';
4141

4242
if (!file_exists($kernelFile)) {
43-
throw new \Exception(sprintf(
43+
throw new Exception(sprintf(
4444
'Cannot find kernel file "%s"',
4545
$kernelFile
4646
));

resources/config/dist/security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
],
4141
];
4242

43-
if (class_exists(\Symfony\Component\Security\Core\Security::class)) {
43+
if (class_exists(Symfony\Component\Security\Core\Security::class)) {
4444
// Symfony 6 but not 7
4545
$config['enable_authenticator_manager'] = true;
4646
}

src/Functional/BaseTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected function getDbManager(string $type): PhpcrDecorator|PHPCR|ORM
124124
return $this->dbManagers[$type];
125125
}
126126

127-
$className = sprintf(
127+
$className = \sprintf(
128128
'Symfony\Cmf\Component\Testing\Functional\DbManager\%s',
129129
$type
130130
);
@@ -134,7 +134,7 @@ protected function getDbManager(string $type): PhpcrDecorator|PHPCR|ORM
134134
}
135135

136136
if (!class_exists($className)) {
137-
throw new \InvalidArgumentException(sprintf(
137+
throw new \InvalidArgumentException(\sprintf(
138138
'Test DBManager "%s" does not exist.',
139139
$className
140140
));

src/Functional/DbManager/ORM.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function loadFixtures(array $classNames): void
7878
protected function loadFixtureClass(Loader $loader, string $className): void
7979
{
8080
if (!class_exists($className)) {
81-
throw new \InvalidArgumentException(sprintf(
81+
throw new \InvalidArgumentException(\sprintf(
8282
'Fixture class "%s" does not exist.',
8383
$className
8484
));

src/Functional/DbManager/PHPCR.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function loadFixtureClass(Loader $loader, $class): void
8181
$fixture = $class;
8282
} else {
8383
if (!class_exists($class)) {
84-
throw new \InvalidArgumentException(sprintf(
84+
throw new \InvalidArgumentException(\sprintf(
8585
'Fixture class "%s" does not exist.',
8686
$class
8787
));

src/HttpKernel/TestKernel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function requireBundleSets(array $names): void
107107
public function requireBundleSet(string $name): void
108108
{
109109
if (!isset($this->bundleSets[$name])) {
110-
throw new \InvalidArgumentException(sprintf(
110+
throw new \InvalidArgumentException(\sprintf(
111111
'Bundle set %s has not been registered, available bundle sets: %s',
112112
$name,
113113
implode(',', array_keys($this->bundleSets))
@@ -116,7 +116,7 @@ public function requireBundleSet(string $name): void
116116

117117
foreach ($this->bundleSets[$name] as $bundle) {
118118
if (!class_exists($bundle)) {
119-
throw new \InvalidArgumentException(sprintf(
119+
throw new \InvalidArgumentException(\sprintf(
120120
'Bundle class "%s" does not exist.',
121121
$bundle
122122
));
@@ -199,7 +199,7 @@ protected function registerConfiguredBundles(): void
199199
foreach ($bundles as $class => $environments) {
200200
if (isset($environments['all']) || isset($environments[$this->environment])) {
201201
if (!class_exists($class)) {
202-
throw new \InvalidArgumentException(sprintf(
202+
throw new \InvalidArgumentException(\sprintf(
203203
'Bundle class "%s" does not exist.',
204204
$class
205205
));

src/Unit/Constraint/SchemaAcceptsXml.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function matches($schemaFile): bool
3232
$configElement = $dom->getElementsByTagName('config');
3333

3434
if (1 !== $configElement->length) {
35-
throw new \InvalidArgumentException(sprintf('Can only test a file if it contains 1 <config> element, %d given', $configElement->length));
35+
throw new \InvalidArgumentException(\sprintf('Can only test a file if it contains 1 <config> element, %d given', $configElement->length));
3636
}
3737

3838
$configDom = new \DOMDocument();
@@ -61,7 +61,7 @@ public function toString(): string
6161

6262
protected function failureDescription($schemaFile): string
6363
{
64-
return sprintf(
64+
return \sprintf(
6565
'Xml is accepted by the XML schema "%s"',
6666
$schemaFile
6767
);

src/Unit/XmlSchemaTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private static function getSchemaAcceptsXmlConstraint($xmlDoms)
4646
}
4747

4848
if (!$dom instanceof \DOMDocument) {
49-
throw new \InvalidArgumentException(sprintf('The first argument of assertSchemaAcceptsXml should be instances of \DOMDocument, "%s" given', \get_class($dom)));
49+
throw new \InvalidArgumentException(\sprintf('The first argument of assertSchemaAcceptsXml should be instances of \DOMDocument, "%s" given', \get_class($dom)));
5050
}
5151

5252
return $dom;

tests/Functional/BaseTestCaseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function testDb(string $dbName, string|null $expected): void
113113
return;
114114
}
115115

116-
$className = sprintf(
116+
$className = \sprintf(
117117
'Symfony\Cmf\Component\Testing\Functional\DbManager\%s',
118118
$expected
119119
);

0 commit comments

Comments
 (0)