Describe the bug
In a plugin, you can access kirby()->roots and no error will be thrown. We had a discussion about that with @distantnative here.
To Reproduce
Steps to reproduce the behavior:
- Clone the plainkit
- Create a plugin
- Put
var_dump(kirby()->roots) in the plugin index.php file
- No error thrown
Expected behavior
An error should be thrown.
Kirby Version
3.3.2
Additional context
If you do var_dump(kirby()->roots) in a template, you correctly get the error:
Cannot access protected property Kirby\Cms\App::$roots
However, doing the same thing in a plugin works, and it shouldn't. @distantnative mentioned this might be due to the way hooks are triggered:
|
$function->call($this, ...$arguments); |