@@ -85,6 +85,10 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | protected $pager; |
| 87 | 87 | |
| 88 | + /** |
|
| 89 | + * @param EntityRepository $repository |
|
| 90 | + * @param GenericManager $manager |
|
| 91 | + */ |
|
| 88 | 92 | public function __construct($name, $repository, $manager, AdminConfig $adminConfig) |
| 89 | 93 | { |
| 90 | 94 | $this->name = $name; |
@@ -101,7 +105,7 @@ discard block |
||
| 101 | 105 | /** |
| 102 | 106 | * Generate a route for admin and action name |
| 103 | 107 | * |
| 104 | - * @param $actionName |
|
| 108 | + * @param string $actionName |
|
| 105 | 109 | * @return string |
| 106 | 110 | * @throws Exception |
| 107 | 111 | */ |
@@ -143,7 +147,7 @@ discard block |
||
| 143 | 147 | } |
| 144 | 148 | |
| 145 | 149 | /** |
| 146 | - * @return mixed |
|
| 150 | + * @return string |
|
| 147 | 151 | */ |
| 148 | 152 | public function getEntityNamespace() |
| 149 | 153 | { |
@@ -159,7 +163,7 @@ discard block |
||
| 159 | 163 | } |
| 160 | 164 | |
| 161 | 165 | /** |
| 162 | - * @return mixed |
|
| 166 | + * @return ArrayCollection |
|
| 163 | 167 | */ |
| 164 | 168 | public function getEntities() |
| 165 | 169 | { |
@@ -175,7 +179,7 @@ discard block |
||
| 175 | 179 | } |
| 176 | 180 | |
| 177 | 181 | /** |
| 178 | - * @return mixed |
|
| 182 | + * @return string |
|
| 179 | 183 | */ |
| 180 | 184 | public function getFormType() |
| 181 | 185 | { |
@@ -183,7 +187,7 @@ discard block |
||
| 183 | 187 | } |
| 184 | 188 | |
| 185 | 189 | /** |
| 186 | - * @return mixed |
|
| 190 | + * @return Controller |
|
| 187 | 191 | */ |
| 188 | 192 | public function getController() |
| 189 | 193 | { |
@@ -228,7 +232,7 @@ discard block |
||
| 228 | 232 | /** |
| 229 | 233 | * Find a entity by one of its field |
| 230 | 234 | * |
| 231 | - * @param $field |
|
| 235 | + * @param string $field |
|
| 232 | 236 | * @param $value |
| 233 | 237 | * @return null|object |
| 234 | 238 | * @throws Exception |
@@ -250,6 +250,9 @@ |
||
| 250 | 250 | return $manager; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | + /** |
|
| 254 | + * @param string $title |
|
| 255 | + */ |
|
| 253 | 256 | protected function getDefaultActionTitle($title, $action) |
| 254 | 257 | { |
| 255 | 258 | $default = $title; |
@@ -322,7 +322,7 @@ |
||
| 322 | 322 | 'routing' => [ |
| 323 | 323 | 'name_pattern' => 'bluebear.admin.{admin}', |
| 324 | 324 | 'url_pattern' => '/{admin}/{action}', |
| 325 | - ] |
|
| 325 | + ] |
|
| 326 | 326 | ]; |
| 327 | 327 | } |
| 328 | 328 | } |
@@ -75,6 +75,9 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | + /** |
|
| 79 | + * @param string $entityNamespace |
|
| 80 | + */ |
|
| 78 | 81 | public function create($entityNamespace) |
| 79 | 82 | { |
| 80 | 83 | $entity = new $entityNamespace; |
@@ -142,6 +145,9 @@ discard block |
||
| 142 | 145 | return $callback; |
| 143 | 146 | } |
| 144 | 147 | |
| 148 | + /** |
|
| 149 | + * @param string $method |
|
| 150 | + */ |
|
| 145 | 151 | protected function methodMatch($method) |
| 146 | 152 | { |
| 147 | 153 | return array_key_exists($method, $this->methodsMapping); |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | |
| 137 | 137 | public function getCountQueryBuilderCallback() |
| 138 | 138 | { |
| 139 | - $callback = function (QueryBuilder $queryBuilder) { |
|
| 139 | + $callback = function(QueryBuilder $queryBuilder) { |
|
| 140 | 140 | |
| 141 | 141 | }; |
| 142 | 142 | return $callback; |
@@ -194,7 +194,7 @@ |
||
| 194 | 194 | $hooks = []; |
| 195 | 195 | |
| 196 | 196 | foreach ($fields as $fieldName) { |
| 197 | - $exporter->addHook(function ($fieldValue) { |
|
| 197 | + $exporter->addHook(function($fieldValue) { |
|
| 198 | 198 | // if field is an array |
| 199 | 199 | if (is_array($fieldValue)) { |
| 200 | 200 | $value = $this->recursiveImplode(', ', $fieldValue); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | // general values |
| 41 | 41 | $this->controllerName = $adminConfiguration['controller']; |
| 42 | 42 | $this->entityName = $adminConfiguration['entity']; |
| 43 | - $this->formType = $adminConfiguration['form'];; |
|
| 43 | + $this->formType = $adminConfiguration['form']; ; |
|
| 44 | 44 | $this->maxPerPage = $adminConfiguration['max_per_page']; |
| 45 | 45 | $this->actions = $adminConfiguration['actions']; |
| 46 | 46 | $this->managerConfiguration = $adminConfiguration['manager']; |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | namespace BlueBear\AdminBundle\Event\Subscriber; |
| 4 | 4 | |
| 5 | 5 | use BlueBear\AdminBundle\Admin\AdminFactory; |
| 6 | -use BlueBear\BaseBundle\Behavior\ContainerTrait;; |
|
| 6 | +use BlueBear\BaseBundle\Behavior\ContainerTrait; ; |
|
| 7 | 7 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
| 8 | 8 | use Symfony\Component\HttpKernel\Event\KernelEvent; |
| 9 | 9 | use Symfony\Component\HttpKernel\KernelEvents; |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $return .= $piece; |
| 25 | 25 | } |
| 26 | 26 | if ($index < $count - 1) { |
| 27 | - $return .= $glue; |
|
| 27 | + $return .= $glue; |
|
| 28 | 28 | } |
| 29 | 29 | $index++; |
| 30 | 30 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $configuration = new Configuration(); |
| 23 | 23 | $config = $this->processConfiguration($configuration, $configs); |
| 24 | 24 | |
| 25 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 25 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 26 | 26 | $loader->load('services.yml'); |
| 27 | 27 | |
| 28 | 28 | $container->setParameter('bluebear.admins', $config['admins']); |