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

Commit

Permalink
Merge 8b88a9f into c61489e
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Oct 14, 2018
2 parents c61489e + 8b88a9f commit 8d6836b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct(
Skipper $skipper,
DifferInterface $differ,
CurrentFileProvider $currentFileProvider,
array $fixers = []
array $fixers
) {
$this->errorAndDiffCollector = $errorAndDiffCollector;
$this->skipper = $skipper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function __construct(
DifferInterface $differ,
AppliedCheckersCollector $appliedCheckersCollector,
CurrentFileProvider $currentFileProvider,
array $sniffs = []
array $sniffs
) {
$this->fixer = $fixer;
$this->fileFactory = $fileFactory;
Expand Down
2 changes: 1 addition & 1 deletion packages/LatteToTwigConverter/src/LatteToTwigConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class LatteToTwigConverter
/**
* @param CaseConverterInterface[] $caseConverters
*/
public function __construct(array $caseConverters = [])
public function __construct(array $caseConverters)
{
$this->caseConverters = $caseConverters;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/MonorepoBuilder/src/DependenciesMerger.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
array $mergeSections,
JsonFileManager $jsonFileManager,
MergedPackagesCollector $mergedPackagesCollector,
array $composerJsonDecorators = []
array $composerJsonDecorators
) {
$this->mergeSections = $mergeSections;
$this->jsonFileManager = $jsonFileManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\HttpKernel\Kernel;
use Symplify\MonorepoBuilder\Split\DependencyInjection\CompilerPass\DetectParametersCompilerPass;
use Symplify\PackageBuilder\DependencyInjection\CompilerPass\AutoBindParametersCompilerPass;
use Symplify\PackageBuilder\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPass;
use Symplify\PackageBuilder\DependencyInjection\CompilerPass\ConfigurableCollectorCompilerPass;
use Symplify\PackageBuilder\DependencyInjection\CompilerPass\PublicForTestsCompilerPass;
use Symplify\PackageBuilder\HttpKernel\SimpleKernelTrait;
Expand Down Expand Up @@ -40,6 +41,7 @@ protected function build(ContainerBuilder $containerBuilder): void
$containerBuilder->addCompilerPass(new ConfigurableCollectorCompilerPass());
$containerBuilder->addCompilerPass(new DetectParametersCompilerPass());
$containerBuilder->addCompilerPass(new PublicForTestsCompilerPass());
$containerBuilder->addCompilerPass(new AutowireArrayParameterCompilerPass());
$containerBuilder->addCompilerPass(new AutoBindParametersCompilerPass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private function processParameters(
}

$parameterType = $this->resolveParameterType($parameterReflection->getName(), $reflectionMethod);
if ($parameterType === null || ctype_lower($parameterType[0])) {
if ($parameterType === null) {
continue;
}

Expand All @@ -69,15 +69,9 @@ private function processParameters(
}

$definitionsOfType = $this->definitionFinder->findAllByType($containerBuilder, $parameterType);
// no services of such type were found
if ($definitionsOfType === []) {
continue;
}

$definition->setArgument(
'$' . $parameterReflection->getName(),
$this->createReferencesFromDefinitions($definitionsOfType)
);
$argumentName = '$' . $parameterReflection->getName();
$definition->setArgument($argumentName, $this->createReferencesFromDefinitions($definitionsOfType));
}
}

Expand All @@ -91,6 +85,11 @@ private function resolveParameterType(string $parameterName, ReflectionMethod $r
return null;
}

// not a class|interface type
if (ctype_lower($result['type'][0])) {
return null;
}

return Reflection::expandClassName($result['type'], $reflectionMethod->getDeclaringClass());
}

Expand Down
2 changes: 1 addition & 1 deletion packages/Statie/packages/Latte/src/LatteFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class LatteFactory
/**
* @param FilterProviderInterface[] $filterProviders
*/
public function __construct(ILoader $loader, array $filterProviders = [])
public function __construct(ILoader $loader, array $filterProviders)
{
$this->loader = $loader;
$this->filterProviders = $filterProviders;
Expand Down
2 changes: 1 addition & 1 deletion packages/Statie/packages/Twig/src/TwigFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
ArrayLoader $arrayLoader,
string $twigCacheDirectory,
FilterExecutor $filterExecutor,
array $filterProviders = []
array $filterProviders
) {
$this->arrayLoader = $arrayLoader;
$this->twigCacheDirectory = $twigCacheDirectory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class RenderableFilesProcessor
/**
* @param FileDecoratorInterface[] $fileDecorators
*/
public function __construct(FileFactory $fileFactory, Configuration $configuration, array $fileDecorators = [])
public function __construct(FileFactory $fileFactory, Configuration $configuration, array $fileDecorators)
{
$this->fileFactory = $fileFactory;
$this->configuration = $configuration;
Expand Down

0 comments on commit 8d6836b

Please sign in to comment.