Skip to content

Commit

Permalink
Apply CS
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh committed May 9, 2016
1 parent 0509f2b commit ce2db76
Show file tree
Hide file tree
Showing 101 changed files with 991 additions and 991 deletions.
86 changes: 43 additions & 43 deletions Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
*/
abstract class Admin implements AdminInterface, DomainObjectInterface
{
const CONTEXT_MENU = 'menu';
const CONTEXT_DASHBOARD = 'dashboard';
const CONTEXT_MENU = 'menu';
const CONTEXT_DASHBOARD = 'dashboard';

const CLASS_REGEX = '@(?:([A-Za-z0-9]*)\\\)?(Bundle\\\)?([A-Za-z0-9]+?)(?:Bundle)?\\\(Entity|Document|Model|PHPCR|CouchDocument|Phpcr|Doctrine\\\Orm|Doctrine\\\Phpcr|Doctrine\\\MongoDB|Doctrine\\\CouchDB)\\\(.*)@';
const CLASS_REGEX = '@(?:([A-Za-z0-9]*)\\\)?(Bundle\\\)?([A-Za-z0-9]+?)(?:Bundle)?\\\(Entity|Document|Model|PHPCR|CouchDocument|Phpcr|Doctrine\\\Orm|Doctrine\\\Phpcr|Doctrine\\\MongoDB|Doctrine\\\CouchDB)\\\(.*)@';

/**
* The class name managed by the admin class.
Expand Down Expand Up @@ -227,8 +227,8 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
* @var array
*/
protected $datagridValues = array(
'_page' => 1,
'_per_page' => 32,
'_page' => 1,
'_per_page' => 32,
);

/**
Expand Down Expand Up @@ -446,10 +446,10 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
* @var array
*/
protected $loaded = array(
'view_fields' => false,
'view_groups' => false,
'routes' => false,
'tab_menu' => false,
'view_fields' => false,
'view_groups' => false,
'routes' => false,
'tab_menu' => false,
);

/**
Expand All @@ -465,7 +465,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
/**
* @var array
*/
protected $templates = array();
protected $templates = array();

/**
* @var AdminExtensionInterface[]
Expand Down Expand Up @@ -628,9 +628,9 @@ public function validate(ErrorElement $errorElement, $object)
*/
public function __construct($code, $class, $baseControllerName)
{
$this->code = $code;
$this->class = $class;
$this->baseControllerName = $baseControllerName;
$this->code = $code;
$this->class = $class;
$this->baseControllerName = $baseControllerName;

$this->predefinePerPageOptions();
$this->datagridValues['_per_page'] = $this->maxPerPage;
Expand Down Expand Up @@ -816,9 +816,9 @@ protected function buildList()

if (count($this->getBatchActions()) > 0) {
$fieldDescription = $this->getModelManager()->getNewFieldDescriptionInstance($this->getClass(), 'batch', array(
'label' => 'batch',
'code' => '_batch',
'sortable' => false,
'label' => 'batch',
'code' => '_batch',
'sortable' => false,
'virtual_field' => true,
));

Expand All @@ -836,9 +836,9 @@ protected function buildList()

if ($this->hasRequest() && $this->getRequest()->isXmlHttpRequest()) {
$fieldDescription = $this->getModelManager()->getNewFieldDescriptionInstance($this->getClass(), 'select', array(
'label' => false,
'code' => '_select',
'sortable' => false,
'label' => false,
'code' => '_select',
'sortable' => false,
'virtual_field' => false,
));

Expand Down Expand Up @@ -928,9 +928,9 @@ public function buildDatagrid()
// ok, try to limit to add parent filter
if ($this->isChild() && $this->getParentAssociationMapping() && !$mapper->has($this->getParentAssociationMapping())) {
$mapper->add($this->getParentAssociationMapping(), null, array(
'show_filter' => false,
'label' => false,
'field_type' => 'sonata_type_model_hidden',
'show_filter' => false,
'label' => false,
'field_type' => 'sonata_type_model_hidden',
'field_options' => array(
'model_manager' => $this->getModelManager(),
),
Expand Down Expand Up @@ -1223,9 +1223,9 @@ public function getBatchActions()

if ($this->hasRoute('delete') && $this->isGranted('DELETE')) {
$actions['delete'] = array(
'label' => 'action_delete',
'label' => 'action_delete',
'translation_domain' => 'SonataAdminBundle',
'ask_confirmation' => true, // by default always true
'ask_confirmation' => true, // by default always true
);
}

Expand Down Expand Up @@ -1456,7 +1456,7 @@ protected function attachInlineValidator()

$metadata->addConstraint(new InlineConstraint(array(
'service' => $this,
'method' => function (ErrorElement $errorElement, $object) use ($admin) {
'method' => function (ErrorElement $errorElement, $object) use ($admin) {
/* @var \Sonata\AdminBundle\Admin\AdminInterface $admin */

// This avoid the main validation to be cascaded to children
Expand Down Expand Up @@ -1803,7 +1803,7 @@ public function setShowGroups(array $showGroups)
*/
public function reorderShowGroup($group, array $keys)
{
$showGroups = $this->getShowGroups();
$showGroups = $this->getShowGroups();
$showGroups[$group]['fields'] = array_merge(array_flip($keys), $showGroups[$group]['fields']);
$this->setShowGroups($showGroups);
}
Expand Down Expand Up @@ -2950,17 +2950,17 @@ public function getAccessMapping()
protected function getAccess()
{
$access = array_merge(array(
'acl' => 'MASTER',
'export' => 'EXPORT',
'acl' => 'MASTER',
'export' => 'EXPORT',
'historyCompareRevisions' => 'EDIT',
'historyViewRevision' => 'EDIT',
'history' => 'EDIT',
'edit' => 'EDIT',
'show' => 'VIEW',
'create' => 'CREATE',
'delete' => 'DELETE',
'batchDelete' => 'DELETE',
'list' => 'LIST',
'historyViewRevision' => 'EDIT',
'history' => 'EDIT',
'edit' => 'EDIT',
'show' => 'VIEW',
'create' => 'CREATE',
'delete' => 'DELETE',
'batchDelete' => 'DELETE',
'list' => 'LIST',
), $this->getAccessMapping());

foreach ($this->extensions as $extension) {
Expand Down Expand Up @@ -3101,20 +3101,20 @@ public function getDashboardActions()

if ($this->hasRoute('create') && $this->isGranted('CREATE')) {
$actions['create'] = array(
'label' => 'link_add',
'label' => 'link_add',
'translation_domain' => 'SonataAdminBundle',
'template' => 'SonataAdminBundle:CRUD:dashboard__action_create.html.twig',
'url' => $this->generateUrl('create'),
'icon' => 'plus-circle',
'template' => 'SonataAdminBundle:CRUD:dashboard__action_create.html.twig',
'url' => $this->generateUrl('create'),
'icon' => 'plus-circle',
);
}

if ($this->hasRoute('list') && $this->isGranted('LIST')) {
$actions['list'] = array(
'label' => 'link_list',
'label' => 'link_list',
'translation_domain' => 'SonataAdminBundle',
'url' => $this->generateUrl('list'),
'icon' => 'list',
'url' => $this->generateUrl('list'),
'icon' => 'list',
);
}

Expand Down
2 changes: 1 addition & 1 deletion Admin/Extension/LockExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function configureFormFields(FormMapper $form)

$form->add($fieldName, 'hidden', array(
'mapped' => false,
'data' => $lockVersion,
'data' => $lockVersion,
));
});
}
Expand Down
4 changes: 2 additions & 2 deletions Admin/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class Pool
public function __construct(ContainerInterface $container, $title, $logoTitle, $options = array(), PropertyAccessorInterface $propertyAccessor = null)
{
$this->container = $container;
$this->title = $title;
$this->title = $title;
$this->titleLogo = $logoTitle;
$this->options = $options;
$this->options = $options;
$this->propertyAccessor = $propertyAccessor;
}

Expand Down
12 changes: 6 additions & 6 deletions Annotation/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ public function processMetadata(ClassMetadata $metadata)
$this->validate();

$tag = array(
'manager_type' => $this->managerType,
'group' => $this->group,
'label' => $this->label,
'manager_type' => $this->managerType,
'group' => $this->group,
'label' => $this->label,
'show_in_dashboard' => $this->showInDashboard,
'icon' => $this->icon,
'pager_type' => $this->pagerType,
'persist_filters' => $this->persistFilters,
'icon' => $this->icon,
'pager_type' => $this->pagerType,
'persist_filters' => $this->persistFilters,
);

$tag = array_filter($tag, function ($v) { return !is_null($v); });
Expand Down
8 changes: 4 additions & 4 deletions Block/AdminListBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public function execute(BlockContextInterface $blockContext, Response $response
}

return $this->renderPrivateResponse($this->pool->getTemplate('list_block'), array(
'block' => $blockContext->getBlock(),
'settings' => $settings,
'admin_pool' => $this->pool,
'groups' => $visibleGroups,
'block' => $blockContext->getBlock(),
'settings' => $settings,
'admin_pool' => $this->pool,
'groups' => $visibleGroups,
), $response);
}

Expand Down
18 changes: 9 additions & 9 deletions Block/AdminSearchBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public function execute(BlockContextInterface $blockContext, Response $response
);

return $this->renderPrivateResponse($admin->getTemplate('search_result_block'), array(
'block' => $blockContext->getBlock(),
'settings' => $blockContext->getSettings(),
'admin_pool' => $this->pool,
'pager' => $pager,
'admin' => $admin,
'block' => $blockContext->getBlock(),
'settings' => $blockContext->getSettings(),
'admin_pool' => $this->pool,
'pager' => $pager,
'admin' => $admin,
), $response);
}

Expand All @@ -101,10 +101,10 @@ public function configureSettings(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'admin_code' => false,
'query' => '',
'page' => 0,
'per_page' => 10,
'icon' => '<i class="fa fa-list"></i>',
'query' => '',
'page' => 0,
'per_page' => 10,
'icon' => '<i class="fa fa-list"></i>',
));
}
}
22 changes: 11 additions & 11 deletions Block/AdminStatsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public function execute(BlockContextInterface $blockContext, Response $response
$datagrid->buildPager();

return $this->renderPrivateResponse($blockContext->getTemplate(), array(
'block' => $blockContext->getBlock(),
'settings' => $blockContext->getSettings(),
'block' => $blockContext->getBlock(),
'settings' => $blockContext->getSettings(),
'admin_pool' => $this->pool,
'admin' => $admin,
'pager' => $datagrid->getPager(),
'datagrid' => $datagrid,
'admin' => $admin,
'pager' => $datagrid->getPager(),
'datagrid' => $datagrid,
), $response);
}

Expand All @@ -87,12 +87,12 @@ public function getName()
public function configureSettings(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'icon' => 'fa-line-chart',
'text' => 'Statistics',
'color' => 'bg-aqua',
'code' => false,
'filters' => array(),
'limit' => 1000,
'icon' => 'fa-line-chart',
'text' => 'Statistics',
'color' => 'bg-aqua',
'code' => false,
'filters' => array(),
'limit' => 1000,
'template' => 'SonataAdminBundle:Block:block_stats.html.twig',
));
}
Expand Down
Loading

0 comments on commit ce2db76

Please sign in to comment.