From 6e10a5cf0751d2f8e93d6eefc3b46bad655fae79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Fri, 21 Jan 2022 15:07:49 +0100 Subject: [PATCH] IBX-1431: Dropped support for PHPStorm configuration in favor of Ibexa DXP Plugin (#40) --- .../Compiler/PHPStormPass.php | 61 ------------------- bundle/DependencyInjection/Configuration.php | 6 +- bundle/EzPlatformDesignEngineBundle.php | 2 - 3 files changed, 5 insertions(+), 64 deletions(-) delete mode 100644 bundle/DependencyInjection/Compiler/PHPStormPass.php diff --git a/bundle/DependencyInjection/Compiler/PHPStormPass.php b/bundle/DependencyInjection/Compiler/PHPStormPass.php deleted file mode 100644 index 854da5d..0000000 --- a/bundle/DependencyInjection/Compiler/PHPStormPass.php +++ /dev/null @@ -1,61 +0,0 @@ -getParameter('ezdesign.phpstorm.enabled')) { - return; - } - - if (!$container->hasParameter('ezdesign.templates_path_map')) { - return; - } - - $pathConfig = []; - $twigConfigPath = realpath($container->getParameter('ezdesign.phpstorm.twig_config_path')); - foreach ($container->getParameter('ezdesign.templates_path_map') as $theme => $paths) { - foreach ($paths as $path) { - if ($theme !== '_override') { - $pathConfig[] = [ - 'namespace' => $theme, - 'path' => $this->makeTwigPathRelative($path, $twigConfigPath), - ]; - } - - $pathConfig[] = [ - 'namespace' => 'ezdesign', - 'path' => $this->makeTwigPathRelative($path, $twigConfigPath), - ]; - } - } - - (new Filesystem())->dumpFile( - $twigConfigPath . '/ide-twig.json', - json_encode(['namespaces' => $pathConfig], JSON_UNESCAPED_SLASHES) - ); - } - - /** - * Converts absolute $path to a path relative to ide-twig.json config file. - * - * @param string $path Absolute path - * @param string $configPath Absolute path where ide-twig.json is stored - * - * @return string - */ - private function makeTwigPathRelative($path, $configPath) - { - return trim(str_replace($configPath, '', $path), '/'); - } -} diff --git a/bundle/DependencyInjection/Configuration.php b/bundle/DependencyInjection/Configuration.php index a3f4989..23aa72b 100644 --- a/bundle/DependencyInjection/Configuration.php +++ b/bundle/DependencyInjection/Configuration.php @@ -45,8 +45,12 @@ public function getConfigTreeBuilder() ->end() ->arrayNode('phpstorm') ->addDefaultsIfNotSet() + ->setDeprecated('The "%node%" option is deprecated since Ibexa DXP v3.3.14 and will be removed in 4.0. Use PhpStorm plugin instead: https://doc.ibexa.co/en/latest/community_resources/phpstorm_plugin/') ->children() - ->booleanNode('enabled')->defaultValue('%kernel.debug%')->info('Activates PHPStorm support')->end() + ->booleanNode('enabled') + ->defaultValue(false) + ->info('Activates PHPStorm support') + ->end() ->scalarNode('twig_config_path') ->info('Path where to store PHPStorm configuration file for additional Twig namespaces (ide-twig.json).') ->defaultValue('%kernel.project_dir%') diff --git a/bundle/EzPlatformDesignEngineBundle.php b/bundle/EzPlatformDesignEngineBundle.php index dd8eaab..3f7ac80 100644 --- a/bundle/EzPlatformDesignEngineBundle.php +++ b/bundle/EzPlatformDesignEngineBundle.php @@ -8,7 +8,6 @@ use EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\AssetPathResolutionPass; use EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\AssetThemePass; -use EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\PHPStormPass; use EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\TwigThemePass; use EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\DesignConfigParser; use EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\EzPlatformDesignEngineExtension; @@ -30,7 +29,6 @@ public function build(ContainerBuilder $container) $container->addCompilerPass(new TwigThemePass()); $container->addCompilerPass(new AssetThemePass(), PassConfig::TYPE_OPTIMIZE); $container->addCompilerPass(new AssetPathResolutionPass(), PassConfig::TYPE_OPTIMIZE); - $container->addCompilerPass(new PHPStormPass(), PassConfig::TYPE_OPTIMIZE); } public function getContainerExtension()