Parcourir la source

Fix missing licences and fix some PSR

Thomas Rabaix il y a 12 ans
Parent
commit
773d37651f

+ 5 - 5
Datagrid/ListMapper.php

@@ -28,9 +28,9 @@ class ListMapper
     protected $admin;
 
     /**
-     * @param \Sonata\AdminBundle\Builder\ListBuilderInterface     $listBuilder
-     * @param \Sonata\AdminBundle\Admin\FieldDescriptionCollection $list
-     * @param \Sonata\AdminBundle\Admin\AdminInterface             $admin
+     * @param ListBuilderInterface       $listBuilder
+     * @param FieldDescriptionCollection $list
+     * @param AdminInterface             $admin
      */
     public function __construct(ListBuilderInterface $listBuilder, FieldDescriptionCollection $list, AdminInterface $admin)
     {
@@ -118,7 +118,7 @@ class ListMapper
     /**
      * @param string $key
      *
-     * @return \Sonata\AdminBundle\Datagrid\ListMapper
+     * @return ListMapper
      */
     public function remove($key)
     {
@@ -131,7 +131,7 @@ class ListMapper
     /**
      * @param array $keys field names
      *
-     * @return \Sonata\AdminBundle\Datagrid\ListMapper
+     * @return ListMapper
      */
     public function reorder(array $keys)
     {

+ 0 - 1
Resources/views/CRUD/edit_boolean.html.twig

@@ -10,7 +10,6 @@ file that was distributed with this source code.
 #}
 
 <div>
-
     <div class="sonata-ba-field {% if field_element.vars.errors|length > 0 %}sonata-ba-field-error{% endif %}">
         {% block field %}{{ form_widget(field_element) }}{% endblock %}
         {% block label %}

+ 11 - 0
Resources/views/CRUD/list__action_delete.html.twig

@@ -1,3 +1,14 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
 {% if admin.isGranted('DELETE', object) and admin.hasRoute('delete') %}
     <a href="{{ admin.generateObjectUrl('delete', object) }}" class="btn delete_link" title="{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}">
         <i class="icon-remove"></i>

+ 11 - 0
Resources/views/CRUD/list__action_edit.html.twig

@@ -1,3 +1,14 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
 {% if admin.isGranted('EDIT', object) and admin.hasRoute('edit') %}
     <a href="{{ admin.generateObjectUrl('edit', object) }}" class="btn edit_link" title="{{ 'action_edit'|trans({}, 'SonataAdminBundle') }}">
         <i class="icon-edit"></i>

+ 11 - 0
Resources/views/CRUD/list__action_view.html.twig

@@ -1,3 +1,14 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
 {% if admin.hasRoute('show') %}
     <a href="{{ admin.generateObjectUrl('show', object) }}" class="btn view_link" title="{{ 'action_show'|trans({}, 'SonataAdminBundle') }}">
         <i class="icon-zoom-in"></i>

+ 15 - 15
Twig/Extension/SonataAdminExtension.php

@@ -97,15 +97,15 @@ class SonataAdminExtension extends \Twig_Extension
     /**
      * render a list element from the FieldDescription
      *
-     * @param mixed                                               $object
-     * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
-     * @param array                                               $params
+     * @param mixed                     $object
+     * @param FieldDescriptionInterface $fieldDescription
+     * @param array                     $params
      *
      * @return string
      */
     public function renderListElement($object, FieldDescriptionInterface $fieldDescription, $params = array())
     {
-        $template = $this->getTemplate($fieldDescription, 'SonataAdminBundle:CRUD:base_list_field.html.twig');
+        $template = $this->getTemplate($fieldDescription);
 
         return $this->output($fieldDescription, $template, array_merge($params, array(
             'admin'             => $fieldDescription->getAdmin(),
@@ -116,9 +116,9 @@ class SonataAdminExtension extends \Twig_Extension
     }
 
     /**
-     * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
-     * @param \Twig_TemplateInterface                             $template
-     * @param array                                               $parameters
+     * @param FieldDescriptionInterface $fieldDescription
+     * @param \Twig_TemplateInterface   $template
+     * @param array                     $parameters
      *
      * @return string
      */
@@ -143,9 +143,9 @@ class SonataAdminExtension extends \Twig_Extension
      * return the value related to FieldDescription, if the associated object does no
      * exists => a temporary one is created
      *
-     * @param object                                              $object
-     * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
-     * @param array                                               $params
+     * @param object                    $object
+     * @param FieldDescriptionInterface $fieldDescription
+     * @param array                     $params
      *
      * @throws \RuntimeException
      *
@@ -172,8 +172,8 @@ class SonataAdminExtension extends \Twig_Extension
     /**
      * render a view element
      *
-     * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
-     * @param mixed                                               $object
+     * @param FieldDescriptionInterface $fieldDescription
+     * @param mixed                     $object
      *
      * @return string
      */
@@ -198,8 +198,8 @@ class SonataAdminExtension extends \Twig_Extension
     /**
      * @throws \RunTimeException
      *
-     * @param mixed                                               $element
-     * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
+     * @param mixed                     $element
+     * @param FieldDescriptionInterface $fieldDescription
      *
      * @return mixed
      */
@@ -239,7 +239,7 @@ class SonataAdminExtension extends \Twig_Extension
      *
      * @param $text
      *
-     * @return text
+     * @return string
      */
     public function slugify($text)
     {