From a5d58d6cb335c2516defae5124741588c2383747 Mon Sep 17 00:00:00 2001 From: Raymond Julin Date: Fri, 20 Sep 2013 09:20:42 +0200 Subject: [PATCH 1/2] Removed unused files --- .../Controller/DefaultController.php | 10 ---------- .../eZExceedBundle/Resources/config/routing.yml | 3 --- .../eZExceedBundle/Resources/doc/index.rst | 0 .../Tests/Controller/DefaultControllerTest.php | 17 ----------------- .../Twig/eZExceedTwigExtension.php | 1 - 5 files changed, 31 deletions(-) delete mode 100755 src/KTQ/Bundle/eZExceedBundle/Controller/DefaultController.php delete mode 100755 src/KTQ/Bundle/eZExceedBundle/Resources/config/routing.yml delete mode 100755 src/KTQ/Bundle/eZExceedBundle/Resources/doc/index.rst delete mode 100755 src/KTQ/Bundle/eZExceedBundle/Tests/Controller/DefaultControllerTest.php diff --git a/src/KTQ/Bundle/eZExceedBundle/Controller/DefaultController.php b/src/KTQ/Bundle/eZExceedBundle/Controller/DefaultController.php deleted file mode 100755 index 15cf015..0000000 --- a/src/KTQ/Bundle/eZExceedBundle/Controller/DefaultController.php +++ /dev/null @@ -1,10 +0,0 @@ -request('GET', '/hello/Fabien'); - - $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); - } -} diff --git a/src/KTQ/Bundle/eZExceedBundle/Twig/eZExceedTwigExtension.php b/src/KTQ/Bundle/eZExceedBundle/Twig/eZExceedTwigExtension.php index 8434f11..8ab6612 100755 --- a/src/KTQ/Bundle/eZExceedBundle/Twig/eZExceedTwigExtension.php +++ b/src/KTQ/Bundle/eZExceedBundle/Twig/eZExceedTwigExtension.php @@ -4,7 +4,6 @@ use Twig_Extension; use Twig_Function_Method; -//use Twig_Filter_Method; use Twig_Environment; use Twig_Template; use Symfony\Component\Templating\EngineInterface; From 43c6d8fa7498a0244a92e73e6853458af68b1cd5 Mon Sep 17 00:00:00 2001 From: Raymond Julin Date: Fri, 20 Sep 2013 09:28:25 +0200 Subject: [PATCH 2/2] Dont overflow existing items from one pencil to the next --- .../Bundle/eZExceedBundle/Model/Pencil.php | 4 ++-- .../Twig/eZExceedTwigExtension.php | 24 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/KTQ/Bundle/eZExceedBundle/Model/Pencil.php b/src/KTQ/Bundle/eZExceedBundle/Model/Pencil.php index d1ecd6f..e34c397 100755 --- a/src/KTQ/Bundle/eZExceedBundle/Model/Pencil.php +++ b/src/KTQ/Bundle/eZExceedBundle/Model/Pencil.php @@ -104,11 +104,11 @@ public function __construct( $serviceContainer, Repository $repository, PageServ public function fill($input) { + $this->entities = array(); if (is_array($input)) { foreach ($input as $key => $value) { // Arrays of blocks are not supported - if($value instanceof Block) - return false; + if ($value instanceof Block) { return false; } // Array contains Contents or Locations if (is_numeric($key)) { diff --git a/src/KTQ/Bundle/eZExceedBundle/Twig/eZExceedTwigExtension.php b/src/KTQ/Bundle/eZExceedBundle/Twig/eZExceedTwigExtension.php index 8ab6612..7ae52c3 100755 --- a/src/KTQ/Bundle/eZExceedBundle/Twig/eZExceedTwigExtension.php +++ b/src/KTQ/Bundle/eZExceedBundle/Twig/eZExceedTwigExtension.php @@ -20,19 +20,19 @@ class eZExceedTwigExtension extends Twig_Extension protected $templateEngine; protected $pencil; - public function __construct( - Repository $repository, - LegacyConfigResolver $legacyConfigResolver, - EngineInterface $templateEngine, - Pencil $pencil) + public function __construct(Repository $repository, LegacyConfigResolver $legacyConfigResolver, EngineInterface $templateEngine, Pencil $pencil) { $this->repository = $repository; $this->legacyConfigResolver = $legacyConfigResolver; $this->templateEngine = $templateEngine; - $this->pencil = $pencil; } + /** + * Get function names provided by extension + * + * @return array + */ public function getFunctions() { return array( @@ -41,6 +41,11 @@ public function getFunctions() ); } + /** + * Get name of twig extension + * + * @return string + */ public function getName() { return 'ktq_ezexceed'; @@ -99,11 +104,4 @@ public function getIniSetting( $name, $section, $file ) return $this->legacyConfigResolver->getParameter( $section . '.' . $name, $file ); } - - /* - public function translate( string $string, string $context ) - { - // return translated string - } - */ }