Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR] Improve type hint for arrays when generating stubs #2026

Closed
ruudboon opened this issue Dec 11, 2019 · 1 comment
Closed

[NFR] Improve type hint for arrays when generating stubs #2026

ruudboon opened this issue Dec 11, 2019 · 1 comment
Assignees

Comments

@ruudboon
Copy link
Contributor

ruudboon commented Dec 11, 2019

When generating a stub for the following code

    namespace Phalcon\Db;
    use Phalcon\Db\Profiler\Item;
    class Profiler
    {
       /**
        * Returns all the processed profiles
        */
       public function getProfiles() -> <Item[]>
       {
           return this->allProfiles;
       }
    }

It results in

   /**
     * Returns all the processed profiles
     *
     * @return array
     */
    public function getProfiles(): array
    {
    }

If possible we would like to generate the following stub.

    /**
     * Returns all the processed profiles
     *
     * @return Phalcon\Db\Profiler\Item[]
     */
    public function getProfiles(): array
    {
    }

See ruudboon/phpstorm-phalcon-4-autocomplete#1

@ruudboon ruudboon changed the title [NFR] Return type hint for arrays when generating stubs [NFR] Improve type hint for arrays when generating stubs Dec 11, 2019
@sergeyklay
Copy link
Contributor

Closing, this is implemented. If there are bugs, we can follow up in separate issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants