From 291d6e3c10382da439b7907fae1880bf144119e5 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 23 Jun 2020 14:15:39 +0200 Subject: [PATCH] Minor - format code --- README.md | 2 +- src/CoreBundle/Controller/CreateResourceNodeFileAction.php | 2 +- src/CoreBundle/Entity/AbstractResource.php | 1 - src/CoreBundle/Entity/Listener/ResourceListener.php | 1 - src/CoreBundle/Entity/ResourceLink.php | 2 -- src/CoreBundle/Entity/ResourceNode.php | 2 +- src/CoreBundle/Security/HTTPExceptionListener.php | 2 +- 7 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 736791cb6e..4ea42d78f8 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ chmod -R 777 . Then enter the main/install/index.php and follow the UI instructions (database, admin user settings, etc). -After the web install process, change the permissions back to a reasonnably safe state: +After the web install process, change the permissions back to a reasonably safe state: ~~~~ chmod -R 755 . chown -R www-data: public/ var/ diff --git a/src/CoreBundle/Controller/CreateResourceNodeFileAction.php b/src/CoreBundle/Controller/CreateResourceNodeFileAction.php index a7f63d6923..8e958ce61e 100644 --- a/src/CoreBundle/Controller/CreateResourceNodeFileAction.php +++ b/src/CoreBundle/Controller/CreateResourceNodeFileAction.php @@ -51,7 +51,7 @@ class CreateResourceNodeFileAction if ($request->request->has('resourceLinkList')) { $links = $request->get('resourceLinkList'); - if (strpos($links, '[') === false) { + if (false === strpos($links, '[')) { $links = json_decode('['.$links.']', true); } else { $links = json_decode($links, true); diff --git a/src/CoreBundle/Entity/AbstractResource.php b/src/CoreBundle/Entity/AbstractResource.php index 3bb93c0d6d..f25f43dc76 100644 --- a/src/CoreBundle/Entity/AbstractResource.php +++ b/src/CoreBundle/Entity/AbstractResource.php @@ -9,7 +9,6 @@ use ApiPlatform\Core\Annotation\ApiSubresource; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Serializer\Annotation\MaxDepth; use Symfony\Component\Validator\Constraints as Assert; /** diff --git a/src/CoreBundle/Entity/Listener/ResourceListener.php b/src/CoreBundle/Entity/Listener/ResourceListener.php index fd4c59f56e..8154087c4e 100644 --- a/src/CoreBundle/Entity/Listener/ResourceListener.php +++ b/src/CoreBundle/Entity/Listener/ResourceListener.php @@ -157,7 +157,6 @@ class ResourceListener fwrite($handle, $content); $meta = stream_get_meta_data($handle); $uploadedFile = new UploadedFile($meta['uri'], $title, 'text/html', null, true); - } // File upload diff --git a/src/CoreBundle/Entity/ResourceLink.php b/src/CoreBundle/Entity/ResourceLink.php index 9b87d9830c..d144c1d5f3 100644 --- a/src/CoreBundle/Entity/ResourceLink.php +++ b/src/CoreBundle/Entity/ResourceLink.php @@ -48,14 +48,12 @@ class ResourceLink protected $session; /** - * * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User") * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true) */ protected $user; /** - * * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CGroupInfo") * @ORM\JoinColumn(name="group_id", referencedColumnName="iid", nullable=true, onDelete="CASCADE") */ diff --git a/src/CoreBundle/Entity/ResourceNode.php b/src/CoreBundle/Entity/ResourceNode.php index 223a2299bd..30d30db72c 100644 --- a/src/CoreBundle/Entity/ResourceNode.php +++ b/src/CoreBundle/Entity/ResourceNode.php @@ -5,7 +5,6 @@ namespace Chamilo\CoreBundle\Entity; use ApiPlatform\Core\Annotation\ApiFilter; -use ApiPlatform\Core\Annotation\ApiProperty; use ApiPlatform\Core\Annotation\ApiResource; use ApiPlatform\Core\Annotation\ApiSubresource; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter; @@ -78,6 +77,7 @@ class ResourceNode /** * @ApiSubresource() + * * @var ResourceLink[] * * @ORM\OneToMany(targetEntity="ResourceLink", mappedBy="resourceNode", cascade={"persist", "remove"}) diff --git a/src/CoreBundle/Security/HTTPExceptionListener.php b/src/CoreBundle/Security/HTTPExceptionListener.php index 58e7730e6f..1ffeecb9aa 100644 --- a/src/CoreBundle/Security/HTTPExceptionListener.php +++ b/src/CoreBundle/Security/HTTPExceptionListener.php @@ -13,7 +13,7 @@ final class HTTPExceptionListener public function onKernelException(ExceptionEvent $event): void { $exception = $event->getThrowable(); - if (! ($exception instanceof HttpException) || strpos($event->getRequest()->getRequestUri(), '/api/') === false) { + if (!($exception instanceof HttpException) || false === strpos($event->getRequest()->getRequestUri(), '/api/')) { return; }