sulu/sulu-rector

Doctrine Cache Provider

rogoit opened this issue · 5 comments

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' }
    

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.

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/

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

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

@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