Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.10.x' into 1.11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 6, 2024
2 parents 51ba944 + a7ff362 commit 6320e1d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"hoa/regex": "1.17.01.13",
"jetbrains/phpstorm-stubs": "dev-master#8ea3bf44722f76a3a32c89fe769b6144c253f8a6",
"nette/bootstrap": "^3.0",
"nette/di": "^3.1.4",
"nette/di": "3.1.10",
"nette/finder": "^2.5",
"nette/neon": "^3.3.1",
"nette/schema": "^1.2.2",
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/DependencyInjection/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ public function create(
$configurator->setAllConfigFiles($allConfigFiles);

$container = $configurator->createContainer()->getByType(Container::class);

// initialize parameters that contain dynamic parameters
$container->getParameter('sysGetTempDir');
$container->getParameter('pro');
$container->getParameter('fixerTmpDir');

$this->validateParameters($container->getParameters(), $projectConfig['parametersSchema']);
self::postInitializeContainer($container);

Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/NeonAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class NeonAdapter implements Adapter
{

public const CACHE_KEY = 'v23-pro-tmp-dir';
public const CACHE_KEY = 'v24-update-nette-di';

private const PREVENT_MERGING_SUFFIX = '!';

Expand Down
6 changes: 6 additions & 0 deletions src/DependencyInjection/Nette/NetteContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace PHPStan\DependencyInjection\Nette;

use Nette\InvalidStateException;
use PHPStan\DependencyInjection\Container;
use PHPStan\DependencyInjection\ParameterNotFoundException;
use function array_key_exists;
Expand Down Expand Up @@ -78,6 +79,11 @@ public function hasParameter(string $parameterName): bool
public function getParameter(string $parameterName)
{
if (!$this->hasParameter($parameterName)) {
try {
return $this->container->getParameter($parameterName);
} catch (InvalidStateException) {
// pass
}
throw new ParameterNotFoundException($parameterName);
}

Expand Down

0 comments on commit 6320e1d

Please sign in to comment.