mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 13:54:59 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
@@ -28,7 +28,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
||||
}
|
||||
|
||||
// here, we alter the query created by Export
|
||||
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
|
||||
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data): void
|
||||
{
|
||||
$where = $qb->getDQLPart('where');
|
||||
// we create the clause here
|
||||
@@ -58,7 +58,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
||||
}
|
||||
|
||||
// we build a form to collect some parameters from the users
|
||||
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
|
||||
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder): void
|
||||
{
|
||||
$builder->add('date_from', DateType::class, [
|
||||
'label' => 'Born after this date',
|
||||
@@ -99,7 +99,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
||||
// is executed here. This function is added by the interface
|
||||
// `ExportElementValidatedInterface`, and can be ignore if there is
|
||||
// no need for a validation
|
||||
public function validateForm($data, ExecutionContextInterface $context)
|
||||
public function validateForm($data, ExecutionContextInterface $context): void
|
||||
{
|
||||
$date_from = $data['date_from'];
|
||||
$date_to = $data['date_to'];
|
||||
|
@@ -32,7 +32,7 @@ class CountPerson implements ExportInterface
|
||||
$this->entityManager = $em;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
// this export does not add any form
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractControl
|
||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
public function yourAction()
|
||||
public function yourAction(): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
$em = $this->managerRegistry->getManager();
|
||||
// first, get the number of total item are available
|
||||
|
@@ -28,7 +28,7 @@ class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function listAction($id)
|
||||
public function listAction($id): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
/** @var \Chill\PersonBundle\Entity\Person $person */
|
||||
$person = $this->get('chill.person.repository.person')
|
||||
|
@@ -31,7 +31,7 @@ class ChillMainConfiguration implements ConfigurationInterface
|
||||
$this->setWidgetFactories($widgetFactories);
|
||||
}
|
||||
|
||||
public function getConfigTreeBuilder()
|
||||
public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Builder\TreeBuilder
|
||||
{
|
||||
$treeBuilder = new TreeBuilder('chill_main');
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
|
@@ -27,12 +27,12 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
|
||||
*/
|
||||
protected $widgetFactories = [];
|
||||
|
||||
public function addWidgetFactory(WidgetFactoryInterface $factory)
|
||||
public function addWidgetFactory(WidgetFactoryInterface $factory): void
|
||||
{
|
||||
$this->widgetFactories[] = $factory;
|
||||
}
|
||||
|
||||
public function getConfiguration(array $config, ContainerBuilder $container)
|
||||
public function getConfiguration(array $config, ContainerBuilder $container): ?\Symfony\Component\Config\Definition\ConfigurationInterface
|
||||
{
|
||||
return new Configuration($this->widgetFactories, $container);
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
|
||||
return $this->widgetFactories;
|
||||
}
|
||||
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
public function load(array $configs, ContainerBuilder $container): void
|
||||
{
|
||||
// configuration for main bundle
|
||||
$configuration = $this->getConfiguration($configs, $container);
|
||||
|
@@ -25,7 +25,7 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
|
||||
* see http://symfony.com/doc/current/components/config/definition.html
|
||||
*
|
||||
*/
|
||||
public function configureOptions($place, NodeBuilder $node)
|
||||
public function configureOptions($place, NodeBuilder $node): void
|
||||
{
|
||||
$node->booleanNode('only_active')
|
||||
->defaultTrue()
|
||||
|
@@ -124,7 +124,7 @@ class ChillPersonAddAPersonWidget implements WidgetInterface
|
||||
/**
|
||||
* @return UserInterface
|
||||
*/
|
||||
private function getUser()
|
||||
private function getUser(): void
|
||||
{
|
||||
// return a user
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
*/
|
||||
class ChillPersonExtension extends Extension implements PrependExtensionInterface
|
||||
{
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
public function load(array $configs, ContainerBuilder $container): void
|
||||
{
|
||||
// ...
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
*
|
||||
* @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container
|
||||
*/
|
||||
public function prepend(ContainerBuilder $container)
|
||||
public function prepend(ContainerBuilder $container): void
|
||||
{
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
'widgets' => [
|
||||
|
Reference in New Issue
Block a user