From 7287652be975a434c260dd4f05ed5dadb8f348f1 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 5 Mar 2015 19:59:03 +0100 Subject: [PATCH] psr --- .../Command/GenerateCrudCommand.php | 1 - .../Controller/BaseAdminController.php | 2 +- .../DependencyInjection/Configuration.php | 4 +- .../Controller/DefaultController.php | 1 - .../Block/BlockManager.php | 5 --- .../Controller/NavigationAdminController.php | 1 - .../Form/Type/MenuType.php | 4 +- .../ContentManagerBundle/Model/Node.php | 2 +- .../Routing/NodeLoader.php | 2 +- .../Twig/Extension/BlockExtension.php | 16 +++----- .../TemplateCrudConfiguration.php | 1 - .../Form/Extension/Type/PersoType.php | 38 +++++++++---------- .../UserBundle/Storage/SessionStorage.php | 15 +++----- src/Trinity/Component/Utils/Image.php | 4 +- 14 files changed, 40 insertions(+), 56 deletions(-) diff --git a/src/Trinity/Bundle/AdminBundle/Command/GenerateCrudCommand.php b/src/Trinity/Bundle/AdminBundle/Command/GenerateCrudCommand.php index fe613a4..aef9ba3 100644 --- a/src/Trinity/Bundle/AdminBundle/Command/GenerateCrudCommand.php +++ b/src/Trinity/Bundle/AdminBundle/Command/GenerateCrudCommand.php @@ -220,7 +220,6 @@ class ".$classNameConfiguration." extends \\Trinity\\Bundle\\AdminBundle\\Config ->setEditTitle('Edition of \"%id%\"') // Listing: - // ->setFieldTemplate('visible', 'TrinityAdminBundle:BaseAdmin:bool.html.twig') // ->setDisplayFields(array( // diff --git a/src/Trinity/Bundle/AdminBundle/Controller/BaseAdminController.php b/src/Trinity/Bundle/AdminBundle/Controller/BaseAdminController.php index 12b5edc..4bca0dc 100644 --- a/src/Trinity/Bundle/AdminBundle/Controller/BaseAdminController.php +++ b/src/Trinity/Bundle/AdminBundle/Controller/BaseAdminController.php @@ -400,7 +400,7 @@ class BaseAdminController extends Controller return 1; //} - return 0; + //return 0; } protected function batchAction(Request $request) diff --git a/src/Trinity/Bundle/AdminBundle/DependencyInjection/Configuration.php b/src/Trinity/Bundle/AdminBundle/DependencyInjection/Configuration.php index 1f8f2dd..8568501 100644 --- a/src/Trinity/Bundle/AdminBundle/DependencyInjection/Configuration.php +++ b/src/Trinity/Bundle/AdminBundle/DependencyInjection/Configuration.php @@ -18,9 +18,9 @@ class Configuration implements ConfigurationInterface public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); - // $treeBuilder->root('trinity_admin'); + /* $treeBuilder->root('trinity_admin'); - /*$rootNode + $rootNode ->children() ->arrayNode('i18n') ->info('I18n configuration') diff --git a/src/Trinity/Bundle/AdminMenuBundle/Controller/DefaultController.php b/src/Trinity/Bundle/AdminMenuBundle/Controller/DefaultController.php index 442b064..0f7a500 100644 --- a/src/Trinity/Bundle/AdminMenuBundle/Controller/DefaultController.php +++ b/src/Trinity/Bundle/AdminMenuBundle/Controller/DefaultController.php @@ -6,7 +6,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Trinity\Bundle\AdminMenuBundle\Menu\MenuFactory; use Trinity\Bundle\AdminMenuBundle\Menu\ListRenderer; -#use Knp\Menu\Renderer\ListRenderer; use Trinity\Bundle\AdminMenuBundle\Menu\ConfigurationTransformer; use Trinity\Bundle\ContentManagerBundle\Model\NavQuery; use Knp\Menu\Matcher\Matcher; diff --git a/src/Trinity/Bundle/ContentManagerBundle/Block/BlockManager.php b/src/Trinity/Bundle/ContentManagerBundle/Block/BlockManager.php index 70e55c3..9441d15 100644 --- a/src/Trinity/Bundle/ContentManagerBundle/Block/BlockManager.php +++ b/src/Trinity/Bundle/ContentManagerBundle/Block/BlockManager.php @@ -34,11 +34,6 @@ class BlockManager continue; } - //TODO: voir si il faut faire une interface pour les blocs éditoriaux - /*if ($block->getValue() == NULL) { - continue; - }*/ - if ($block) { return $block; } diff --git a/src/Trinity/Bundle/ContentManagerBundle/Controller/NavigationAdminController.php b/src/Trinity/Bundle/ContentManagerBundle/Controller/NavigationAdminController.php index e08e330..a4c3965 100644 --- a/src/Trinity/Bundle/ContentManagerBundle/Controller/NavigationAdminController.php +++ b/src/Trinity/Bundle/ContentManagerBundle/Controller/NavigationAdminController.php @@ -138,7 +138,6 @@ class NavigationAdminController extends BaseAdminController // foreach ($node->getPage()->getBlocks() as $block) { // $blockCopy = $block->copy(true); - // $blockCopy // ->setPageId($pageCopy->getId()) // ->save(); diff --git a/src/Trinity/Bundle/ContentManagerBundle/Form/Type/MenuType.php b/src/Trinity/Bundle/ContentManagerBundle/Form/Type/MenuType.php index f5ec335..80a1100 100644 --- a/src/Trinity/Bundle/ContentManagerBundle/Form/Type/MenuType.php +++ b/src/Trinity/Bundle/ContentManagerBundle/Form/Type/MenuType.php @@ -27,8 +27,8 @@ class MenuType extends AbstractType 'class' => 'Trinity\Bundle\ContentManagerBundle\Model\Nav', ) ); - // $builder->add('updatedAt'); - // $builder->add('createdAt'); + // $builder->add('updatedAt'); + // $builder->add('createdAt'); } /** diff --git a/src/Trinity/Bundle/ContentManagerBundle/Model/Node.php b/src/Trinity/Bundle/ContentManagerBundle/Model/Node.php index fe93ea2..89a16ef 100644 --- a/src/Trinity/Bundle/ContentManagerBundle/Model/Node.php +++ b/src/Trinity/Bundle/ContentManagerBundle/Model/Node.php @@ -261,7 +261,7 @@ class Node extends BaseNode } if ($this->getPage() && $this->getPage()->getNodeId() != $this->getId()) { - //$this->getPage()->setNodeId($this->getId())->save(); + // $this->getPage()->setNodeId($this->getId())->save(); } return parent::save($con); diff --git a/src/Trinity/Bundle/ContentManagerBundle/Routing/NodeLoader.php b/src/Trinity/Bundle/ContentManagerBundle/Routing/NodeLoader.php index bab07cb..c243a82 100644 --- a/src/Trinity/Bundle/ContentManagerBundle/Routing/NodeLoader.php +++ b/src/Trinity/Bundle/ContentManagerBundle/Routing/NodeLoader.php @@ -84,7 +84,7 @@ class NodeLoader extends Loader } } - // $node->setUrl( $route->getPath() )->save(); + // $node->setUrl( $route->getPath() )->save(); if ($exist = $routes->get($routeName)) { if ($exist instanceof NodeRoute) { diff --git a/src/Trinity/Bundle/ContentManagerBundle/Twig/Extension/BlockExtension.php b/src/Trinity/Bundle/ContentManagerBundle/Twig/Extension/BlockExtension.php index c0089aa..6e274ac 100644 --- a/src/Trinity/Bundle/ContentManagerBundle/Twig/Extension/BlockExtension.php +++ b/src/Trinity/Bundle/ContentManagerBundle/Twig/Extension/BlockExtension.php @@ -26,9 +26,6 @@ class BlockExtension extends \Twig_Extension public function initRuntime(\Twig_Environment $environment) { $this->environment = $environment; - -// $this->code_render = clone $this->environment; -// $this->code_render->setLoader(new \Twig_Loader_String()); } public function getName() @@ -75,13 +72,12 @@ class BlockExtension extends \Twig_Extension public function renderCodeBlock($block_name, $options) { -// try { -// $block = $this->blockManager->retrieve($block_name); -// } catch (BlockNotFoundException $e) { -// return null; -// } -// -// return $this->code_render->render($block->getValue(), $options); + // try { + // $block = $this->blockManager->retrieve($block_name); + // } catch (BlockNotFoundException $e) { + // return null; + // } + // return $this->code_render->render($block->getValue(), $options); } public function render($template, array $parameters = array()) diff --git a/src/Trinity/Bundle/NotificationBundle/Configuration/TemplateCrudConfiguration.php b/src/Trinity/Bundle/NotificationBundle/Configuration/TemplateCrudConfiguration.php index a178b74..80ef0ca 100644 --- a/src/Trinity/Bundle/NotificationBundle/Configuration/TemplateCrudConfiguration.php +++ b/src/Trinity/Bundle/NotificationBundle/Configuration/TemplateCrudConfiguration.php @@ -53,7 +53,6 @@ class TemplateCrudConfiguration extends \Trinity\Bundle\AdminBundle\Configuratio ) // Listing: - // ->setFieldTemplate('visible', 'TrinityAdminBundle:BaseAdmin:bool.html.twig') // ->setDisplayFields(array( // diff --git a/src/Trinity/Bundle/SlideshowBundle/Form/Extension/Type/PersoType.php b/src/Trinity/Bundle/SlideshowBundle/Form/Extension/Type/PersoType.php index 5735a03..aa4ec2d 100644 --- a/src/Trinity/Bundle/SlideshowBundle/Form/Extension/Type/PersoType.php +++ b/src/Trinity/Bundle/SlideshowBundle/Form/Extension/Type/PersoType.php @@ -12,25 +12,25 @@ class PersoType extends AbstractType */ public function setDefaultOptions(OptionsResolverInterface $resolver) { - /*$resolver - ->setDefaults(array( - 'show_size' => false, - )) - ->setRequired(array( - 'path', - )) - ->setOptional(array( - 'ajax_data', - )) - ->setAllowedTypes(array( - 'help' => 'string', - 'theme' => 'Acme\AjaxBundle\ThemeInterface', - 'ajax_data' => array('null', 'scalar'), - )) - ->setAllowedValues(array( - 'mode' => array('compact', 'wide'), - )) - ;*/ + // $resolver + // ->setDefaults(array( + // 'show_size' => false, + // )) + // ->setRequired(array( + // 'path', + // )) + // ->setOptional(array( + // 'ajax_data', + // )) + // ->setAllowedTypes(array( + // 'help' => 'string', + // 'theme' => 'Acme\AjaxBundle\ThemeInterface', + // 'ajax_data' => array('null', 'scalar'), + // )) + // ->setAllowedValues(array( + // 'mode' => array('compact', 'wide'), + // )) + // ; } /** diff --git a/src/Trinity/Bundle/UserBundle/Storage/SessionStorage.php b/src/Trinity/Bundle/UserBundle/Storage/SessionStorage.php index 6b6d46a..09c6280 100644 --- a/src/Trinity/Bundle/UserBundle/Storage/SessionStorage.php +++ b/src/Trinity/Bundle/UserBundle/Storage/SessionStorage.php @@ -53,8 +53,6 @@ class SessionStorage extends Storage } if ($this->options['auto_start'] && !self::$sessionStarted) { - // TODO: must look better… - //@session_start(); self::$sessionStarted = true; } } @@ -67,9 +65,9 @@ class SessionStorage extends Storage $retval = $_SESSION[$key]; } - if(is_string($retval)) { - $retval = (false !== $uns = @unserialize($retval)) ? $uns : $retval; - } + if (is_string($retval)) { + $retval = (false !== $uns = @unserialize($retval)) ? $uns : $retval; + } return $retval; } @@ -88,11 +86,10 @@ class SessionStorage extends Storage public function write($key, $data) { - if(is_object($data) || is_array($data)) { - $data = serialize($data); - } + if (is_object($data) || is_array($data)) { + $data = serialize($data); + } - $_SESSION[$key] = $data; } } diff --git a/src/Trinity/Component/Utils/Image.php b/src/Trinity/Component/Utils/Image.php index bdd837d..7f13b61 100644 --- a/src/Trinity/Component/Utils/Image.php +++ b/src/Trinity/Component/Utils/Image.php @@ -137,9 +137,9 @@ class Image $output = $this->image; } - //$this->getTool()->setCompressionQuality($this->getCompressionQuality()); - /** + * $this->getTool()->setCompressionQuality($this->getCompressionQuality()); + * * Should be $this->getTool()->writetImage($output); * but it does not work (Undefined Method) * Bug #61879