Closed neoacevedo closed 2 years ago
Would you please post some files that generate the error?
For the error T_PAAMAYIM_NEKUDOTAYIMI, I can't get which files are issuing it. It's showed just after start processing files. The source files are inside vendor directory from my project. I can't put the source code because it's a private project.
You can divide by 2, I guess. Put vendor elsewhere, delete half of the files, try it. If there's an error, delete another half etc. This way you may be able to find which file causes it. Then it will become fixable.
I have found one of the lines, but I'm cuorious because the parsing error.
Processing files... 77% (17/22) ETA: n/a Parse Error: Syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM on line 411
...
if (($model = $this->modelClass::findOne(['id' => $id, 'auth_key' => $authKey])) !== null) {
...
Additional to it, I get (for the same file):
[0] => Unable to process "/path/to/Controller.php": The given file could not be interpreted as it contains errors: Errors parsing /path/to/Controller.php
But I don't have a clue which error is referred to.
This is about ::
. You cannot use $this->modelClass
as a static call. Assign it to variable first.
I replaced $this->modelClass::
with User::
and the error on line 411 has dissapeared, but the proccess error for the files is still preesent.
UPDATE: I have finally solved the parse error, loggin apidoc in php cli log, a duplicated use statement was the blame.
Now, Method tableName|attributeLabels|behaviors has no parent to inherit from in namespace\models\ModelFile.
is still present. I think this last one can go inside the issue https://github.com/yiisoft/yii2-apidoc/issues/194
As for uniform variable syntax, it looks like a duplicate of #148, it's already fixed in #220. As for issue #194, hopefully I'll take a look at it too. Closing this, feel free to reopen with a snippet for reproducing the problem (if it differs from #194).
What steps will reproduce the problem?
Run the command
vendor/bin/apidoc api /the/source/path /the/target/path --page-title="API Documentation"
What's expected?
Non syntax error
What do you get instead?
Error: Syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM on line 220
The API Doc is generated although not all the files are being scanned.Additional info
And, I dnon't know if it comes inside this issue or if it should be posted in a new one, but yii2-apidoc isn't rendering all the files inside the input directory, and also, in the errors.txt file, I find a lot of
Method tableName|attributeLabels|behaviors has no parent to inherit from in namespace\models\ModelFile.
when I use inheritdoc.