Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6f332ce

Browse filesBrowse files
committed
minor symfony#33504 SCA: minor code tweaks (kalessil)
This PR was squashed before being merged into the 3.4 branch (closes symfony#33504). Discussion ---------- SCA: minor code tweaks | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Minor code tweaks: disabled sorting in glob (the order is not important there), used implode() negative index support in order to drop an array_pop() call. Commits ------- 32ea449 SCA: minor code tweaks
2 parents 47a8784 + 32ea449 commit 6f332ce
Copy full SHA for 6f332ce

File tree

Expand file treeCollapse file tree

4 files changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+6
-7
lines changed

‎src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container)
260260
$configPath = $this->getMappingResourceConfigDirectory();
261261
$extension = $this->getMappingResourceExtension();
262262

263-
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml')) {
263+
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml', GLOB_NOSORT)) {
264264
$driver = 'xml';
265-
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.yml')) {
265+
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.yml', GLOB_NOSORT)) {
266266
$driver = 'yml';
267-
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.php')) {
267+
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.php', GLOB_NOSORT)) {
268268
$driver = 'php';
269269
} else {
270270
// add the closest existing directory as a resource

‎src/Symfony/Component/Console/Application.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Application.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,7 @@ private function getAbbreviationSuggestions($abbrevs)
10981098
*/
10991099
public function extractNamespace($name, $limit = null)
11001100
{
1101-
$parts = explode(':', $name);
1102-
array_pop($parts);
1101+
$parts = explode(':', $name, -1);
11031102

11041103
return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
11051104
}

‎src/Symfony/Component/HttpKernel/Kernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Kernel.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ protected function initializeContainer()
673673
static $legacyContainers = [];
674674
$oldContainerDir = \dirname($oldContainer->getFileName());
675675
$legacyContainers[$oldContainerDir.'.legacy'] = true;
676-
foreach (glob(\dirname($oldContainerDir).\DIRECTORY_SEPARATOR.'*.legacy') as $legacyContainer) {
676+
foreach (glob(\dirname($oldContainerDir).\DIRECTORY_SEPARATOR.'*.legacy', GLOB_NOSORT) as $legacyContainer) {
677677
if (!isset($legacyContainers[$legacyContainer]) && @unlink($legacyContainer)) {
678678
(new Filesystem())->remove(substr($legacyContainer, 0, -7));
679679
}

‎src/Symfony/Component/Intl/Data/Util/LocaleScanner.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Intl/Data/Util/LocaleScanner.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class LocaleScanner
4242
*/
4343
public function scanLocales($sourceDir)
4444
{
45-
$locales = glob($sourceDir.'/*.txt');
45+
$locales = glob($sourceDir.'/*.txt', GLOB_NOSORT);
4646

4747
// Remove file extension and sort
4848
array_walk($locales, function (&$locale) { $locale = basename($locale, '.txt'); });

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.