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

Bug: error in view_cell() doc comment #5719

Closed
paul45 opened this issue Feb 22, 2022 · 1 comment · Fixed by #5720
Closed

Bug: error in view_cell() doc comment #5719

paul45 opened this issue Feb 22, 2022 · 1 comment · Fixed by #5720
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@paul45
Copy link
Contributor

paul45 commented Feb 22, 2022

PHP Version

7.4

CodeIgniter4 Version

4.1.5

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

No response

What happened?

i have error in phpstan analyse

Parameter #2 $params of function view_cell expects null, string given.

on line:
return view_cell('\App\Models\CalendrierModel::vueModal', 'id=' . $id);

i think the view_cell doc comment is not good

/**
     * View cells are used within views to insert HTML chunks that are managed
     * by other classes.
     *
     * @param null $params
     *
     * @throws ReflectionException
     */
    function view_cell(string $library, $params = null, int $ttl = 0, ?string $cacheName = null): string
    {
        return Services::viewcell()
            ->render($library, $params, $ttl, $cacheName);
    }

Steps to Reproduce

return view_cell('\App\Models\CalendrierModel::vueModal', 'id=' . $id);
and phpstan analyse

Expected Output

Parameter 2 $params of function view_cell will accept string or array

Anything else?

No response

@paul45 paul45 added the bug Verified issues on the current code behavior or pull requests that will fix them label Feb 22, 2022
@kenjis
Copy link
Member

kenjis commented Feb 22, 2022

Thank you for reporting.
How about this? #5720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants