Skip to content

Commit

Permalink
PHPCsFixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurujai committed Jan 17, 2024
1 parent c0762d3 commit d87c07c
Show file tree
Hide file tree
Showing 56 changed files with 152 additions and 91 deletions.
4 changes: 3 additions & 1 deletion src/Pumukit/CoreBundle/Event/FileRemovedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace Pumukit\CoreBundle\Event;

class FileRemovedEvent extends \Symfony\Contracts\EventDispatcher\Event
use Symfony\Contracts\EventDispatcher\Event;

class FileRemovedEvent extends Event
{
protected $filePath;

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/CoreBundle/Event/InboxUploadEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace Pumukit\CoreBundle\Event;

use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Contracts\EventDispatcher\Event;

class InboxUploadEvent extends \Symfony\Contracts\EventDispatcher\Event
class InboxUploadEvent extends Event
{
protected $user;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
namespace Pumukit\CoreBundle\EventListener;

use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;

/**
* See: https://tideways.io/profiler/blog/slow-ajax-requests-in-your-symfony-application-apply-this-simple-fix.
*/
class AjaxSessionCloseListener
{
public function onKernelRequest(\Symfony\Component\HttpKernel\Event\RequestEvent $event): void
public function onKernelRequest(RequestEvent $event): void
{
$request = $event->getRequest();

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/CoreBundle/EventListener/FilterListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Pumukit\CoreBundle\Controller\PersonalControllerInterface;
use Pumukit\CoreBundle\Controller\WebTVControllerInterface;
use Pumukit\CoreBundle\Services\FilterService;
use Symfony\Component\HttpKernel\Event\ControllerEvent;

/**
* Class FilterListener.
Expand All @@ -34,7 +35,7 @@ public function __construct(DocumentManager $documentManager, FilterService $fil
/**
* @throws \MongoException
*/
public function onKernelController(\Symfony\Component\HttpKernel\Event\ControllerEvent $event): void
public function onKernelController(ControllerEvent $event): void
{
$canBeActivated = $this->filterService->checkFilterActivation($event);
if (!$canBeActivated) {
Expand Down
2 changes: 1 addition & 1 deletion src/Pumukit/EncoderBundle/Services/PicExtractorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private function getAspect(Track $track)
*
* Pic service addPicUrl doesn't add the path
*/
private function completePicMetadata(MultimediaObject $multimediaObject, Pic $pic, string $picPath = '', int $width = 0, int $height = 0, array $tags = []): Multimediaobject
private function completePicMetadata(MultimediaObject $multimediaObject, Pic $pic, string $picPath = '', int $width = 0, int $height = 0, array $tags = []): MultimediaObject
{
$pic->setPath($picPath);
$pic->setWidth($width);
Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/EncoderBundle/Services/PicService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Pumukit\EncoderBundle\Services;

use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\MongoDBException;
use MongoDB\BSON\ObjectId;
use Pumukit\SchemaBundle\Document\MultimediaObject;
use Pumukit\SchemaBundle\Document\Pic;
Expand Down Expand Up @@ -45,7 +46,7 @@ public function __construct(DocumentManager $documentManager, MultimediaObjectPi
*
* @return \Doctrine\MongoDB\Iterator|mixed|null
*
* @throws \Doctrine\ODM\MongoDB\MongoDBException
* @throws MongoDBException
*/
public function findPicsByOptions($id = null, $size = null, $path = null, $extension = null, $tags = null, $exists = null, $type = null)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/EncoderBundle/Tests/Services/JobServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Pumukit\EncoderBundle\Services\ProfileService;
use Pumukit\SchemaBundle\Document\MultimediaObject;
use Pumukit\SchemaBundle\Document\Series;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;

/**
Expand Down Expand Up @@ -50,7 +51,7 @@ public function setUp(): void

$profileService = new ProfileService($this->getDemoProfiles(), $this->dm);
$cpuService = new CpuService($this->getDemoCpus(), $this->dm);
$dispatcher = $this->getMockBuilder(\Symfony\Component\EventDispatcher\EventDispatcherInterface::class)
$dispatcher = $this->getMockBuilder(EventDispatcherInterface::class)
->getMock()
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ public function deleteExternalPropertyAction(MultimediaObject $multimediaObject)
/**
* @Template("@PumukitNewAdmin/MultimediaObject/modalPreview.html.twig")
*/
public function modalPreviewAction(Multimediaobject $multimediaObject)
public function modalPreviewAction(MultimediaObject $multimediaObject)
{
return [
'multimediaObject' => $multimediaObject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Pumukit\NewAdminBundle\DependencyInjection;

use Pumukit\NewAdminBundle\EventListener\NakedBackofficeListener;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
Expand Down Expand Up @@ -43,7 +44,7 @@ public function load(array $configs, ContainerBuilder $container)
$arguments[] = '%pumukit.naked_custom_css_url%';
}

$definition = new Definition(\Pumukit\NewAdminBundle\EventListener\NakedBackofficeListener::class, $arguments);
$definition = new Definition(NakedBackofficeListener::class, $arguments);
$definition->addTag('kernel.event_listener', ['event' => 'kernel.controller', 'method' => 'onKernelController']);
$container->setDefinition('pumukitnewadmin.nakedbackoffice', $definition);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Pumukit\NewAdminBundle\EventListener;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

Expand All @@ -13,9 +14,9 @@ class ExceptionListener
/**
* Handles security related exceptions.
*
* @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event An GetResponseForExceptionEvent instance
* @param ExceptionEvent $event An GetResponseForExceptionEvent instance
*/
public function onKernelException(\Symfony\Component\HttpKernel\Event\ExceptionEvent $event)
public function onKernelException(ExceptionEvent $event)
{
$exception = $event->getThrowable();
do {
Expand All @@ -25,7 +26,7 @@ public function onKernelException(\Symfony\Component\HttpKernel\Event\ExceptionE
} while (null !== $exception = $exception->getPrevious());
}

private function handleAccessDeniedException(\Symfony\Component\HttpKernel\Event\ExceptionEvent $event, AccessDeniedException $exception)
private function handleAccessDeniedException(ExceptionEvent $event, AccessDeniedException $exception)
{
$req = $event->getRequest();
if ($req->isXmlHttpRequest()) {
Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/EventListener/FilterListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Pumukit\SchemaBundle\Document\PersonInterface;
use Pumukit\SchemaBundle\Document\User;
use Pumukit\SchemaBundle\Services\PersonService;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

class FilterListener
Expand All @@ -29,7 +30,7 @@ public function __construct(DocumentManager $documentManager, PersonService $per
$this->addUserAsPerson = $addUserAsPerson;
}

public function onKernelController(\Symfony\Component\HttpKernel\Event\ControllerEvent $event)
public function onKernelController(ControllerEvent $event)
{
$req = $event->getRequest();
$routeParams = $req->attributes->get('_route_params');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Pumukit\NewAdminBundle\EventListener;

use Symfony\Component\HttpKernel\Event\ControllerEvent;

class NakedBackofficeListener
{
private $domain;
Expand All @@ -19,7 +21,7 @@ public function __construct($domain, $background, $color = '#c05800', $customCss
$this->customCssURL = $customCssURL;
}

public function onKernelController(\Symfony\Component\HttpKernel\Event\ControllerEvent $event)
public function onKernelController(ControllerEvent $event)
{
$req = $event->getRequest();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Intl\Languages;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Contracts\Translation\TranslatorInterface;

class CustomLanguageType extends AbstractType
{
Expand All @@ -22,7 +23,7 @@ class CustomLanguageType extends AbstractType
private $translator;
private $customLanguages;

public function __construct(\Symfony\Contracts\Translation\TranslatorInterface $translator, array $customLanguages = [])
public function __construct(TranslatorInterface $translator, array $customLanguages = [])
{
$this->translator = $translator;
$this->customLanguages = $customLanguages;
Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/EventType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Pumukit\NewAdminBundle\Form\Type\Base\TextareaI18nType;
use Pumukit\NewAdminBundle\Form\Type\Other\EventscheduleType;
use Pumukit\SchemaBundle\Document\Event;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
Expand Down Expand Up @@ -94,7 +95,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\Event::class,
'data_class' => Event::class,
]
);

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/EventsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Pumukit\NewAdminBundle\Form\Type\Base\TextareaI18nType;
use Pumukit\NewAdminBundle\Form\Type\Base\TextI18nType;
use Pumukit\SchemaBundle\Document\EmbeddedEvent;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
Expand Down Expand Up @@ -120,7 +121,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\EmbeddedEvent::class,
'data_class' => EmbeddedEvent::class,
]
);

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/GroupType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Pumukit\NewAdminBundle\Form\Type;

use Pumukit\SchemaBundle\Document\Group;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
Expand Down Expand Up @@ -58,7 +59,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\Group::class,
'data_class' => Group::class,
]
);

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/LinkType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Pumukit\NewAdminBundle\Form\Type;

use Pumukit\NewAdminBundle\Form\Type\Base\TextI18nType;
use Pumukit\SchemaBundle\Document\Link;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down Expand Up @@ -50,7 +51,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\Link::class,
'data_class' => Link::class,
]
);

Expand Down
2 changes: 1 addition & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/LiveType.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\Live::class,
'data_class' => Live::class,
]
);

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/MaterialType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Pumukit\NewAdminBundle\Form\Type\Base\CustomLanguageType;
use Pumukit\NewAdminBundle\Form\Type\Base\TextI18nType;
use Pumukit\SchemaBundle\Document\Material;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
Expand Down Expand Up @@ -84,7 +85,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\Material::class,
'data_class' => Material::class,
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\MultimediaObject::class,
'data_class' => MultimediaObject::class,
'not_granted_change_status' => true,
]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Pumukit\NewAdminBundle\Form\Type\Base\TextareaI18nType;
use Pumukit\NewAdminBundle\Form\Type\Base\TextI18nAdvanceType;
use Pumukit\NewAdminBundle\Form\Type\Other\Html5dateType;
use Pumukit\SchemaBundle\Document\MultimediaObject;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down Expand Up @@ -101,7 +102,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\MultimediaObject::class,
'data_class' => MultimediaObject::class,
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Pumukit\NewAdminBundle\Form\Type;

use Pumukit\SchemaBundle\Document\PermissionProfile;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down Expand Up @@ -35,7 +36,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\PermissionProfile::class,
'data_class' => PermissionProfile::class,
]
);

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/PersonType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Pumukit\NewAdminBundle\Form\Type\Base\TextareaI18nType;
use Pumukit\NewAdminBundle\Form\Type\Base\TextI18nType;
use Pumukit\SchemaBundle\Document\Person;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
Expand Down Expand Up @@ -102,7 +103,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\Person::class,
'data_class' => Person::class,
]
);

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/PlaylistType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Pumukit\NewAdminBundle\Form\Type\Base\TextareaI18nType;
use Pumukit\NewAdminBundle\Form\Type\Base\TextI18nAdvanceType;
use Pumukit\NewAdminBundle\Form\Type\Base\TextI18nType;
use Pumukit\SchemaBundle\Document\Series;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
Expand Down Expand Up @@ -55,7 +56,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\Series::class,
'data_class' => Series::class,
]
);

Expand Down
3 changes: 2 additions & 1 deletion src/Pumukit/NewAdminBundle/Form/Type/RoleType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Pumukit\NewAdminBundle\Form\Type\Base\TextareaI18nType;
use Pumukit\NewAdminBundle\Form\Type\Base\TextI18nType;
use Pumukit\SchemaBundle\Document\Role;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
Expand Down Expand Up @@ -83,7 +84,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => \Pumukit\SchemaBundle\Document\Role::class,
'data_class' => Role::class,
]
);

Expand Down
Loading

0 comments on commit d87c07c

Please sign in to comment.