Coder Social home page Coder Social logo

Comments (16)

arogachev avatar arogachev commented on July 27, 2024 1

Also I recommend to try the latest version of yii2-apidoc (3.0.0).

from yii2-apidoc.

samdark avatar samdark commented on July 27, 2024 1

Yes, trying 3.0.0 definitely worth it. @arogachev did a great job squashing very significant amount of bugs.

from yii2-apidoc.

samdark avatar samdark commented on July 27, 2024

In order to fix it we need it reproduceable so we need a set of files and steps to re-create your situation. Would you please provide these?

from yii2-apidoc.

neoacevedo avatar neoacevedo commented on July 27, 2024

What steps will reproduce the problem?

  • Running command to generate the API Documentation for a Laravel project: php X:\yii2\vendor\bin\apidoc api .\app\ C:\Documents\trabajo\project\apidoc --interactive=0 --exclude="vendor" --page-title="My Project - Documentación"

What's expected?

To genenrate the documentation for all the classes

What do you get instead?

The documentation for all classes, except only one: appHttp\Controllers\Api\DriverController

Additional info

Running the command, I get the error: Parse Error: Syntax error, unexpected ')' on line 4801FUNCTION on line 12

Q A
Yii version 2.0.44
Yii APIDoc version 2.1.6
PHP version ~7.4/8.0
Operating system Windows 11/ openSUSE TW

from yii2-apidoc.

samdark avatar samdark commented on July 27, 2024

We don't have your Laravel project so can't reproduce it.

from yii2-apidoc.

neoacevedo avatar neoacevedo commented on July 27, 2024

Because is a private project, I can't share all, but I'm running some tests, and I think I have found the issue. In the class Api\DriverController, I use in a method the notifiable method to send some notifications for the web users and, if I drop or comment the line using it, the method documentation is rendered, not else if I let the notification method uncommented:

...
                $users = Admin::all();
                foreach ($users as $user) {
                    $user->notifyNow(new WebNotification(
                        ucwords($driver->first_name . " " . $driver->last_name),
                        $driver->picture,
                        $driver->phone,
                        $driver->car_number,
                    ));
                }
...

from yii2-apidoc.

samdark avatar samdark commented on July 27, 2024

I'm afraid that's not enough. We need a set of files (it could be not your private project but the same case you've put together) that we can reproduce the issue with.

from yii2-apidoc.

neoacevedo avatar neoacevedo commented on July 27, 2024

app.zip

Updating yii2-apidoc to version 3.0 and trying to generate the documentation raises the error The Yii Framework 2.0 does not seem to be installed. Try running composer install..


Update: The version 3.0 works although I had to copy whole Lavavel rpoject in the yii2 basic project folder to generate the documentation. Before to update yii2-apidoc, I only needed to set the source path where the Laravel project folder, outside the yii2 basic project folder.

from yii2-apidoc.

samdark avatar samdark commented on July 27, 2024

Good. So the bug in question is fixed.

Now, additional issue about source path:

  1. What were your paths previously?
  2. What did you execute and from which directory previously?

from yii2-apidoc.

neoacevedo avatar neoacevedo commented on July 27, 2024

The yii2 basic app project is under my public_html in the Linux server (Network drive for my windows machine):

  • public_html
    -- yii2-basic-app
    -- my-laravel-project

For laravel documentation I run inside my-laravel-project: php Z:\yii2-basic-app\vendor\bin\apidoc api . C:\Users\User\Documents\laravel\apidoc --interactive=0 --exclude="vendor" --page-title="Laravel - Documentation". For yii2-basic-app I run php .\vendor\bin\apidoc api . C:\Users\User\Documents\yii2\apidoc --interactive=0 --exclude="vendor" --page-title="Yii2 - Documentation".

My question is, once updated, these commands stopped to work in my Windows PC, not else in my Linux machine. I executed in Windows the composer update command to update all packages for my yii2 basic app waiting it solved the issue but I didn't get any success result.

from yii2-apidoc.

samdark avatar samdark commented on July 27, 2024

@arogachev would you please take a look at this paths issue?

from yii2-apidoc.

arogachev avatar arogachev commented on July 27, 2024

Unfortunately, I can not reproduce this problem. Successfully generated API docs for your app only.

I created test repository for this issue - https://github.com/arogachev/yii2-apidoc-issue-277. What else should be adjusted to better reflect your case (except title, etc.)?

from yii2-apidoc.

neoacevedo avatar neoacevedo commented on July 27, 2024

I will post first my current result, I will be after to use your docker and I will post later the results.

My current result with yii2-apidoc at 3.0.1, running public_html as a network drive:

PS X:\yii2-app-basic> php .\vendor\bin\apidoc api . C:\Users\User\Documents\yii2\apidoc --interactive=0 --exclude="vendor" --page-title="Yii2 - Documentación" 

The Yii Framework 2.0 does not seem to be installed. Try running composer install.

The command from linux server:

localhost:~/public_html/yii2-app-basic> php vendor/bin/apidoc api . apidoc --interactive=0 --exclude="vendor" --page-title="Yii2 - Documentación"
Searching files to process... done.
Loading apidoc data from cache... no data available.
Checking for updated files... done.
96 files to update.
Processing files... done.(96/96) ETA: n/a   
Updating cross references and backlinks... done.
Rendering files: done.(97/97) ETA: 192 sec.   
generating extension index files...done.
generating search index...done.
480 errors have been logged to apidoc/errors.txt
98 warnings have been logged to apidoc/warnings.txt

from yii2-apidoc.

arogachev avatar arogachev commented on July 27, 2024

If I understood correctly, the last error only occurs on Windows OS, right? Maybe something related to network drive... 🤔

Just in case, I updated the test repo to use "yii2-app-basic" and again, API docs were successfully generated. But I ran tests only on Linux, unfortunately, I can't test it on Windows right now.

Maybe I'm still missing something. A little bit more details about folder / file structure and setup on Windows would be useful.

from yii2-apidoc.

neoacevedo avatar neoacevedo commented on July 27, 2024

I have checked and, if I have yii2-apidoc in any Windows directory, I'm able to make the Api Documentation of any of my projects in the network drive, but if I try to run yii2-apidoc from a network drive, I get the mentioned error.

As I said, my projects are located in a Linux PC, and the folder where these are located is mapped in Windows as network drive, for instance, Z:, if I try to run yii2-apidoc from the Z: drive, I get the error while if I run yii2-apidoc from C: or D: (my Windows drives) it runs without problems.

from yii2-apidoc.

samdark avatar samdark commented on July 27, 2024

@neoacevedo that looks like a very special edge case that is hard to reproduce. I'm closing the issue but if you'll find out what's wrong exectly, please submit a new one. Thanks.

from yii2-apidoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.