Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
fixup! Revert "fix psr12 set"
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 10, 2020
1 parent 1370a0f commit ae279ae
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 4 additions & 2 deletions packages/EasyCodingStandard/bin/ecs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ foreach ($configs as $config) {
}
}

$mainConfigShiftedAsLast[] = $inputConfig;

// @todo this has value on non-phar version, debug!
if ($inputConfig !== null) {
$mainConfigShiftedAsLast[] = $inputConfig;
}

$easyCodingStandardKernel = new EasyCodingStandardKernel($environment, InputDetector::isDebug());
if ($configs !== []) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# updated to PHP CS Fixer v2.11.0
# updated to PHP CS Fixer v2.11.0 from https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/src/RuleSet.php

services:
# PSR1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Symfony\Component\Config\Loader\GlobFileLoader;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\KernelInterface;
use Symplify\EasyCodingStandard\Yaml\FileLoader\CheckerTolerantYamlFileLoader;
Expand All @@ -19,7 +20,9 @@ public function createFromContainerBuilderAndKernel(
ContainerBuilder $containerBuilder,
KernelInterface $kernel
): DelegatingLoader {
return $this->createFromContainerBuilderAndFileLocator($containerBuilder, new FileLocator($kernel));
$kernelFileLocator = new FileLocator($kernel);

return $this->createFromContainerBuilderAndFileLocator($containerBuilder, $kernelFileLocator);
}

/**
Expand All @@ -29,7 +32,8 @@ public function createContainerBuilderAndConfig(
ContainerBuilder $containerBuilder,
string $config
): DelegatingLoader {
$fileLocator = new SimpleFileLocator(dirname($config));
$directory = dirname($config);
$fileLocator = new SimpleFileLocator($directory);

return $this->createFromContainerBuilderAndFileLocator($containerBuilder, $fileLocator);
}
Expand All @@ -41,6 +45,7 @@ private function createFromContainerBuilderAndFileLocator(
$loaderResolver = new LoaderResolver([
new GlobFileLoader($simpleFileLocator),
new CheckerTolerantYamlFileLoader($containerBuilder, $simpleFileLocator),
new DirectoryLoader($containerBuilder, $simpleFileLocator),
]);

return new DelegatingLoader($loaderResolver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ protected function build(ContainerBuilder $containerBuilder): void
*/
protected function getContainerLoader(ContainerInterface $container): DelegatingLoader
{
return (new DelegatingLoaderFactory())->createFromContainerBuilderAndKernel($container, $this);
$delegatingLoaderFactory = new DelegatingLoaderFactory();

return $delegatingLoaderFactory->createFromContainerBuilderAndKernel($container, $this);
}
}

0 comments on commit ae279ae

Please sign in to comment.