@@ -67,10 +67,10 @@ |
||
| 67 | 67 | |
| 68 | 68 | if ($this->isGranted('DELETE')) { |
| 69 | 69 | $actions['delete'] = array( |
| 70 | - 'label' => 'action_delete', |
|
| 71 | - 'translation_domain' => 'SonataAdminBundle', |
|
| 72 | - 'ask_confirmation' => true, |
|
| 73 | - ); |
|
| 70 | + 'label' => 'action_delete', |
|
| 71 | + 'translation_domain' => 'SonataAdminBundle', |
|
| 72 | + 'ask_confirmation' => true, |
|
| 73 | + ); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return $this->handleBatchActions($actions); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | ->get('logger') |
| 66 | 66 | ->debug(sprintf( |
| 67 | 67 | '[BlastCoreBundle] Processing the configuration in this order: %s', |
| 68 | - implode(', ', $classes) |
|
| 68 | + implode(', ', $classes) |
|
| 69 | 69 | )) |
| 70 | 70 | ; |
| 71 | 71 | |
@@ -71,11 +71,9 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $fcts = [ |
| 73 | 73 | 'tabs' => $mapper instanceof ShowMapper ? |
| 74 | - ['getter' => 'getShowTabs', 'setter' => 'setShowTabs'] : |
|
| 75 | - ['getter' => 'getFormTabs', 'setter' => 'setFormTabs'], |
|
| 74 | + ['getter' => 'getShowTabs', 'setter' => 'setShowTabs'] : ['getter' => 'getFormTabs', 'setter' => 'setFormTabs'], |
|
| 76 | 75 | 'groups' => $mapper instanceof ShowMapper ? |
| 77 | - ['getter' => 'getShowGroups', 'setter' => 'setShowGroups'] : |
|
| 78 | - ['getter' => 'getFormGroups', 'setter' => 'setFormGroups'], |
|
| 76 | + ['getter' => 'getShowGroups', 'setter' => 'setShowGroups'] : ['getter' => 'getFormGroups', 'setter' => 'setFormGroups'], |
|
| 79 | 77 | ]; |
| 80 | 78 | |
| 81 | 79 | // Figure out if we have to display tabs on the Show view |
@@ -260,11 +258,9 @@ discard block |
||
| 260 | 258 | |
| 261 | 259 | $fcts = [ |
| 262 | 260 | 'tabs' => $mapper instanceof ShowMapper ? |
| 263 | - ['getter' => 'getShowTabs', 'setter' => 'setShowTabs'] : |
|
| 264 | - ['getter' => 'getFormTabs', 'setter' => 'setFormTabs'], |
|
| 261 | + ['getter' => 'getShowTabs', 'setter' => 'setShowTabs'] : ['getter' => 'getFormTabs', 'setter' => 'setFormTabs'], |
|
| 265 | 262 | 'groups' => $mapper instanceof ShowMapper ? |
| 266 | - ['getter' => 'getShowGroups', 'setter' => 'setShowGroups'] : |
|
| 267 | - ['getter' => 'getFormGroups', 'setter' => 'setFormGroups'], |
|
| 263 | + ['getter' => 'getShowGroups', 'setter' => 'setShowGroups'] : ['getter' => 'getFormGroups', 'setter' => 'setFormGroups'], |
|
| 268 | 264 | ]; |
| 269 | 265 | |
| 270 | 266 | // if a grouped organization can be shapped |
@@ -653,7 +649,7 @@ discard block |
||
| 653 | 649 | if (!is_array($fields) && isset($blast[$class][ListMapper::class]['add']['_export_format'][$fields])) { |
| 654 | 650 | $blast[$class][ListMapper::class]['add']['_export_format'][$format] = // the global fields array |
| 655 | 651 | $fields = // the local fields array |
| 656 | - $blast[$class][ListMapper::class]['add']['_export_format'][$fields]; // the source fields array |
|
| 652 | + $blast[$class][ListMapper::class]['add']['_export_format'][$fields]; // the source fields array |
|
| 657 | 653 | } |
| 658 | 654 | |
| 659 | 655 | // removes a specific format |
@@ -823,7 +819,7 @@ discard block |
||
| 823 | 819 | $choicesFunction = call_user_func($className . '::' . $methodName, $this->getModelManager(), $entityClass); |
| 824 | 820 | |
| 825 | 821 | $options['choices'] = $choicesFunction; |
| 826 | - $options['choice_loader'] = new CallbackChoiceLoader(function () use ($options) { |
|
| 822 | + $options['choice_loader'] = new CallbackChoiceLoader(function() use ($options) { |
|
| 827 | 823 | return $options['choices']; |
| 828 | 824 | }); |
| 829 | 825 | unset($options['choicesCallback']); |
@@ -530,6 +530,9 @@ discard block |
||
| 530 | 530 | return $mapper; |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | + /** |
|
| 534 | + * @param string $class |
|
| 535 | + */ |
|
| 533 | 536 | protected function configureFields($function, BaseMapper $mapper, $class = null) |
| 534 | 537 | { |
| 535 | 538 | if (!$class) { |
@@ -791,6 +794,9 @@ discard block |
||
| 791 | 794 | return $baseRoute; |
| 792 | 795 | } |
| 793 | 796 | |
| 797 | + /** |
|
| 798 | + * @param BaseMapper $mapper |
|
| 799 | + */ |
|
| 794 | 800 | protected function manageQueryCallback($mapper, &$options) |
| 795 | 801 | { |
| 796 | 802 | $query = $options['query']; |
@@ -809,6 +815,9 @@ discard block |
||
| 809 | 815 | } |
| 810 | 816 | } |
| 811 | 817 | |
| 818 | + /** |
|
| 819 | + * @param BaseMapper $mapper |
|
| 820 | + */ |
|
| 812 | 821 | protected function manageChoicesCallback($mapper, &$options) |
| 813 | 822 | { |
| 814 | 823 | $callback = $options['choicesCallback']; |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | foreach ($pager->getResults() as $result) { |
| 53 | 53 | $results[] = array( |
| 54 | 54 | 'label' => $admin->toString($result), |
| 55 | - 'link' => $admin->generateObjectUrl('show', $result), // Sonata uses "edit", we prefer "show" |
|
| 55 | + 'link' => $admin->generateObjectUrl('show', $result), // Sonata uses "edit", we prefer "show" |
|
| 56 | 56 | 'id' => $admin->id($result), |
| 57 | 57 | ); |
| 58 | 58 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | /** |
| 28 | 28 | * @param Request $request |
| 29 | 29 | * |
| 30 | - * @return JsonResponse|Response |
|
| 30 | + * @return \Symfony\Component\HttpFoundation\Response |
|
| 31 | 31 | * |
| 32 | 32 | * @throws \RuntimeException |
| 33 | 33 | */ |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | |
| 67 | 67 | // Manage route pattern generation |
| 68 | 68 | $routes = $parts; |
| 69 | - array_walk($routes, function (&$item, $k) use (&$routes) { |
|
| 69 | + array_walk($routes, function(&$item, $k) use (&$routes) { |
|
| 70 | 70 | $item = preg_replace('/(admin)|(bundle)/', '', strtolower($item)); |
| 71 | 71 | if ($item == '') { |
| 72 | 72 | array_splice($routes, $k, 1); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @param ModelManagerInterface $modelManager |
| 38 | - * @param array|string $skeletonDirectories |
|
| 38 | + * @param string $skeletonDirectories |
|
| 39 | 39 | */ |
| 40 | 40 | public function __construct(ModelManagerInterface $modelManager, $skeletonDirectories) |
| 41 | 41 | { |
@@ -167,6 +167,9 @@ |
||
| 167 | 167 | return $classes; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | + /** |
|
| 171 | + * @param string $function |
|
| 172 | + */ |
|
| 170 | 173 | private function fallbackConfiguration(BaseMapper $mapper, $function) |
| 171 | 174 | { |
| 172 | 175 | // fallback |
@@ -310,7 +310,7 @@ |
||
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | |
| 313 | - /** |
|
| 313 | + /** |
|
| 314 | 314 | * Rename a tab after fields have been configured. |
| 315 | 315 | * |
| 316 | 316 | * TODO: groups of the renamed tab are still prefixed with the old tab name |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @param $collections array or string, describing the collections to manage |
| 35 | 35 | * |
| 36 | - * @return CoreAdmin $this |
|
| 36 | + * @return CollectionsManager $this |
|
| 37 | 37 | * */ |
| 38 | 38 | public function addManagedCollections($collections) |
| 39 | 39 | { |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * @param FormMapper $mapper |
|
| 35 | + * @param ShowMapper $mapper |
|
| 36 | 36 | */ |
| 37 | 37 | public function configureShowFields(ShowMapper $mapper) |
| 38 | 38 | { |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | * |
| 130 | 130 | * @param $name string|null |
| 131 | 131 | * |
| 132 | - * @return self |
|
| 132 | + * @return boolean |
|
| 133 | 133 | **/ |
| 134 | 134 | public function hasListAction($name) |
| 135 | 135 | { |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * @param type $mapper |
| 22 | 22 | * |
| 23 | - * @return type |
|
| 23 | + * @return Templates |
|
| 24 | 24 | */ |
| 25 | 25 | protected function fixTemplates($mapper) |
| 26 | 26 | { |