-
-
Notifications
You must be signed in to change notification settings - Fork 168
PoC PHP file resource metadata factory #983
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
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
684ef61
Add resource name collection
loic425 59ffdae
Init resource name collection factory with attributes
loic425 444010d
Add Resource Route Collection Factory
loic425 d00a2c0
Use Repository managed by Doctrine
loic425 f346d43
Apply suggestions from code review
loic425 69d39f1
Add Operation defaults trait
loic425 d90f4ee
PoC PHP file resource metadata factory
loic425 adc137c
Add route requirements
loic425 3992255
Apply suggestions from code review
loic425 a0dd5eb
Fix missing route name on operations attributes
loic425 4530671
Custom notification message
loic425 e979ac1
Handle custom operations
loic425 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
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
36 changes: 36 additions & 0 deletions
36
src/Bundle/Resources/config/services/metadata/resource_name.xml
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,36 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <!-- | ||
|
|
||
| This file is part of the Sylius package. | ||
|
|
||
| (c) Sylius Sp. z o.o. | ||
|
|
||
| For the full copyright and license information, please view the LICENSE | ||
| file that was distributed with this source code. | ||
|
|
||
| --> | ||
|
|
||
| <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
| <services> | ||
| <service id="sylius_resource.metadata.resource.name_collection.factory" alias="sylius_resource.metadata.resource.name_collection.factory.attributes" /> | ||
| <service id="Sylius\Resource\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface" alias="sylius_resource.metadata.resource.name_collection.factory" /> | ||
|
|
||
| <service id="sylius_resource.metadata.resource.name_collection.factory.attributes" | ||
| class="Sylius\Resource\Metadata\Resource\Factory\AttributesResourceNameCollectionFactory" | ||
| > | ||
| <argument>%sylius.resource.mapping%</argument> | ||
| </service> | ||
| <service id="Sylius\Resource\Metadata\Resource\Factory\AttributesResourceNameCollectionFactory" alias="sylius_resource.metadata.resource.name_collection.factory.attributes" /> | ||
|
|
||
| <service id="sylius_resource.metadata.resource.name_collection.factory.php_file" | ||
| class="Sylius\Resource\Metadata\Resource\Factory\PhpFileResourceNameCollectionFactory" | ||
| decorates="sylius_resource.metadata.resource.name_collection.factory" | ||
| decoration-priority="100" | ||
| > | ||
| <argument type="service" id="sylius_resource.metadata.extractor.php_file" /> | ||
| <argument type="service" id=".inner" /> | ||
| </service> | ||
| <service id="Sylius\Resource\Metadata\Resource\Factory\PhpFileResourceMetadataCollectionFactory" alias="sylius_resource.metadata.resource.name_collection.factory.php_file" /> | ||
| </services> | ||
| </container> |
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,23 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <!-- | ||
|
|
||
| This file is part of the Sylius package. | ||
|
|
||
| (c) Sylius Sp. z o.o. | ||
|
|
||
| For the full copyright and license information, please view the LICENSE | ||
| file that was distributed with this source code. | ||
|
|
||
| --> | ||
|
|
||
| <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
| <services> | ||
| <service id="sylius_resource.symfony.routing.loader.resource" class="Sylius\Resource\Symfony\Routing\Loader\ResourceLoader"> | ||
| <argument type="service" id="sylius_resource.metadata.resource.name_collection.factory" /> | ||
| <argument type="service" id="sylius_resource.routing.resource.route_collection_factory" /> | ||
| <tag name="routing.route_loader" /> | ||
| </service> | ||
| <service id="Sylius\Resource\Symfony\Routing\Loader\ResourceLoader" alias="sylius_resource.symfony.routing.loader.resource" /> | ||
| </services> | ||
| </container> |
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,23 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <!-- | ||
|
|
||
| This file is part of the Sylius package. | ||
|
|
||
| (c) Sylius Sp. z o.o. | ||
|
|
||
| For the full copyright and license information, please view the LICENSE | ||
| file that was distributed with this source code. | ||
|
|
||
| --> | ||
|
|
||
| <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
| <services> | ||
| <service id="sylius_resource.routing.resource.route_collection_factory" class="Sylius\Resource\Symfony\Routing\Factory\Resource\ResourceRouteCollectionFactory"> | ||
| <argument type="service" id="sylius.routing.factory.operation_route" /> | ||
| <argument type="service" id="sylius.resource_metadata_collection.factory" /> | ||
| <argument type="service" id="sylius.resource_registry" /> | ||
| </service> | ||
| <service id="Sylius\Resource\Symfony\Routing\Factory\Resource\ResourceRouteCollectionFactoryInterface" alias="sylius_resource.routing.resource.route_collection_factory" /> | ||
| </services> | ||
| </container> |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new path ensures we do not load any files that are on Autoloader which cannot be include serveral times.
So here, we'll import config files (PHP ones).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting discussions there
api-platform/core#6943