Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
defc51e
commit db4d492
Showing
15 changed files
with
168 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Analyser; | ||
|
||
use PHPStan\DependencyInjection\Container; | ||
use PHPStan\Reflection\ReflectionProvider; | ||
|
||
class ContainerConstantResolver extends ConstantResolver | ||
{ | ||
|
||
public function __construct( | ||
ReflectionProvider $reflectionProvider, | ||
private Container $container, | ||
) | ||
{ | ||
parent::__construct($reflectionProvider); | ||
} | ||
|
||
protected function getDynamicConstantNames(): array | ||
{ | ||
return $this->container->getParameter('dynamicConstantNames'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Analyser; | ||
|
||
use PHPStan\Reflection\ReflectionProvider; | ||
|
||
class DirectConstantResolver extends ConstantResolver | ||
{ | ||
|
||
/** | ||
* @param string[] $dynamicConstantNames | ||
*/ | ||
public function __construct( | ||
ReflectionProvider $reflectionProvider, | ||
private array $dynamicConstantNames, | ||
) | ||
{ | ||
parent::__construct($reflectionProvider); | ||
} | ||
|
||
protected function getDynamicConstantNames(): array | ||
{ | ||
return $this->dynamicConstantNames; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Analyser; | ||
|
||
class DirectConstantResolverProvider implements ConstantResolverProvider | ||
{ | ||
|
||
public function __construct(private ConstantResolver $constantResolver) | ||
{ | ||
} | ||
|
||
public function getConstantResolver(): ConstantResolver | ||
{ | ||
return $this->constantResolver; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Analyser; | ||
|
||
use PHPStan\DependencyInjection\Container; | ||
|
||
class LazyConstantResolverProvider implements ConstantResolverProvider | ||
{ | ||
|
||
public function __construct(private Container $container) | ||
{ | ||
} | ||
|
||
public function getConstantResolver(): ConstantResolver | ||
{ | ||
return $this->container->getByType(ConstantResolver::class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.