Coder Social home page Coder Social logo

deprecated-packages / rector-cakephp Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 3.0 136 KB

[DEPRECATED] Use following package instead

Home Page: https://github.com/cakephp/upgrade

License: MIT License

PHP 100.00%
rector ast instant-upgrades php cakephp

rector-cakephp's Introduction

Rector Rules for CakePHP

See available CakePHP rules

Install

This package is already part of rector/rector package, so it works out of the box.

All you need to do is install the main package, and you're good to go:

composer require rector/rector --dev

Use Sets

To add a set to your config, use Rector\CakePHP\Set\CakePHPSetList class and pick one of constants:

use Rector\Config\RectorConfig;
use Rector\CakePHP\Set\CakePHPSetList;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->sets([
        CakePHPSetList::CAKEPHP_40
    ]);
};

Learn Rector Faster

Rector is a tool that we develop and share for free, so anyone can save hundreds of hours on refactoring. But not everyone has time to understand Rector and AST complexity. You have 2 ways to speed this process up:

Both ways support us to and improve Rector in sustainable way by learning from practical projects.

rector-cakephp's People

Contributors

markstory avatar othercorey avatar sabbelasichon avatar samsonasik avatar tomasvotruba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rector-cakephp's Issues

How to replace chained method call

@TomasVotruba

We have an API change in CakePHP 4.3:

From:

$this->getTableLocator()->get('Table');

To:

$this->fetchTable('Table');

Is there a rector rule that allows this?

This is available for a specific Trait, but we do have classes we know use the trait if that's not possible.

Moving CakePHP Rector to the community

Hi @cakephp community,

in past few months, we've moved few core framework Rector extensions to their own communities.
It gives the community full power and freedome to decide and add to the upgrade set, it works very well ๐Ÿ‘
See: https://getrector.org/blog/separating-typo3-and-nette-as-community-packages

Now it's time to move this repository from the core to the community as well ๐Ÿค—

Looking at cakephp/cakephp#15866 (comment),
it seems the way to go is already using CakePHP community package: https://github.com/cakephp/upgrade

Now we make single place to handle CakePHP upgrades the official https://github.com/cakephp/upgrade

Feel free to re-use or copy anything from this repository ๐Ÿ‘

Could not process file

Hi,
I am trying to upgrade from Cakephp 3.5 to 3.6 but i am getting below error for each file

[ERROR] Could not process "src/Controller/VersionsController.php" file, due to:
"PHPStan\BetterReflection\Reflection\ReflectionClass "Cake\Controller\Controller" could not be found in the
located source". On line: 24

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.