Skip to content

Conversation

@dereuromark
Copy link
Member

Summary

Add rector rules for upgrading to CakePHP 6.0, specifically handling methods that changed from returning bool to returning void.

New Rules:

  1. RemoveAssignmentFromVoidMethodRector - Removes variable assignments from method calls that now return void:

    // Before
    $result = $this->request->allowMethod('post');
    
    // After
    $this->request->allowMethod('post');
  2. Method Renames - Renames validChoice() to validateChoice() for console input classes

Affected Methods:

Class Method Change
ServerRequest allowMethod() Returns void
Configure load() Returns void
ResponseEmitter emit() Returns void
Session close() Returns void
Table deleteOrFail() Returns void
FixtureInterface insert() Returns void
FixtureInterface truncate() Returns void
ConsoleInputArgument validChoice() Renamed to validateChoice(), returns void
ConsoleInputOption validChoice() Renamed to validateChoice(), returns void

Related PRs:

Add rector rules for upgrading to CakePHP 6.0:

- RemoveAssignmentFromVoidMethodRector: Removes variable assignments from
  method calls that now return void instead of bool
- Method renames: validChoice() -> validateChoice() for ConsoleInput classes

Affected methods:
- ServerRequest::allowMethod()
- Configure::load()
- ResponseEmitter::emit()
- Session::close()
- Table::deleteOrFail()
- FixtureInterface::insert()
- FixtureInterface::truncate()
- ConsoleInputArgument::validChoice() -> validateChoice()
- ConsoleInputOption::validChoice() -> validateChoice()

Refs cakephp/cakephp#19220
Refs cakephp/cakephp#19243
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

Successfully merging this pull request may close these issues.

2 participants