From b376b7fc87cab47255ff8ee154e8ad470b857d5f Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 27 Jan 2022 11:11:56 +0100 Subject: [PATCH] IBX-1431: Fixed incorrect merge of ezsystems/ezplatform-design-engine changes The support for phpstorm semantic configuration for Twig auto-completion helper has been dropped via https://github.com/ezsystems/ezplatform-design-engine/pull/40 however due to rebranding changes was not merged properly into the upstream In v4.0 that deprecated configuration is dropped along with its service container parameters --- .../Compiler/PHPStormPass.php | 63 ------------------- .../DependencyInjection/Configuration.php | 10 --- .../IbexaDesignEngineExtension.php | 4 -- src/bundle/IbexaDesignEngineBundle.php | 2 - src/bundle/Resources/config/services.yaml | 1 - 5 files changed, 80 deletions(-) delete mode 100644 src/bundle/DependencyInjection/Compiler/PHPStormPass.php diff --git a/src/bundle/DependencyInjection/Compiler/PHPStormPass.php b/src/bundle/DependencyInjection/Compiler/PHPStormPass.php deleted file mode 100644 index f54a9cc..0000000 --- a/src/bundle/DependencyInjection/Compiler/PHPStormPass.php +++ /dev/null @@ -1,63 +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), '/'); - } -} - -class_alias(PHPStormPass::class, 'EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\PHPStormPass'); diff --git a/src/bundle/DependencyInjection/Configuration.php b/src/bundle/DependencyInjection/Configuration.php index 6ee4caa..be9fbc3 100644 --- a/src/bundle/DependencyInjection/Configuration.php +++ b/src/bundle/DependencyInjection/Configuration.php @@ -43,16 +43,6 @@ public function getConfigTreeBuilder() ->info('If set to true, assets path won\'t be pre-resolved at compile time.') ->defaultValue('%kernel.debug%') ->end() - ->arrayNode('phpstorm') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('enabled')->defaultValue('%kernel.debug%')->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%') - ->end() - ->end() - ->end() ->end(); return $treeBuilder; diff --git a/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php b/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php index 4785cb9..fa2278b 100644 --- a/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php +++ b/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php @@ -47,10 +47,6 @@ private function configureDesigns(array $config, ConfigurationProcessor $process $container->setParameter('ezdesign.templates_override_paths', $config['templates_override_paths']); $container->setParameter('ezdesign.templates_path_map', $config['templates_theme_paths']); $container->setParameter('ezdesign.asset_resolution.disabled', $config['disable_assets_pre_resolution']); - - // PHPStorm settings - $container->setParameter('ezdesign.phpstorm.enabled', $config['phpstorm']['enabled']); - $container->setParameter('ezdesign.phpstorm.twig_config_path', $config['phpstorm']['twig_config_path']); } } diff --git a/src/bundle/IbexaDesignEngineBundle.php b/src/bundle/IbexaDesignEngineBundle.php index 77d8adc..dde81f2 100644 --- a/src/bundle/IbexaDesignEngineBundle.php +++ b/src/bundle/IbexaDesignEngineBundle.php @@ -8,7 +8,6 @@ use Ibexa\Bundle\DesignEngine\DependencyInjection\Compiler\AssetPathResolutionPass; use Ibexa\Bundle\DesignEngine\DependencyInjection\Compiler\AssetThemePass; -use Ibexa\Bundle\DesignEngine\DependencyInjection\Compiler\PHPStormPass; use Ibexa\Bundle\DesignEngine\DependencyInjection\Compiler\TwigThemePass; use Ibexa\Bundle\DesignEngine\DependencyInjection\DesignConfigParser; use Ibexa\Bundle\DesignEngine\DependencyInjection\IbexaDesignEngineExtension; @@ -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() diff --git a/src/bundle/Resources/config/services.yaml b/src/bundle/Resources/config/services.yaml index 1e7a955..cb2018e 100644 --- a/src/bundle/Resources/config/services.yaml +++ b/src/bundle/Resources/config/services.yaml @@ -7,7 +7,6 @@ parameters: ezdesign.assets_override_paths: [] ezdesign.asset_resolved_paths: {} ezdesign.asset_resolution.disabled: '%kernel.debug%' - ezdesign.phpstorm.enabled: true services: Ibexa\DesignEngine\Templating\ThemeTemplateNameResolver: