Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fef765

Browse files
authored
Fix to work under PHP 8.0.1
In PHP 8.0.1 (Ubuntu), it's not possible to execute any command as it would return this error: Error: ReflectionMethod::__construct(): Argument cakephp#2 ($method) cannot be null when argument cakephp#1 ($objectOrMethod) is an object Just add the fix to prevent empty value in hasMethod().
1 parent cf14e65 commit 9fef765

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Cake/Console/Shell.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ public function hasTask($task) {
355355
*/
356356
public function hasMethod($name) {
357357
try {
358+
if(empty($name)) {
359+
return false;
360+
}
358361
$method = new ReflectionMethod($this, $name);
359362
if (!$method->isPublic() || substr($name, 0, 1) === '_') {
360363
return false;

0 commit comments

Comments
 (0)