- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 163
 
feat(metadata) Customize Resource & operations #1055
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
base: 1.14
Are you sure you want to change the base?
Conversation
5898f27    to
    a6135b8      
    Compare
  
    f2a8714    to
    39d41d1      
    Compare
  
    | /** | ||
| * @internal | ||
| */ | ||
| final class OperationResourceMutatorCollection implements OperationMutatorCollectionInterface | 
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's Operation Mutator, but Operation Resource Mutator Collection -- how name was derived?
If resource part is necessary, should it be
--- OperationResourceMutatorCollection
+++ ResourceOperationMutatorCollectionlike so?
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.
I think this was an issue during name refactoring at some point. We should rename them on APIP too.
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.
I've fixed these 2 class names.
        
          
                src/Bundle/SyliusResourceBundle.php
              
                Outdated
          
        
      | $container->addCompilerPass(new FallbackToKernelDefaultLocalePass()); | ||
| $container->addCompilerPass(new DoctrineContainerRepositoryFactoryPass()); | ||
| $container->addCompilerPass(new DoctrineTargetEntitiesResolverPass(new TargetEntitiesResolver()), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1); | ||
| $container->addCompilerPass(new MutatorPass()); | 
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.
Mutator is not specific enough name when used outside of Sylius\Resource\Metadata dir.
For example,
| $container->addCompilerPass(new MutatorPass()); | |
| $container->addCompilerPass(new MetadataMutatorPass()); | 
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.
fixed
        
          
                src/Component/src/Metadata/Mutator/OperationMutatorCollectionInterface.php
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/Component/src/Metadata/Mutator/ResourceMutatorCollectionInterface.php
          
            Show resolved
            Hide resolved
        
      | /** | ||
| * @var Operation $operation | ||
| * @var string $key | ||
| */ | 
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.
Is this part necessary? Doesn't Operations have any internal type hints to handle this?
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.
done
        
          
                src/Component/src/Metadata/Resource/Factory/MutatorResourceMetadataCollectionFactory.php
          
            Show resolved
            Hide resolved
        
      | /** | ||
| * @internal | ||
| */ | ||
| final class ResourceResourceMutatorCollection implements ResourceMutatorCollectionInterface | 
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.
Naming scheme doesn't make sense to me, but I'm a bit of out the loop on metadata
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.
fixed
        
          
                src/Component/src/Metadata/Mutator/ResourceMutatorCollection.php
              
                Outdated
          
            Show resolved
            Hide resolved
        
      1c3c841    to
    360a824      
    Compare
  
            
          
                src/Component/src/Metadata/Mutator/OperationMutatorCollectionInterface.php
          
            Show resolved
            Hide resolved
        
              
          
                src/Component/src/Metadata/Mutator/OperationMutatorCollectionInterface.php
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …nterface.php Co-authored-by: Dmitri Perunov <[email protected]>
It's the same feature as this APIP one.
We need this feature for this issue.