Skip to content

Commit

Permalink
Lock Static Analysis deps
Browse files Browse the repository at this point in the history
Fix related issues
  • Loading branch information
simPod committed Mar 3, 2021
1 parent 11095f2 commit 31aeab2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"matthiasnoback/symfony-dependency-injection-test": "^4.2",
"mikey179/vfsstream": "^1.6",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.65",
"phpstan/phpstan": "0.12.80",
"phpstan/phpstan-phpunit": "0.12.17",
"phpstan/phpstan-strict-rules": "^0.12.7",
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.15.0",
"vimeo/psalm": "^4.3"
"psalm/plugin-phpunit": "0.15.1",
"vimeo/psalm": "4.6.2"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ final class Configuration implements ConfigurationInterface
private $alias;

/** @var string */
private $kernelRootDir;
private $kernelProjectDir;

/** @var string */
private $kernelLogsDir;

/** @var string */
private $kernelCacheDir;

public function __construct(string $alias, string $kernelRootDir, string $kernelLogsDir, string $kernelCacheDir)
public function __construct(string $alias, string $kernelProjectDir, string $kernelLogsDir, string $kernelCacheDir)
{
$this->alias = $alias;
$this->kernelRootDir = $kernelRootDir;
$this->kernelProjectDir = $kernelProjectDir;
$this->kernelLogsDir = $kernelLogsDir;
$this->kernelCacheDir = $kernelCacheDir;
}
Expand Down Expand Up @@ -108,7 +108,7 @@ public function getConfigTreeBuilder() : TreeBuilder
->prototype('scalar')
->end()
->defaultValue([
$this->kernelRootDir . '/bootstrap.php.cache',
$this->kernelProjectDir . '/bootstrap.php.cache',
$this->kernelCacheDir,
])
->end()
Expand Down
17 changes: 14 additions & 3 deletions src/DependencyInjection/TracyBlueScreenExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

use function assert;
use function dirname;
use function is_bool;
use function is_string;

//phpcs:disable SlevomatCodingStandard.Files.LineLength.LineTooLong
final class TracyBlueScreenExtension extends ConfigurableExtension implements PrependExtensionInterface
Expand Down Expand Up @@ -71,7 +73,9 @@ public function loadInternal(array $mergedConfig, ContainerBuilder $container) :
$loader->load('services.yml');

$environment = $container->getParameter('kernel.environment');
assert(is_string($environment));
$debug = $container->getParameter('kernel.debug');
assert(is_bool($debug));

if (
$this->isEnabled(
Expand Down Expand Up @@ -99,11 +103,18 @@ public function loadInternal(array $mergedConfig, ContainerBuilder $container) :
/** @param mixed[] $config */
public function getConfiguration(array $config, ContainerBuilder $container) : Configuration
{
$kernelProjectDir = $container->getParameter('kernel.project_dir');
$kernelLogsDir = $container->getParameter('kernel.logs_dir');
$kernelCacheDir = $container->getParameter('kernel.cache_dir');
assert(is_string($kernelProjectDir));
assert(is_string($kernelLogsDir));
assert(is_string($kernelCacheDir));

return new Configuration(
$this->getAlias(),
$container->getParameter('kernel.project_dir'),
$container->getParameter('kernel.logs_dir'),
$container->getParameter('kernel.cache_dir')
$kernelProjectDir,
$kernelLogsDir,
$kernelCacheDir
);
}

Expand Down
1 change: 1 addition & 0 deletions tests/DependencyInjection/TracyBlueScreenExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public function testCollapseCacheDirsByDefault() : void
$this->loadExtensions();

$this->assertContainerBuilderHasParameter('cdn77.tracy_blue_screen.blue_screen.collapse_paths');
/** @var list<string> $collapsePaths */
$collapsePaths = $this->container->getParameter('cdn77.tracy_blue_screen.blue_screen.collapse_paths');

$this->assertArrayContainsStringPart('/bootstrap.php.cache', $collapsePaths);
Expand Down

0 comments on commit 31aeab2

Please sign in to comment.