add interface for factories
This commit is contained in:
parent
75ba9ec32d
commit
5e11baf6fb
|
@ -9,7 +9,7 @@ use App\Core\Entity\Setting;
|
|||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class SettingFactory
|
||||
class SettingFactory implements FactoryInterface
|
||||
{
|
||||
public function create(string $code): Setting
|
||||
{
|
||||
|
|
|
@ -4,13 +4,14 @@ namespace App\Core\Factory\Site;
|
|||
|
||||
use App\Core\Entity\Site\Menu;
|
||||
use App\Core\Entity\Site\Navigation;
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
|
||||
/**
|
||||
* class MenuFactory.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class MenuFactory
|
||||
class MenuFactory implements FactoryInterface
|
||||
{
|
||||
public function create(?Navigation $navigation = null): Menu
|
||||
{
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
namespace App\Core\Factory\Site;
|
||||
|
||||
use App\Core\Entity\Site\Navigation;
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
|
||||
/**
|
||||
* class NavigationFactory.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class NavigationFactory
|
||||
class NavigationFactory implements FactoryInterface
|
||||
{
|
||||
public function create(): Navigation
|
||||
{
|
||||
|
|
|
@ -4,13 +4,14 @@ namespace App\Core\Factory\Site;
|
|||
|
||||
use App\Core\Entity\Site\Menu;
|
||||
use App\Core\Entity\Site\Node;
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
|
||||
/**
|
||||
* class NodeFactory.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class NodeFactory
|
||||
class NodeFactory implements FactoryInterface
|
||||
{
|
||||
public function create(?Menu $menu = null, string $url = null): Node
|
||||
{
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
namespace App\Core\Factory\Site\Page;
|
||||
|
||||
use App\Core\Entity\Site\Page\Page;
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
|
||||
/**
|
||||
* class PageFactory.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class PageFactory
|
||||
class PageFactory implements FactoryInterface
|
||||
{
|
||||
public function create(string $className, string $name): Page
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ use Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface;
|
|||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class UserFactory
|
||||
class UserFactory implements FactoryInterface
|
||||
{
|
||||
protected TokenGeneratorInterface $tokenGenerator;
|
||||
protected UserPasswordEncoderInterface $encoder;
|
||||
|
|
Loading…
Reference in a new issue