Skip to content

Commit

Permalink
stict_types=1
Browse files Browse the repository at this point in the history
  • Loading branch information
manuxi committed Apr 2, 2021
1 parent 50c0568 commit 037fb06
Show file tree
Hide file tree
Showing 54 changed files with 131 additions and 35 deletions.
2 changes: 2 additions & 0 deletions src/Admin/Helper/WebspaceSelector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Admin\Helper;

use Sulu\Component\Webspace\Manager\WebspaceManagerInterface;
Expand Down
2 changes: 0 additions & 2 deletions src/Common/DoctrineListRepresentationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
class DoctrineListRepresentationFactory
{
private $restHelper;

private $listBuilderFactory;

private $fieldDescriptorFactory;

public function __construct(
Expand Down
1 change: 0 additions & 1 deletion src/Content/EventSelectionContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

class EventSelectionContentType extends SimpleContentType
{

private $eventRepository;

public function __construct(EventRepository $eventRepository)
Expand Down
2 changes: 0 additions & 2 deletions src/Controller/Admin/LocationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Manuxi\SuluEventBundle\Common\DoctrineListRepresentationFactory;
use Manuxi\SuluEventBundle\Entity\Location;
use Manuxi\SuluEventBundle\Entity\Models\LocationModel;
use Manuxi\SuluEventBundle\Repository\LocationRepository;
use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException;
use FOS\RestBundle\Controller\Annotations\RouteResource;
Expand All @@ -17,7 +16,6 @@
use Sulu\Component\Rest\Exception\EntityNotFoundException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/Website/AbstractController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Controller\Website;

use Sulu\Bundle\HttpCacheBundle\Cache\SuluHttpCache;
Expand Down
20 changes: 12 additions & 8 deletions src/Controller/Website/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace Manuxi\SuluEventBundle\Controller\Website;

use JMS\Serializer\SerializerBuilder;
use Manuxi\SuluEventBundle\Entity\Event;
use Manuxi\SuluEventBundle\Repository\EventRepository;
use JMS\Serializer\SerializerBuilder;
use Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface;
use Sulu\Bundle\RouteBundle\Entity\RouteRepositoryInterface;
use Sulu\Bundle\WebsiteBundle\Resolver\TemplateAttributeResolverInterface;
Expand Down Expand Up @@ -41,6 +41,9 @@ public function __construct(
$this->routeRepository = $routeRepository;
}

/**
* @throws \Exception
*/
public function indexAction(Event $event, string $view = 'pages/event', bool $preview = false, bool $partial = false): Response
{
$requestFormat = $this->request->getRequestFormat();
Expand Down Expand Up @@ -95,13 +98,14 @@ private function extractExtension(Event $event): array
*/
public static function getSubscribedServices()
{
$subscribedServices = parent::getSubscribedServices();

$subscribedServices['sulu_core.webspace.webspace_manager'] = WebspaceManagerInterface::class;
$subscribedServices['sulu.repository.route'] = RouteRepositoryInterface::class;
$subscribedServices['sulu_website.resolver.template_attribute'] = TemplateAttributeResolverInterface::class;

return $subscribedServices;
return array_merge(
parent::getSubscribedServices(),
[
WebspaceManagerInterface::class,
RouteRepositoryInterface::class,
TemplateAttributeResolverInterface::class,
]
);
}

}
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\DependencyInjection;

use Manuxi\SuluEventBundle\Entity\Event;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/SuluEventExtension.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\DependencyInjection;

use Manuxi\SuluEventBundle\Admin\EventAdmin;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/EventExcerpt.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/EventExcerptTranslation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/EventSeo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
Expand Down
4 changes: 3 additions & 1 deletion src/Entity/Interfaces/AuditableInterface.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Sulu\Component\Persistence\Model\TimestampableInterface;
use Sulu\Component\Persistence\Model\UserBlameInterface;

/**
* Composite interface of TimestampableInterface and UserBlameInterface.
* Composite interface of TimestampableInterface, AuthoredInterface, UserBlameInterface and AuthorInterface.
*/
interface AuditableInterface extends TimestampableInterface, AuthoredInterface, UserBlameInterface, AuthorInterface
{
Expand Down
5 changes: 4 additions & 1 deletion src/Entity/Interfaces/AuditableTranslationInterface.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

/**
* Composite interface of TimestampableTranslationInterface and UserBlameTranslationInterface.
* Composite interface of TimestampableTranslationInterface, AuthoredTranslationInterface,
* UserBlameTranslationInterface and AuthorTranslationInterface.
*/
interface AuditableTranslationInterface extends TimestampableTranslationInterface, AuthoredTranslationInterface, UserBlameTranslationInterface, AuthorTranslationInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/AuthorInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Sulu\Component\Security\Authentication\UserInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/AuthorTranslationInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Sulu\Component\Security\Authentication\UserInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/AuthoredInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

interface AuthoredInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/AuthoredTranslationInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

interface AuthoredTranslationInterface
Expand Down
8 changes: 0 additions & 8 deletions src/Entity/Interfaces/EventExcerptInterface.php

This file was deleted.

13 changes: 13 additions & 0 deletions src/Entity/Interfaces/EventExcerptModelInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Manuxi\SuluEventBundle\Entity\EventExcerpt;
use Symfony\Component\HttpFoundation\Request;

interface EventExcerptModelInterface
{
public function updateEventExcerpt(EventExcerpt $eventExcerpt, Request $request): EventExcerpt;
}
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/EventModelInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Manuxi\SuluEventBundle\Entity\Event;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Manuxi\SuluEventBundle\Entity\EventSeo;
use Symfony\Component\HttpFoundation\Request;

interface EventSeoInterface
interface EventSeoModelInterface
{
public function updateEventSeo(EventSeo $eventSeo, Request $request): EventSeo;
}
5 changes: 3 additions & 2 deletions src/Entity/Interfaces/ExcerptInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;


interface ExcerptInterface
{

public function getId(): ?int;
public function setId(?int $id);
}
3 changes: 2 additions & 1 deletion src/Entity/Interfaces/ExcerptTranslatableInterface.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Doctrine\Common\Collections\Collection;
use Sulu\Bundle\CategoryBundle\Entity\CategoryInterface;
use Sulu\Bundle\MediaBundle\Entity\MediaInterface;
use Sulu\Bundle\TagBundle\Tag\TagInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/ExcerptTranslationInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Doctrine\Common\Collections\Collection;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/LocationModelInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Manuxi\SuluEventBundle\Entity\Location;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/SeoInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

interface SeoInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/SeoTranslatableInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

interface SeoTranslatableInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/SeoTranslationInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

interface SeoTranslationInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/TimestampableTranslationInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

interface TimestampableTranslationInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Interfaces/UserBlameTranslationInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Interfaces;

use Sulu\Component\Security\Authentication\UserInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Location.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity;

use Manuxi\SuluEventBundle\Repository\LocationRepository;
Expand Down
6 changes: 4 additions & 2 deletions src/Entity/Models/EventExcerptModel.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Models;

use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException;
use Manuxi\SuluEventBundle\Entity\EventExcerpt;
use Manuxi\SuluEventBundle\Entity\Interfaces\EventExcerptInterface;
use Manuxi\SuluEventBundle\Entity\Interfaces\EventExcerptModelInterface;
use Manuxi\SuluEventBundle\Entity\Traits\ArrayPropertyTrait;
use Manuxi\SuluEventBundle\Repository\EventExcerptRepository;
use Sulu\Bundle\CategoryBundle\Category\CategoryManagerInterface;
Expand All @@ -14,7 +16,7 @@
use Sulu\Component\Rest\Exception\EntityNotFoundException;
use Symfony\Component\HttpFoundation\Request;

class EventExcerptModel implements EventExcerptInterface
class EventExcerptModel implements EventExcerptModelInterface
{
use ArrayPropertyTrait;

Expand Down
6 changes: 4 additions & 2 deletions src/Entity/Models/EventSeoModel.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Models;

use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException;
use Manuxi\SuluEventBundle\Entity\EventSeo;
use Manuxi\SuluEventBundle\Entity\Interfaces\EventSeoInterface;
use Manuxi\SuluEventBundle\Entity\Interfaces\EventSeoModelInterface;
use Manuxi\SuluEventBundle\Entity\Traits\ArrayPropertyTrait;
use Manuxi\SuluEventBundle\Repository\EventSeoRepository;
use Symfony\Component\HttpFoundation\Request;

class EventSeoModel implements EventSeoInterface
class EventSeoModel implements EventSeoModelInterface
{
use ArrayPropertyTrait;

Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Models/LocationModel.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Models;

use Doctrine\ORM\OptimisticLockException;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Traits/AuditableTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Traits;

use Sulu\Component\Persistence\Model\TimestampableTrait;
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/Traits/AuditableTranslationTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Manuxi\SuluEventBundle\Entity\Traits;

trait AuditableTranslationTrait
Expand Down
Loading

0 comments on commit 037fb06

Please sign in to comment.