Rector upgrades rules for CakePHP

Overview

Rector Rules for CakePHP

See available CakePHP rules

Install

composer require rector/rector-cakephp

Use Sets

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

use Rector\CakePHP\Set\CakePHPSetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
    $containerConfigurator->import(CakePHPSetList::CAKEPHP_40);
};
You might also like...
Rector upgrades rules for Laravel
Rector upgrades rules for Laravel

Rector Rules for Laravel See available Laravel rules Install This package is already part of rector/rector package, so it works out of the box. All yo

[READ-ONLY] Collection library in CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Collection Library The collection classes provide a set of tools to manipulate arrays or Traversable objects. If you have ever used underscore

[READ-ONLY] The event dispatcher library for CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Event Library This library emulates several aspects of how events are triggered and managed in popular JavaScript libraries such as jQuery: An

[READ-ONLY] Validation library from CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Validation Library The validation library in CakePHP provides features to build validators that can validate arbitrary arrays of data with eas

[READ-ONLY] CakePHP Utility classes such as Inflector, Text, Hash, Security and Xml. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Utility Classes This library provides a range of utility classes that are used throughout the CakePHP framework What's in the toolbox? Hash A

Rector - Instant Upgrades and Automated Refactoring

Rector - Instant Upgrades and Automated Refactoring This repository (rectorphp/rector-src) is for development Rector only. Head to rectorphp/rector fo

PHPStan Rules for Rector developers

Rector PHPStan Rules PHPStan rules for Rector and projects that maintain Rector rulesets. Install composer require rector/phpstan-rules --dev Do you u

Rector rules for Nette to Symfony migration
Rector rules for Nette to Symfony migration

Rector Nette to Symfony Do you need to migrate from Nette to Symfony? You can ↓ How we Migrated 54 357-lines Application from Nette to Symfony in 2 Pe

Rector Rules for BEAR.Sunday

Rector Rules for BEAR.Sunday The rector/rector rules for BEAR.Sunday.

[READ-ONLY] Easy to use Caching library with support for multiple caching backends. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Caching Library The Cache library provides a Cache service locator for interfacing with multiple caching backends using a simple to use interf

[READ-ONLY] A flexible, lightweight and powerful Object-Relational Mapper for PHP, implemented using the DataMapper pattern. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP ORM The CakePHP ORM provides a powerful and flexible way to work with relational databases. Using a datamapper pattern the ORM allows you to m

Cakephp-book allows you to search in the official CakePHP documentation directly from the console.

CakeDC/Book plugin for CakePHP cakephp-book allows you to search in the official CakePHP documentation directly from the console. Requirements CakePHP

A sample CakePHP api application using CakeDC/cakephp-api and swoole as server

CakePHP Application Skeleton composer create-project --prefer-dist cakephp/app Added sample data using https://github.com/annexare/Countries Created m

Manage redirects using database rules. Rules are intended to be very similar to Laravel default routes, so syntax is pretty easy to comprehend.

Laravel DB redirector Manage HTTP redirections in Laravel using database Manage redirects using database rules. Rules are intended to be very similar

Phpcs-magento-rules - A set of PHPCS rules used by made.com when hacking Magento

Made.com PHPCS Magento Rules A set of PHPCS rules used by made.com when hacking Magento. Pre-Requisites PHPCS Installation Short Version Clone this re

Instant Upgrades and Instant Refactoring of any PHP 5.3+ code
Instant Upgrades and Instant Refactoring of any PHP 5.3+ code

Rector - Speedup Your PHP Development Rector helps you with 2 areas - major code changes and in daily work. Do you have a legacy code base? Do you wan

Composer Plugin for simpler registration of Rector extension configs

Rector Extension Installer Composer plugin for automatic installation of Rector extensions. Usage composer require --dev rector/extension-installer In

CakePHP: The Rapid Development Framework for PHP - Official Repository

CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Associative Data Mapping, Front Controller, and MVC. O

An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.

Asset Compress Asset Compress is CakePHP plugin for helping reduce the number of requests, and optimizing the remaining requests your application make

Comments
  • Could not process file

    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

    opened by waqdev786 13
  • Add a new rector to help with trait promotions

    Add a new rector to help with trait promotions

    We have a frequently used method chain that comes from a trait. That trait now includes a new method that provides a short cut to the previous method chain. The test contains an example of the actual scenario we have. The replacement method chain is only 2 methods right now, but I could see this interface being easy to extend into an arbitrary number of methods if required. I didn't want to complect the rector with this possibility until we had a real-world scenario that required it.

    Closes https://github.com/rectorphp/rector-cakephp/issues/7

    opened by markstory 5
  • How to replace chained method call

    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.

    opened by othercorey 2
  • Moving CakePHP Rector to the community

    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 :+1: 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 :hugs:

    Looking at https://github.com/cakephp/cakephp/issues/15866#issuecomment-916490079, 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 :+1:

    opened by TomasVotruba 8
Rector upgrades rules for Symfony Framework

Rector Rules for Symfony See available Symfony rules Install This package is already part of rector/rector package, so it works out of the box. All yo

Rector 107 Dec 31, 2022
Rector upgrades rules for Laravel

Rector Rules for Laravel See available Laravel rules Install This package is already part of rector/rector package, so it works out of the box. All yo

Rector 185 Dec 30, 2022
PHPStan Rules for Rector developers

Rector PHPStan Rules PHPStan rules for Rector and projects that maintain Rector rulesets. Install composer require rector/phpstan-rules --dev Do you u

RectorPHP 12 Dec 22, 2022
Rector rules for Nette to Symfony migration

Rector Nette to Symfony Do you need to migrate from Nette to Symfony? You can ↓ How we Migrated 54 357-lines Application from Nette to Symfony in 2 Pe

Rector 8 May 30, 2022
Instant Upgrades and Instant Refactoring of any PHP 5.3+ code

Rector - Speedup Your PHP Development Rector helps you with 2 areas - major code changes and in daily work. Do you have a legacy code base? Do you wan

RectorPHP 6.5k Jan 8, 2023
phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in PHP code

phpcs-security-audit v3 About phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in

Floe design + technologies 655 Jan 3, 2023
Rector upgrades rules for Nette

Rector Rules for Nette See available Nette rules Install composer require rector/rector-nette Use Sets To add a set to your config, use Rector\Nette\S

RectorPHP 21 Nov 7, 2022
Rector upgrades rules for PHPUnit

Rector Rules for PHPUnit See available PHPUnit rules Install composer require rector/rector-phpunit Use Sets To add a set to your config, use Rector\P

RectorPHP 34 Dec 27, 2022
Rector upgrades rules for Doctrine

Rector Rules for Doctrine See available Doctrine rules Install This package is already part of rector/rector package, so it works out of the box.

Rector 37 Nov 7, 2022
Rector upgrades rules for Symfony Framework

Rector Rules for Symfony See available Symfony rules Install This package is already part of rector/rector package, so it works out of the box. All yo

Rector 107 Dec 31, 2022