Skip to content

Commit

Permalink
support for Symfony 5
Browse files Browse the repository at this point in the history
  • Loading branch information
VasekPurchart committed Nov 26, 2024
2 parents 3174843 + c193e54 commit 65be056
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 20 deletions.
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
],
"require": {
"php": "^7.2",
"symfony/config": "^4.0",
"symfony/console": "^4.0",
"symfony/dependency-injection": "^4.0",
"symfony/error-handler": "^4.4.1",
"symfony/http-foundation": "^4.0",
"symfony/http-kernel": "^4.4",
"symfony/yaml": "^4.0",
"symfony/config": "^4.0|^5.0",
"symfony/console": "^4.0|^5.0",
"symfony/dependency-injection": "^4.0|^5.0",
"symfony/error-handler": "^4.4.1|^5.0.1",
"symfony/http-foundation": "^4.0|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/yaml": "^4.0|^5.0",
"tracy/tracy": "^2.4"
},
"require-dev": {
Expand All @@ -30,7 +30,7 @@
"php-parallel-lint/php-parallel-lint": "1.3.2",
"phing/phing": "2.17.2",
"phpunit/phpunit": "8.5.25",
"symfony/framework-bundle": "^4.4"
"symfony/framework-bundle": "^4.4|^5.0"
},
"autoload": {
"psr-4": {
Expand Down
Binary file modified docs/tracy-in-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/tracy-with-profiler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ tracy_blue_screen:
# Add paths which should be collapsed (for external/compiled code) so that actual error is expanded.
collapse_paths:
# Defaults:
- '%kernel.root_dir%/bootstrap.php.cache'
- '%kernel.project_dir%/bootstrap.php.cache'
- '%kernel.cache_dir%'
# plus paths set in BlueScreen instance used (/vendor)

Expand Down
12 changes: 6 additions & 6 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Configuration implements \Symfony\Component\Config\Definition\Configuratio
private $rootNode;

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

/** @var string */
private $kernelLogsDir;
Expand All @@ -38,21 +38,21 @@ class Configuration implements \Symfony\Component\Config\Definition\Configuratio

public function __construct(
string $rootNode,
string $kernelRootDir,
string $kernelProjectDir,
string $kernelLogsDir,
string $kernelCacheDir
)
{
$this->rootNode = $rootNode;
$this->kernelRootDir = $kernelRootDir;
$this->kernelProjectDir = $kernelProjectDir;
$this->kernelLogsDir = $kernelLogsDir;
$this->kernelCacheDir = $kernelCacheDir;
}

public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root($this->rootNode);
$treeBuilder = new TreeBuilder($this->rootNode);
$rootNode = $treeBuilder->getRootNode();

$rootNode->children()->append($this->createControllerNode(self::SECTION_CONTROLLER));
$rootNode->children()->append($this->createConsoleNode(self::SECTION_CONSOLE));
Expand Down Expand Up @@ -141,7 +141,7 @@ private function createBlueScreenCollapsePathsNode(string $nodeName): ArrayNodeD
$node->info('Add paths which should be collapsed (for external/compiled code) so that actual error is expanded.');
$node->prototype('scalar');
$node->defaultValue([
$this->kernelRootDir . '/bootstrap.php.cache',
$this->kernelProjectDir . '/bootstrap.php.cache',
$this->kernelCacheDir,
]);

Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/TracyBlueScreenExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getConfiguration(array $config, ContainerBuilder $container): Co
{
return new Configuration(
$this->getAlias(),
$container->getParameter('kernel.root_dir'),
$container->getParameter('kernel.project_dir'),
$container->getParameter('kernel.logs_dir'),
$container->getParameter('kernel.cache_dir')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public function testReplaceErrorRenderer(
bool $expectToBeReplaced
): void
{
$this->setParameter('kernel.root_dir', __DIR__);
$this->setParameter('kernel.project_dir', __DIR__);
$this->setParameter('kernel.logs_dir', __DIR__ . '/tests-logs-dir');
$this->setParameter('kernel.cache_dir', __DIR__ . '/tests-cache-dir');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ private function setKernelParameters(
bool $kernelDebugParameter
): void
{
$this->setParameter('kernel.root_dir', __DIR__);
$this->setParameter('kernel.project_dir', __DIR__);
$this->setParameter('kernel.logs_dir', __DIR__ . '/tests-logs-dir');
$this->setParameter('kernel.cache_dir', __DIR__ . '/tests-cache-dir');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ private function setKernelParameters(
bool $kernelDebugParameter
): void
{
$this->setParameter('kernel.root_dir', __DIR__);
$this->setParameter('kernel.project_dir', __DIR__);
$this->setParameter('kernel.logs_dir', __DIR__);
$this->setParameter('kernel.cache_dir', __DIR__ . '/tests-cache-dir');
Expand Down
1 change: 0 additions & 1 deletion tests/DependencyInjection/TracyBlueScreenExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public function testCollapsePathsConfiguration(

private function setKernelParameters(): void
{
$this->setParameter('kernel.root_dir', __DIR__);
$this->setParameter('kernel.project_dir', __DIR__);
$this->setParameter('kernel.logs_dir', __DIR__);
$this->setParameter('kernel.cache_dir', __DIR__ . '/tests-cache-dir');
Expand Down

0 comments on commit 65be056

Please sign in to comment.