0

Improper php indenting near anonymous function

Dave Lighthart 12 years ago 0

The following block indents improperly.  The problem appears related to the length of the anonymous function in the array.  If some of the chain selectors are combined, the indent works as expected.


<?php

namespace \App\AppBundle\Form;

use Symfony\Component\Form\AbstractType;

use Symfony\Component\Form\FormBuilderInterface;

use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ServiceType extends AbstractType

{

    public function buildForm(FormBuilderInterface $builder,array $options)

    {

        if ($sc->isGranted("ROLE_ADMIN")){

        } else {

            $builder->add('procedureCode'

                ,null

                ,array(

                    'empty_value'         => ''

                    ,'label'               => 'Procedure'

                    ,'label_attr'          => array('class' => 'txtl')

                    ,'attr'                => array('class' => 'select0')

                    ,'query_builder'       => function ($repository) use ($formusorid){

                        $qb = $repository->createQueryBuilder('p');

                        $qb->innerJoin('p.role', 'r')

                        ->innerJoin('r.usor','u','WITH',$qb->expr()->eq('u.id', ':usorid'))

                        ->leftJoin('AppAppBundle:Service','s','WITH',$qb->expr()->eq('s.procedure', 'p.id'))

                        ->setParameter('usorid', $formusorid)->select('p, COUNT(s) AS HIDDEN total')

                        ->addGroupBy('p')

                        ->addOrderBy('total' ,'DESC')->addOrderBy('p.code');

                        return $qb;

                    }));

}

if ($sc->isGranted("ROLE_ADMIN") or $otherview){

}

public function setDefaultOptions(OptionsResolverInterface $resolver)

{

    $resolver->setDefaults(array(

        'data_class' => '\App\AppBundle\Entity\Service'

        ));

}

public function getName()

{

    return '_App_Appbundle_Servicetype';

}

}