Skip to content

[Bug]: foreach() argument must be of type array|object, int given #4

@jonny-dengro

Description

@jonny-dengro

What happened?

When running php artisan config:check I was presented with the following error:

foreach() argument must be of type array|object, int given

vendor/chrisdicarlo/laravel-config-checker/src/Support/LoadConfigKeys.php:34

This may be localised to our config files however it would make sense to modify the below function since the arguments are not strictly typed:

private function flattenConfig($config, $prefix = '')
{
        if (is_array($config)) {
            // .. existing foreach loop
         }
}

Doing this allowed me to run the package

How to reproduce the bug

Install package and run php artisan config:check

Package Version

^1.0

PHP Version

8.1.12

Laravel Version

10.48.22

Which operating systems does with happen with?

macOS, Linux

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions