add interface for factories

This commit is contained in:
Simon Vieille 2021-05-12 10:17:39 +02:00
parent 75ba9ec32d
commit 5e11baf6fb
6 changed files with 10 additions and 6 deletions

View file

@ -9,7 +9,7 @@ use App\Core\Entity\Setting;
* *
* @author Simon Vieille <simon@deblan.fr> * @author Simon Vieille <simon@deblan.fr>
*/ */
class SettingFactory class SettingFactory implements FactoryInterface
{ {
public function create(string $code): Setting public function create(string $code): Setting
{ {

View file

@ -4,13 +4,14 @@ namespace App\Core\Factory\Site;
use App\Core\Entity\Site\Menu; use App\Core\Entity\Site\Menu;
use App\Core\Entity\Site\Navigation; use App\Core\Entity\Site\Navigation;
use App\Core\Factory\FactoryInterface;
/** /**
* class MenuFactory. * class MenuFactory.
* *
* @author Simon Vieille <simon@deblan.fr> * @author Simon Vieille <simon@deblan.fr>
*/ */
class MenuFactory class MenuFactory implements FactoryInterface
{ {
public function create(?Navigation $navigation = null): Menu public function create(?Navigation $navigation = null): Menu
{ {

View file

@ -3,13 +3,14 @@
namespace App\Core\Factory\Site; namespace App\Core\Factory\Site;
use App\Core\Entity\Site\Navigation; use App\Core\Entity\Site\Navigation;
use App\Core\Factory\FactoryInterface;
/** /**
* class NavigationFactory. * class NavigationFactory.
* *
* @author Simon Vieille <simon@deblan.fr> * @author Simon Vieille <simon@deblan.fr>
*/ */
class NavigationFactory class NavigationFactory implements FactoryInterface
{ {
public function create(): Navigation public function create(): Navigation
{ {

View file

@ -4,13 +4,14 @@ namespace App\Core\Factory\Site;
use App\Core\Entity\Site\Menu; use App\Core\Entity\Site\Menu;
use App\Core\Entity\Site\Node; use App\Core\Entity\Site\Node;
use App\Core\Factory\FactoryInterface;
/** /**
* class NodeFactory. * class NodeFactory.
* *
* @author Simon Vieille <simon@deblan.fr> * @author Simon Vieille <simon@deblan.fr>
*/ */
class NodeFactory class NodeFactory implements FactoryInterface
{ {
public function create(?Menu $menu = null, string $url = null): Node public function create(?Menu $menu = null, string $url = null): Node
{ {

View file

@ -3,13 +3,14 @@
namespace App\Core\Factory\Site\Page; namespace App\Core\Factory\Site\Page;
use App\Core\Entity\Site\Page\Page; use App\Core\Entity\Site\Page\Page;
use App\Core\Factory\FactoryInterface;
/** /**
* class PageFactory. * class PageFactory.
* *
* @author Simon Vieille <simon@deblan.fr> * @author Simon Vieille <simon@deblan.fr>
*/ */
class PageFactory class PageFactory implements FactoryInterface
{ {
public function create(string $className, string $name): Page public function create(string $className, string $name): Page
{ {

View file

@ -11,7 +11,7 @@ use Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface;
* *
* @author Simon Vieille <simon@deblan.fr> * @author Simon Vieille <simon@deblan.fr>
*/ */
class UserFactory class UserFactory implements FactoryInterface
{ {
protected TokenGeneratorInterface $tokenGenerator; protected TokenGeneratorInterface $tokenGenerator;
protected UserPasswordEncoderInterface $encoder; protected UserPasswordEncoderInterface $encoder;