-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1951 from tomudding/chore/move-to-factories
chore: move everything to factories
- Loading branch information
Showing
162 changed files
with
2,939 additions
and
1,703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
module/Activity/src/Command/Factory/CalendarNotifyFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Activity\Command\Factory; | ||
|
||
use Activity\Command\CalendarNotify; | ||
use Activity\Service\ActivityCalendar as ActivityCalendarService; | ||
use Laminas\ServiceManager\Factory\FactoryInterface; | ||
use Psr\Container\ContainerInterface; | ||
|
||
class CalendarNotifyFactory implements FactoryInterface | ||
{ | ||
/** | ||
* @param string $requestedName | ||
*/ | ||
public function __invoke( | ||
ContainerInterface $container, | ||
$requestedName, | ||
?array $options = null, | ||
): CalendarNotify { | ||
return new CalendarNotify($container->get(ActivityCalendarService::class)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
module/Activity/src/Form/Factory/ActivityCalendarOptionFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Activity\Form\Factory; | ||
|
||
use Activity\Form\ActivityCalendarOption as ActivityCalendarOptionForm; | ||
use Activity\Service\ActivityCalendarForm as ActivityCalendarFormService; | ||
use Laminas\Mvc\I18n\Translator as MvcTranslator; | ||
use Laminas\ServiceManager\Factory\FactoryInterface; | ||
use Psr\Container\ContainerInterface; | ||
|
||
class ActivityCalendarOptionFactory implements FactoryInterface | ||
{ | ||
/** | ||
* @param string $requestedName | ||
*/ | ||
public function __invoke( | ||
ContainerInterface $container, | ||
$requestedName, | ||
?array $options = null, | ||
): ActivityCalendarOptionForm { | ||
return new ActivityCalendarOptionForm( | ||
$container->get(MvcTranslator::class), | ||
$container->get(ActivityCalendarFormService::class), | ||
); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
module/Activity/src/Form/Factory/ActivityCalendarProposalFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Activity\Form\Factory; | ||
|
||
use Activity\Form\ActivityCalendarProposal as ActivityCalendarProposalForm; | ||
use Activity\Service\AclService; | ||
use Activity\Service\ActivityCalendarForm as ActivityCalendarFormService; | ||
use Laminas\Mvc\I18n\Translator as MvcTranslator; | ||
use Laminas\ServiceManager\Factory\FactoryInterface; | ||
use Psr\Container\ContainerInterface; | ||
|
||
class ActivityCalendarProposalFactory implements FactoryInterface | ||
{ | ||
/** | ||
* @param string $requestedName | ||
*/ | ||
public function __invoke( | ||
ContainerInterface $container, | ||
$requestedName, | ||
?array $options = null, | ||
): ActivityCalendarProposalForm { | ||
return new ActivityCalendarProposalForm( | ||
$container->get(MvcTranslator::class), | ||
$container->get(ActivityCalendarFormService::class), | ||
$container->get(AclService::class)->isAllowed('create_always', 'activity'), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Activity\Form\Factory; | ||
|
||
use Activity\Form\Activity as ActivityForm; | ||
use Laminas\Mvc\I18n\Translator as MvcTranslator; | ||
use Laminas\ServiceManager\Factory\FactoryInterface; | ||
use Psr\Container\ContainerInterface; | ||
|
||
class ActivityFactory implements FactoryInterface | ||
{ | ||
/** | ||
* @param string $requestedName | ||
*/ | ||
public function __invoke( | ||
ContainerInterface $container, | ||
$requestedName, | ||
?array $options = null, | ||
): ActivityForm { | ||
$form = new ActivityForm($container->get(MvcTranslator::class)); | ||
$form->setHydrator($container->get('activity_hydrator')); | ||
|
||
return $form; | ||
} | ||
} |
Oops, something went wrong.