Skip to content

Commit 65c5cba

Browse files
author
dereuromark
committed
Pass dummy session.
1 parent 3713e81 commit 65c5cba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Annotator/ComponentAnnotator.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
namespace IdeHelper\Annotator;
33

44
use Cake\Controller\ComponentRegistry;
5+
use Cake\Controller\Controller;
56
use Cake\Core\App;
67
use Cake\Core\Plugin;
8+
use Cake\Network\Request;
9+
use Cake\Network\Session;
710

811
class ComponentAnnotator extends AbstractAnnotator {
912

@@ -23,7 +26,10 @@ public function annotate($path) {
2326
return false;
2427
}
2528

26-
$object = new $className(new ComponentRegistry());
29+
$request = new Request();
30+
$request->session(new Session());
31+
$controller = new Controller();
32+
$object = new $className(new ComponentRegistry($controller));
2733
$helperMap = $this->_invokeProperty($object, '_componentMap');
2834

2935
$annotations = [];

0 commit comments

Comments
 (0)