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

Doctrine Cache Provider #13

Open
rogoit opened this issue Oct 8, 2022 · 5 comments
Open

Doctrine Cache Provider #13

rogoit opened this issue Oct 8, 2022 · 5 comments

Comments

@rogoit
Copy link
Contributor

rogoit commented Oct 8, 2022

Hi Alex,

what do you think about this or could this be done by Rector out of the box. I think there is also happeing a lot in the Symfony context.

See you
Roland

services:
doctrine_phpcr.meta_cache_provider:

  •    class: Symfony\Component\Cache\DoctrineProvider
    
  •    class: Doctrine\Common\Cache\Psr6\DoctrineProvider
    
  •    factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
      public: false
      arguments:
          - '@doctrine_phpcr.meta_cache_pool'
      tags:
          - { name: 'kernel.reset', method: 'reset' }
    

    doctrine_phpcr.nodes_cache_provider:

  •    class: Symfony\Component\Cache\DoctrineProvider
    
  •    class: Doctrine\Common\Cache\Psr6\DoctrineProvider
    
  •    factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
      public: false
      arguments:
          - '@doctrine_phpcr.nodes_cache_pool'
      tags:
          - { name: 'kernel.reset', method: 'reset' }
    
@alexander-schranz
Copy link
Member

Thx for report. This kind of configs can currently not be converted by Rector. Rector is based on PHP AST and can only convert PHP files. It uses a AST Visitor mechanism of Nikic PHP Parser and a Rector rule is listening to node visitor and can manipulate them see Create Custom Rector Rule.

That is why Rector can not be used to update .yaml files as Rector concentrate and work only with .php files which can be parsed and manipulate via the PHP Parser.

It is also a point why I personally would prefer to switch to .php config files but Symfony currently still prefers .yaml and we will stay with Symfony best practices. I already opened some discussion not sure if we will be able to change this in future: symfony/symfony#47065.

@nevercodealone
Copy link

That is not true. Rector can handle every kind of files and do this in TYPO3 rector. Please belive in this project together with me and let us try something,😎

https://www.typo3-rector.com/

@alexander-schranz
Copy link
Member

@rogoit link me to that part of the @rectorphp docs.

@nevercodealone
Copy link

I am on the way with my kids...lets get in touch together with Sebastian 😎

@sabbelasichon
Copy link

@alexander-schranz I have stumbled over this issue here. And @rogoit is right, Rector can also handle non php files.
But it is currently only working if the Option Parallel is deactivated.
Have a look at: https://github.com/sabbelasichon/typo3-rector/blob/main/src/FileProcessor/Yaml/Form/FormYamlFileProcessor.php

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

No branches or pull requests

4 participants