1 | <?php |
||
38 | class OCSController extends \OCP\AppFramework\OCSController { |
||
39 | |||
40 | /** @var IRootFolder */ |
||
41 | private $rootFolder; |
||
42 | |||
43 | /** @var string */ |
||
44 | private $userId; |
||
45 | |||
46 | /** @var DirectMapper */ |
||
47 | private $directMapper; |
||
48 | |||
49 | /** @var IURLGenerator */ |
||
50 | private $urlGenerator; |
||
51 | |||
52 | /** @var TemplateManager */ |
||
53 | private $manager; |
||
54 | |||
55 | /** |
||
56 | * OCS controller |
||
57 | * |
||
58 | * @param string $appName |
||
59 | * @param IRequest $request |
||
60 | * @param IRootFolder $rootFolder |
||
61 | * @param string $userId |
||
62 | * @param DirectMapper $directMapper |
||
63 | * @param IURLGenerator $urlGenerator |
||
64 | * @param TemplateManager $manager |
||
65 | */ |
||
66 | public function __construct(string $appName, |
||
67 | IRequest $request, |
||
68 | IRootFolder $rootFolder, |
||
69 | $userId, |
||
70 | DirectMapper $directMapper, |
||
71 | IURLGenerator $urlGenerator, |
||
72 | TemplateManager $manager) { |
||
73 | parent::__construct($appName, $request); |
||
74 | |||
75 | $this->rootFolder = $rootFolder; |
||
76 | $this->userId = $userId; |
||
77 | $this->directMapper = $directMapper; |
||
78 | $this->urlGenerator = $urlGenerator; |
||
79 | $this->manager = $manager; |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * @NoAdminRequired |
||
84 | * |
||
85 | * Init an editing session |
||
86 | * |
||
87 | * @param int $fileId |
||
88 | * @return DataResponse |
||
89 | * @throws OCSNotFoundException|OCSBadRequestException |
||
90 | */ |
||
91 | public function create($fileId) { |
||
118 | |||
119 | /** |
||
120 | * @NoAdminRequired |
||
121 | * |
||
122 | * @param string $type The template type |
||
123 | * @return DataResponse |
||
124 | * @throws OCSBadRequestException |
||
125 | */ |
||
126 | public function getTemplates($type) { |
||
133 | |||
134 | /** |
||
135 | * @NoAdminRequired |
||
136 | * |
||
137 | * @param string $path Where to create the document |
||
138 | * @param int $template The template id |
||
139 | */ |
||
140 | public function createFromTemplate($path, $template) { |
||
168 | |||
169 | private function mb_pathinfo($filepath) { |
||
186 | } |
||
187 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.