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

error in ide-helper:generate #832

Closed
behroozbc opened this issue Sep 26, 2019 · 7 comments
Closed

error in ide-helper:generate #832

behroozbc opened this issue Sep 26, 2019 · 7 comments

Comments

@behroozbc
Copy link

hi
i install ide hleper in laravel 6 and see this error
when run
php artisan ide-helper:generate

`> @php artisan ide-helper:generate

ErrorException : array_merge(): Argument #2 is not an array

at C:\Users\behro\Documents\website\hamaiesh elmi\laravel-backend\vendor\barryvdh\laravel-ide-helper\src\Generator.php:53
49|
50| // Find the drivers to add to the extra/interfaces
51| $this->detectDrivers();
52|

53| $this->extra = array_merge($this->extra, $this->config->get('ide-helper.extra'));
54| $this->magic = array_merge($this->magic, $this->config->get('ide-helper.magic'));
55| $this->interfaces = array_merge($this->interfaces, $this->config->get('ide-helper.interfaces'));
56| // Make all interface classes absolute
57| foreach ($this->interfaces as &$interface) {

Exception trace:

1 array_merge([])
C:\Users\behro\Documents\website\hamaiesh elmi\laravel-backend\vendor\barryvdh\laravel-ide-helper\src\Generator.php:53

2 Barryvdh\LaravelIdeHelper\Generator::__construct(Object(Illuminate\Config\Repository), Object(Illuminate\View\Factory), Object(Illuminate\Console\OutputStyle), "")
C:\Users\behro\Documents\website\hamaiesh elmi\laravel-backend\vendor\barryvdh\laravel-ide-helper\src\Console\GeneratorCommand.php:112
`

@teeli
Copy link

teeli commented Oct 2, 2019

Also getting this error recently. I have extra, magic and interfaces defined as arrays in the ide-helper config file. Still getting ErrorException : array_merge(): Expected parameter 2 to be an array, null given in vendor/barryvdh/laravel-ide-helper/src/Generator.php:53 ($this->extra = array_merge($this->extra, $this->config->get('ide-helper.extra'));)

Tried clearing all the caches etc, but no help.

@ScriptingBeating
Copy link

ScriptingBeating commented Oct 7, 2019

I had the same error. This is how I solved it.

php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config

php artisan config:cache

That's it

@netpok
Copy link
Contributor

netpok commented Oct 24, 2019

Your config was cached, you need to clear it:

php artisan config:clear

Configs usually should only be cached in production.

@acidjazz
Copy link

acidjazz commented Feb 28, 2020

config:clear did it for me, why don't we throw this command into the generate artisan?

$this->call('config:clear');

@netpok
Copy link
Contributor

netpok commented Feb 28, 2020

I would not expect a helper library to change the application state. In my opinion if someone decides to cache the config he/she should be the one who clears those cached values.

@mfn
Copy link
Collaborator

mfn commented Feb 28, 2020

Supporting the last comment.

Also: ide-helper is meant to run in dev only and dev is not meant to be cached

@mfn
Copy link
Collaborator

mfn commented Jun 27, 2020

@barryvdh config caching in dev produces this problems and it's generally bad practice to do this, I vote for closing this issue :}

(the readme doesn't mention this, I made myself a note to follow-up on this, but the issue isn't required for this)

mfn added a commit to mfn/laravel-ide-helper that referenced this issue Jun 27, 2020
mfn added a commit to mfn/laravel-ide-helper that referenced this issue Jun 27, 2020
barryvdh pushed a commit that referenced this issue Jun 28, 2020
* readme: sublime command has been removed

Was removed in #976
as it was already deprecated for 7 years.

* readme: old link only redirects, use the destination link directly

* readme: mention that the default _ide_helper.php name can be changed

* readme: document `meta_filename` and hint it can be written into a special subdirectory

* readme: remove hint about \Eloquent or `@mixin`, as the latter is automatically added nowadays

* readme: update how the current phpdoc looks like

* readme: document `write_model_magic_where`

* readme: document `write_model_relation_count_properties`

* readme: document `custom_db_types`

* readme: clarify installation regarding auto-discovery vs. manual

* readme: mention to avoid caching the config in dev

Inspired by #832
fatihdirikman added a commit to fatihdirikman/Laravel-IDE-Helper that referenced this issue Jan 7, 2022
* readme: sublime command has been removed

Was removed in barryvdh/laravel-ide-helper#976
as it was already deprecated for 7 years.

* readme: old link only redirects, use the destination link directly

* readme: mention that the default _ide_helper.php name can be changed

* readme: document `meta_filename` and hint it can be written into a special subdirectory

* readme: remove hint about \Eloquent or `@mixin`, as the latter is automatically added nowadays

* readme: update how the current phpdoc looks like

* readme: document `write_model_magic_where`

* readme: document `write_model_relation_count_properties`

* readme: document `custom_db_types`

* readme: clarify installation regarding auto-discovery vs. manual

* readme: mention to avoid caching the config in dev

Inspired by barryvdh/laravel-ide-helper#832
renaforsberg824 added a commit to renaforsberg824/ide-helper-laravel-developer that referenced this issue Oct 5, 2022
* readme: sublime command has been removed

Was removed in barryvdh/laravel-ide-helper#976
as it was already deprecated for 7 years.

* readme: old link only redirects, use the destination link directly

* readme: mention that the default _ide_helper.php name can be changed

* readme: document `meta_filename` and hint it can be written into a special subdirectory

* readme: remove hint about \Eloquent or `@mixin`, as the latter is automatically added nowadays

* readme: update how the current phpdoc looks like

* readme: document `write_model_magic_where`

* readme: document `write_model_relation_count_properties`

* readme: document `custom_db_types`

* readme: clarify installation regarding auto-discovery vs. manual

* readme: mention to avoid caching the config in dev

Inspired by barryvdh/laravel-ide-helper#832
lisadeloach63 added a commit to lisadeloach63/ide-helper-reso-laravel that referenced this issue Oct 7, 2022
* readme: sublime command has been removed

Was removed in barryvdh/laravel-ide-helper#976
as it was already deprecated for 7 years.

* readme: old link only redirects, use the destination link directly

* readme: mention that the default _ide_helper.php name can be changed

* readme: document `meta_filename` and hint it can be written into a special subdirectory

* readme: remove hint about \Eloquent or `@mixin`, as the latter is automatically added nowadays

* readme: update how the current phpdoc looks like

* readme: document `write_model_magic_where`

* readme: document `write_model_relation_count_properties`

* readme: document `custom_db_types`

* readme: clarify installation regarding auto-discovery vs. manual

* readme: mention to avoid caching the config in dev

Inspired by barryvdh/laravel-ide-helper#832
sadafrangian3 pushed a commit to sadafrangian3/ide-helper-laravel that referenced this issue Oct 18, 2022
* readme: sublime command has been removed

Was removed in barryvdh/laravel-ide-helper#976
as it was already deprecated for 7 years.

* readme: old link only redirects, use the destination link directly

* readme: mention that the default _ide_helper.php name can be changed

* readme: document `meta_filename` and hint it can be written into a special subdirectory

* readme: remove hint about \Eloquent or `@mixin`, as the latter is automatically added nowadays

* readme: update how the current phpdoc looks like

* readme: document `write_model_magic_where`

* readme: document `write_model_relation_count_properties`

* readme: document `custom_db_types`

* readme: clarify installation regarding auto-discovery vs. manual

* readme: mention to avoid caching the config in dev

Inspired by barryvdh/laravel-ide-helper#832
smile1130 added a commit to smile1130/laravel-IDE that referenced this issue Jun 16, 2023
* readme: sublime command has been removed

Was removed in barryvdh/laravel-ide-helper#976
as it was already deprecated for 7 years.

* readme: old link only redirects, use the destination link directly

* readme: mention that the default _ide_helper.php name can be changed

* readme: document `meta_filename` and hint it can be written into a special subdirectory

* readme: remove hint about \Eloquent or `@mixin`, as the latter is automatically added nowadays

* readme: update how the current phpdoc looks like

* readme: document `write_model_magic_where`

* readme: document `write_model_relation_count_properties`

* readme: document `custom_db_types`

* readme: clarify installation regarding auto-discovery vs. manual

* readme: mention to avoid caching the config in dev

Inspired by barryvdh/laravel-ide-helper#832
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

7 participants