-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Poc rebased #718
Poc rebased #718
Conversation
loic425
commented
Jun 21, 2023
Q | A |
---|---|
Bug fix? | no/yes |
New feature? | no/yes |
BC breaks? | no/yes |
Deprecations? | no/yes |
Related tickets | fixes #X, partially #Y, mentioned in #Z |
License | MIT |
Co-authored-by: Łukasz Chruściel <lchrusciel@gmail.com>
This PR was merged into the poc-rebased branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT Based on #714 Commits ------- 673b2d2 Fix Debug resource commnd test 37ddf17 Skip running Phpspec on PHP 8.2
This PR was merged into the poc-rebased branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | no/yes | New feature? | no/yes | BC breaks? | no/yes | Deprecations? | no/yes <!-- don't forget to update the UPGRADE-*.md file --> | Related tickets | fixes #X, partially #Y, mentioned in #Z | License | MIT Commits ------- d29d514 [Maintenance] Update the copyright block in all PHP classes bcf4e4e [Maintenance] Update the copyright block in all XML files 8b2b512 [Maintenance] Update the copyright block in all YML files 39b8e1e [Maintenance] Update the copyright and dates in the LICENSE files
Revert "Update licence"
This PR was merged into the poc-rebased branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Related tickets | fixes #686 | License | MIT Commits ------- a8dec75 [New docs] Configure the resource name 8100200 Add item on table of contents 0c54190 Reapply missing commit
Co-authored-by: Mateusz Zalewski <zaleslaw@gmail.com>
This PR was merged into the poc-rebased branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Related tickets | fixes #688 | License | MIT Commits ------- 0dbec8d [New docs] Configure the resource plural name 5080334 Apply suggestions from code review
This PR was merged into the poc-rebased branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT [Preview](https://github.com/Sylius/SyliusResourceBundle/blob/8bdb41f96799c19a6832bdc1b2f50c24e70f82ba/docs/index.md) Commits ------- 7355dfd [New docs] docs' pagination 22599aa Fix next page on configure your operations to redirect 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.
Obviously, it was impossible to review it fully, but it was already reviewed in partial PRs so it seems as be ready to merge 🖖
@@ -1,3 +1,19 @@ | |||
## UPGRADE FOR `1.11.x` | |||
|
|||
### FROM `1.10.x` to `1.11.x` |
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.
It would be probably wise to test this upgrade before (or just after) merge on some real project (Monfony? 😅), as it's very suspicious it needs only one thing to be changed 😄
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.
truth been told, there are chances that this is the only needed change as we wanted to be backward compatible 🎉
$this->registerWinzouStateMachine($container); | ||
$this->registerSymfonyWorkflowStateMachine($container); |
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.
It the same as two lines below 🤔
$container->setDefinition($metadata->getServiceId('factory'), $definition) | ||
->addTag('sylius.resource_factory') | ||
; |
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.
$container->setDefinition($metadata->getServiceId('factory'), $definition) | |
->addTag('sylius.resource_factory') | |
; | |
$container | |
->setDefinition($metadata->getServiceId('factory'), $definition) | |
->addTag('sylius.resource_factory') | |
; |
?
$container->registerForAutoconfiguration(ProviderInterface::class) | ||
->addTag('sylius.state_provider') | ||
; |
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.
$container->registerForAutoconfiguration(ProviderInterface::class) | |
->addTag('sylius.state_provider') | |
; | |
$container | |
->registerForAutoconfiguration(ProviderInterface::class) | |
->addTag('sylius.state_provider') | |
; |
or
$container->registerForAutoconfiguration(ProviderInterface::class) | |
->addTag('sylius.state_provider') | |
; | |
$container->registerForAutoconfiguration(ProviderInterface::class)->addTag('sylius.state_provider'); |
if it fits the line characters limit 💃
I know I'm meticulous, but it's what makes Sylius Sylius xD
@@ -39,6 +39,8 @@ final class SyliusResourceBundle extends Bundle | |||
|
|||
public const DRIVER_DOCTRINE_PHPCR_ODM = 'doctrine/phpcr-odm'; | |||
|
|||
public const NO_DRIVER = false; |
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.
It seems to not be used anywhere
if (str_contains($resource, '.')) { | ||
$metadata = $this->resourceRegistry->get($resource); | ||
} else { | ||
$metadata = $this->resourceRegistry->getByClass($resource); | ||
} |
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.
There are a few places where this if-else statement is repeated - probably a space for some ResourceMetadataProvider
💃
use Sylius\Component\Resource\Symfony\Request\State\Responder; | ||
use Sylius\Component\Resource\Symfony\Routing\Factory\OperationRouteNameFactory; | ||
|
||
final class AttributesResourceMetadataCollectionFactory implements ResourceMetadataCollectionFactoryInterface |
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.
Let's obviously leave it as it is right now, but we should think about some refactoring of this class - its spec has almost 1000 lines of code 😅
$request = $context->get(RequestOption::class)?->request(); | ||
|
||
if ( | ||
'html' === $request?->getRequestFormat() && |
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.
Let's avoid hardcoding strings in the code and use a private constant here
if ( | ||
null === $operation | ||
) { |
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.
if ( | |
null === $operation | |
) { | |
if (null === $operation) | |
{ |
💃
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpKernel\Event\ViewEvent; | ||
|
||
final class FormListener |
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.
There is not spec for this file, as far as I see
Thx a lot for this huge review. I'll male the change this morning. |
@@ -1,3 +1,19 @@ | |||
## UPGRADE FOR `1.11.x` | |||
|
|||
### FROM `1.10.x` to `1.11.x` |
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.
truth been told, there are chances that this is the only needed change as we wanted to be backward compatible 🎉
Thank you, @loic425! |