Skip to content
Permalink
Browse files

fixed bugs reported by PhpStan (#214)

  • Loading branch information...
janbarasek authored and dg committed Aug 5, 2019
1 parent e55f847 commit 44115730b5c02070dd7bf31b5d7d09a2f3d0fbe0
Showing with 7 additions and 3 deletions.
  1. +4 −0 src/DI/Compiler.php
  2. +1 −1 src/DI/Definitions/ServiceDefinition.php
  3. +2 −2 src/DI/Extensions/DIExtension.php
@@ -149,6 +149,7 @@ public function getConfig(): array
*/
public function setDynamicParameterNames(array $names)
{
assert($this->extensions[self::PARAMETERS] instanceof Extensions\ParametersExtension);
$this->extensions[self::PARAMETERS]->dynamicParams = $names;
return $this;
}
@@ -181,6 +182,7 @@ public function exportDependencies(): array
public function addExportedTag(string $tag)
{
if (isset($this->extensions[self::DI])) {
assert($this->extensions[self::DI] instanceof Extensions\DIExtension);
$this->extensions[self::DI]->exportedTags[$tag] = true;
}
return $this;
@@ -193,6 +195,7 @@ public function addExportedTag(string $tag)
public function addExportedType(string $type)
{
if (isset($this->extensions[self::DI])) {
assert($this->extensions[self::DI] instanceof Extensions\DIExtension);
$this->extensions[self::DI]->exportedTypes[$type] = true;
}
return $this;
@@ -299,6 +302,7 @@ public function generateCode(): string
public function loadDefinitionsFromConfig(array $configList): void
{
$extension = $this->extensions[self::SERVICES];
assert($extension instanceof Extensions\ServicesExtension);
$extension->loadDefinitions($this->processSchema($extension->getConfigSchema(), [$configList]));
}
@@ -80,7 +80,7 @@ public function getFactory(): Statement
/**
* @return string|array|Definition|null
* @return string|array|Definition|Reference|null
*/
public function getEntity()
{
@@ -17,10 +17,10 @@
*/
final class DIExtension extends Nette\DI\CompilerExtension
{
/** @var string[] */
/** @var array */
public $exportedTags = [];
/** @var string[] */
/** @var array */
public $exportedTypes = [];
/** @var bool */

0 comments on commit 4411573

Please sign in to comment.
You can’t perform that action at this time.