Skip to content
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

Add DI for Main controller, providers and processors #817

Merged
merged 17 commits into from
Jan 26, 2024

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Dec 8, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
License MIT

On browsing resources
Capture d’écran de 2023-12-15 16-02-41

On creating a new resource
Capture d’écran de 2023-12-15 16-03-18

On invalid creation
Capture d’écran de 2023-12-15 16-04-16

On deleting a single resource
Capture d’écran de 2023-12-15 16-05-01

On delete multiple resources
Capture d’écran de 2023-12-15 16-00-59

@loic425 loic425 requested a review from a team as a code owner December 8, 2023 16:31
@loic425 loic425 marked this pull request as draft December 8, 2023 16:31
@loic425 loic425 force-pushed the poc-main-controller branch 2 times, most recently from 2c28a3c to 22ed7e1 Compare December 13, 2023 15:59
@loic425
Copy link
Member Author

loic425 commented Dec 15, 2023

Thx @Prometee That's a draft and I need that to debug ;) Of course I will remove these dump methods when it will be ready to review, but I think I will split that into few smaller PRs.


public function __invoke(Request $request): Response
{
$operation = $this->operationInitiator->initializeOperation($request);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On side note,

image

---         /** @var string|null $operationName */
---        $operationName = $request->attributes->get('_route');
+++        $operationName = $request->attributes->getString('_route', null);

lchrusciel added a commit that referenced this pull request Dec 18, 2023
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes (but on non-released feature)
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
| License         | MIT

Extracted from #817

Commits
-------

f0ec95e Fix serialize processor
lchrusciel added a commit that referenced this pull request Dec 18, 2023
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes (but on non-released feature)
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
| License         | MIT

Extracted from #817

Commits
-------

2827646 Fix flash processor
lchrusciel added a commit that referenced this pull request Dec 18, 2023
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes (but on non-released feature)
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
| License         | MIT

Extracted from #817

Commits
-------

460da65 Fix event dispatcher provider
@loic425 loic425 force-pushed the poc-main-controller branch 2 times, most recently from 10b6eb6 to 32a1fe7 Compare December 18, 2023 12:25
@loic425 loic425 force-pushed the poc-main-controller branch from a8283e5 to b6ed881 Compare January 26, 2024 08:46
Comment on lines +15 to +19
<imports>
<import resource="state/processor.xml" />
<import resource="state/provider.xml" />
<import resource="state/**/*.xml" />
</imports>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a small thing, but I suggested removing these imports and add a generic one to services.xml

@GSadee GSadee merged commit 8b66f13 into Sylius:1.11 Jan 26, 2024
24 checks passed
@GSadee
Copy link
Member

GSadee commented Jan 26, 2024

Thanks, Loïc! 🎉

@loic425 loic425 deleted the poc-main-controller branch January 26, 2024 10:51
GSadee pushed a commit to Sylius/Resource that referenced this pull request Feb 2, 2024
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes (but on non-released feature)
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
| License         | MIT

Extracted from Sylius/SyliusResourceBundle#817

Commits
-------

f0ec95ecdabcabf7a1ee0b3e7792a4c381f18c3c Fix serialize processor
GSadee pushed a commit to Sylius/Resource that referenced this pull request Feb 2, 2024
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes (but on non-released feature)
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
| License         | MIT

Extracted from Sylius/SyliusResourceBundle#817

Commits
-------

282764628d4f295ede138d628d9150f3feeef036 Fix flash processor
GSadee pushed a commit to Sylius/Resource that referenced this pull request Feb 2, 2024
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes (but on non-released feature)
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
| License         | MIT

Extracted from Sylius/SyliusResourceBundle#817

Commits
-------

460da65f30972475a0188ecc388c85b37563b824 Fix event dispatcher provider
GSadee pushed a commit to Sylius/Resource that referenced this pull request Feb 2, 2024
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | 
| License         | MIT

Extracted from Sylius/SyliusResourceBundle#817

Commits
-------

b6986256b184f895dc449c4af62cf646f64334b3 Add main controller
750260a524ab4d4cf123fbdf99de09b3c0340d3b Add PHPUnit tests
93857ed17b81dcddba560380aff9217657c0d765 Use a new Runtime exception
GSadee pushed a commit to Sylius/Resource that referenced this pull request Feb 2, 2024
…r (loic425)

This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | 
| License         | MIT

Extracted from Sylius/SyliusResourceBundle#817

Commits
-------

ca8c216629206c415c71d3c23096bc7351c2add7 Replace  by  into bulk aware processor
GSadee pushed a commit to Sylius/Resource that referenced this pull request Feb 2, 2024
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes (but on non-released feature)
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
| License         | MIT

Extracted from Sylius/SyliusResourceBundle#817

Commits
-------

dc9eed2489588eaa2255c2201d95f2acd19e7b73 Fix respond processor
GSadee pushed a commit to Sylius/Resource that referenced this pull request Feb 2, 2024
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets |
| License         | MIT

Extracted from Sylius/SyliusResourceBundle#817
It was PreEventDispatcherProcessor but I think it's a better name now.

I've decided to split https://github.com/Sylius/SyliusResourceBundle/blob/1.11/src/Component/src/State/Processor/EventDispatcherProcessor.php into two processors, so this one is the first part of the split.

This processor allows user switching from resource controller to this new system easily.
But we will be able to deprecate this event in the future.


Commits
-------

e87b8863a5870e40462cb3f77fcefb3a347d72c4 Dispatch pre write event processor
62fa18f5d5705399bada3e798f2852171ba1a3d7 Rename a test
GSadee pushed a commit to Sylius/Resource that referenced this pull request Feb 2, 2024
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | 
| License         | MIT

Extracted from Sylius/SyliusResourceBundle#817

Commits
-------

09320aa4d2928d1b40d825fba1cb194a424812ee Write processor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants