-
Notifications
You must be signed in to change notification settings - Fork 249
Migrate Zend Framework integration to Laminas #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
loco8878
wants to merge
22
commits into
cocur:main
Choose a base branch
from
loco8878:pr/261
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
25fa0c4
Added first version of Laminas integration
JustInVTime 7fa8110
Merge remote-tracking branch 'origin/main' into pr/261
loco8878 6fde9b3
FIX wording in Readme
loco8878 f726a3c
Adjust tests
loco8878 0156fec
Fix and Enable skipped tests
loco8878 7ce0d69
Rework laminas module config
loco8878 8f1417c
Improve laminas config
loco8878 4714eff
Fix phpunit cover annotations
loco8878 0851ae4
Remove Zend Framework 2 integration from Readme
loco8878 0069f50
Remove superflous dev dependencies from composer.json
loco8878 5ca45b9
Remove FactoryInterface, use Psr\Container\ContainerInterface
loco8878 f3995af
Add extra laminas config to composer.json
loco8878 bf3a7c0
Remove superflous parameter from __invoke methods
loco8878 c8205db
Add laminas input filter
loco8878 7a2432e
Decrease laminas/laminas-inputfilter version, because of php version …
loco8878 a281592
Update README.md
loco8878 d534c6d
Update README.md
loco8878 21cebf0
Update README.md
loco8878 671b42d
Implement filter interface instead extend from abstract filter
loco8878 c86dc0f
Remove laminas-inputfilter, use laminas-filter instead
loco8878 714a400
Add filter config
loco8878 efdbbaf
Adjust readme, add laminas usage
loco8878 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,55 @@ | ||
| <?php | ||
|
|
||
| namespace Cocur\Slugify\Bridge\Laminas; | ||
|
|
||
| use Cocur\Slugify\Slugify; | ||
|
|
||
| class ConfigProvider | ||
| { | ||
| /** | ||
| * Retrieve laminas default configuration. | ||
| * | ||
| * @return array | ||
| */ | ||
| public function __invoke(): array | ||
| { | ||
| return [ | ||
| 'dependencies' => $this->getDependencyConfig(), | ||
| 'view_helpers' => $this->getViewHelperConfig(), | ||
| ]; | ||
loco8878 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /** | ||
| * Retrieve laminas default dependency configuration. | ||
| * | ||
| * @return array | ||
| */ | ||
| public function getDependencyConfig(): array | ||
| { | ||
| return [ | ||
| 'factories' => [ | ||
| Slugify::class => SlugifyService::class, | ||
| ], | ||
| 'aliases' => [ | ||
| 'slugify' => Slugify::class, | ||
| ] | ||
| ]; | ||
| } | ||
|
|
||
loco8878 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * Retrieve laminas view helper dependency configuration. | ||
| * | ||
| * @return array | ||
| */ | ||
| public function getViewHelperConfig(): array | ||
| { | ||
| return [ | ||
| 'aliases' => [ | ||
| 'slugify' => SlugifyViewHelper::class | ||
| ], | ||
| 'factories' => [ | ||
| SlugifyViewHelper::class => SlugifyViewHelperFactory::class | ||
| ] | ||
| ]; | ||
| } | ||
| } | ||
This file contains hidden or 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 | ||
|
|
||
| namespace Cocur\Slugify\Bridge\Laminas; | ||
|
|
||
| /** | ||
| * Class Module | ||
| * @package cocur/slugify | ||
| * @subpackage bridge | ||
| * @license http://www.opensource.org/licenses/MIT The MIT License | ||
| */ | ||
| class Module | ||
| { | ||
| public const CONFIG_KEY = 'cocur_slugify'; | ||
|
|
||
| public function getConfig(): array | ||
| { | ||
| $provider = new ConfigProvider(); | ||
| $config = $provider(); | ||
| $config['service_manager'] = $config['dependencies']; | ||
| unset($config['dependencies']); | ||
|
|
||
| return $config; | ||
| } | ||
| } |
This file contains hidden or 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,35 @@ | ||
| <?php | ||
|
|
||
| namespace Cocur\Slugify\Bridge\Laminas; | ||
|
|
||
| use Cocur\Slugify\Slugify; | ||
| use Interop\Container\ContainerInterface; | ||
| use Laminas\ServiceManager\Factory\FactoryInterface; | ||
|
|
||
| /** | ||
| * Class SlugifyService | ||
| * @package cocur/slugify | ||
| * @subpackage bridge | ||
| * @license http://www.opensource.org/licenses/MIT The MIT License | ||
| */ | ||
| class SlugifyService implements FactoryInterface | ||
loco8878 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| /** | ||
| * @param ContainerInterface $container | ||
| * @param $requestedName | ||
| * @param array|null $options | ||
| * @return Slugify | ||
| * @throws \Psr\Container\ContainerExceptionInterface | ||
| * @throws \Psr\Container\NotFoundExceptionInterface | ||
| */ | ||
| public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): Slugify | ||
loco8878 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| $config = $container->get('Config'); | ||
|
|
||
| $slugifyOptions = $config[Module::CONFIG_KEY]['options'] ?? []; | ||
| $provider = $config[Module::CONFIG_KEY]['provider'] ?? null; | ||
|
|
||
| return new Slugify($slugifyOptions, $provider); | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or 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 hidden or 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,32 @@ | ||
| <?php | ||
|
|
||
| namespace Cocur\Slugify\Bridge\Laminas; | ||
|
|
||
| use Interop\Container\ContainerInterface; | ||
| use Laminas\ServiceManager\Factory\FactoryInterface; | ||
|
|
||
| /** | ||
| * Class SlugifyViewHelperFactory | ||
| * @package cocur/slugify | ||
| * @subpackage bridge | ||
| * @license http://www.opensource.org/licenses/MIT The MIT License | ||
| */ | ||
| class SlugifyViewHelperFactory implements FactoryInterface | ||
loco8878 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
|
|
||
| /** | ||
| * @param ContainerInterface $container | ||
| * @param $requestedName | ||
| * @param array|null $options | ||
| * @return SlugifyViewHelper | ||
| * @throws \Psr\Container\ContainerExceptionInterface | ||
| * @throws \Psr\Container\NotFoundExceptionInterface | ||
| */ | ||
| public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): SlugifyViewHelper | ||
loco8878 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| $slugify = $container->get('Cocur\Slugify\Slugify'); | ||
|
|
||
| return new SlugifyViewHelper($slugify); | ||
| } | ||
|
|
||
| } | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.