mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Make parent method check explicit to Shell.
This makes only methods on Shell inaccessible on the command line. Parent methods in AppShell or other parent classes can now be called directly. Fixes #2193
This commit is contained in:
parent
db41a7dd16
commit
d87f9f060b
1 changed files with 2 additions and 5 deletions
|
@ -273,15 +273,12 @@ class Shell extends Object {
|
|||
* @return boolean
|
||||
*/
|
||||
public function hasMethod($name) {
|
||||
if (empty($this->_reflection)) {
|
||||
$this->_reflection = new ReflectionClass($this);
|
||||
}
|
||||
try {
|
||||
$method = $this->_reflection->getMethod($name);
|
||||
$method = new ReflectionMethod($this, $name);
|
||||
if (!$method->isPublic() || substr($name, 0, 1) === '_') {
|
||||
return false;
|
||||
}
|
||||
if ($method->getDeclaringClass() != $this->_reflection) {
|
||||
if ($method->getDeclaringClass()->name == 'Shell') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue