From 5e4e7cb96361320a251638a338a3f5e10af46d25 Mon Sep 17 00:00:00 2001 From: Jerzy Zawadzki Date: Sat, 18 Nov 2017 12:28:55 +0200 Subject: [PATCH 1/2] Replace symfony/symfony with granulated requirements --- Resources/config/service.xml | 1 + Twig/Extension/StfalconTinymceExtension.php | 16 +++++++++++----- composer.json | 4 +++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Resources/config/service.xml b/Resources/config/service.xml index 1bf7cf5a..5ecbce11 100644 --- a/Resources/config/service.xml +++ b/Resources/config/service.xml @@ -12,6 +12,7 @@ + diff --git a/Twig/Extension/StfalconTinymceExtension.php b/Twig/Extension/StfalconTinymceExtension.php index 3f99ca1f..17d28ab7 100644 --- a/Twig/Extension/StfalconTinymceExtension.php +++ b/Twig/Extension/StfalconTinymceExtension.php @@ -2,6 +2,7 @@ namespace Stfalcon\Bundle\TinymceBundle\Twig\Extension; use Stfalcon\Bundle\TinymceBundle\Helper\LocaleHelper; +use Symfony\Component\Asset\Packages; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -25,14 +26,20 @@ class StfalconTinymceExtension extends \Twig_Extension */ protected $baseUrl; + /** + * @var Packages + */ + private $packages; + /** * Initialize tinymce helper * * @param ContainerInterface $container */ - public function __construct(ContainerInterface $container) + public function __construct(ContainerInterface $container, Packages $packages) { $this->container = $container; + $this->packages = $packages; } /** @@ -94,7 +101,7 @@ public function tinymceInit($options = array()) unset($config['asset_package_name']); /** @var $assets \Symfony\Component\Templating\Helper\CoreAssetsHelper */ - $assets = $this->getService('assets.packages'); + $assets = $this->packages; // Get path to tinymce script for the jQuery version of the editor if ($config['tinymce_jquery']) { @@ -180,7 +187,7 @@ public function tinymceInit($options = array()) json_encode($config) ); - return $this->getService('templating')->render('StfalconTinymceBundle:Script:init.html.twig', array( + return $this->getService('twig')->render('@StfalconTinymce/Script/init.html.twig', array( 'tinymce_config' => $tinymceConfiguration, 'include_jquery' => $config['include_jquery'], 'tinymce_jquery' => $config['tinymce_jquery'], @@ -208,8 +215,7 @@ public function getName() */ protected function getAssetsUrl($inputUrl) { - /** @var $assets \Symfony\Component\Templating\Helper\CoreAssetsHelper */ - $assets = $this->getService('assets.packages'); + $assets = $this->packages; $url = preg_replace('/^asset\[(.+)\]$/i', '$1', $inputUrl); diff --git a/composer.json b/composer.json index 8fcca1ab..b730e1ec 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,9 @@ }, "require": { "php": ">=5.4.0", - "symfony/symfony": ">=3.0" + "symfony/framework-bundle": ">=3.0", + "symfony/twig-bundle": ">=3.0", + "symfony/asset":">=3.0" }, "autoload": { "psr-0": { From 174420b52816b256519df2308933a99cd623c26d Mon Sep 17 00:00:00 2001 From: Jerzy Zawadzki Date: Wed, 20 Dec 2017 18:30:19 +0100 Subject: [PATCH 2/2] Changing symfony version to more strict approach --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b730e1ec..722f6c05 100644 --- a/composer.json +++ b/composer.json @@ -26,9 +26,9 @@ }, "require": { "php": ">=5.4.0", - "symfony/framework-bundle": ">=3.0", - "symfony/twig-bundle": ">=3.0", - "symfony/asset":">=3.0" + "symfony/framework-bundle": "^3.0|^4.0", + "symfony/twig-bundle": "^3.0|^4.0", + "symfony/asset":"^3.0|^4.0" }, "autoload": { "psr-0": {