Phpinsights: Added `excludes` to config start to overwrite existing from preset

Created on 29 May 2019  路  3Comments  路  Source: nunomaduro/phpinsights

| Q | A
| ---------------- | -----
| Bug report? | yes
| Feature request? | no
| Library version | 1.3.5

Running on Laravel 5.8.19.

When I was adding paths on config/insights.php -> exclude key
It turns out is not merging, but replacing, taking to erroneous behaviour.

It seems to me, the best way to explain is showing a dd($config) on vendor/nunomaduro/phpinsights/src/Application/ConfigResolver.php

Let's focus only on exclude key. Tried on a new fresh laravel app, just install phpinsights.

  • Published config. (didnt add anything)
  • Added dd($config); before the return on resolve method.
  • Ran php artisan insights

Result:
image

All good until here, those are the default excludes from Laravel Preset.

But now, I go to config/insights.php -> exclude key and add a path modules/Phpgrid for a folder I want out...

Ran again, and the dd results like this:
image

Conclusion

The count is the same, 11 excludes, but config disappeared and modules/PhpGrid came in its place.

So, added excludes start to overwrite existing, instead of adding (extending)

bug

Most helpful comment

@ijpatricio Can you re-test this?

All 3 comments

Can you work a pull request to fix this buddy? @ijpatricio

Had to edit the original post, because i put ht e fisrt screenshot worng, still form other experiments lol

Now it's correct picture, and sure, I will try just right ahead to fix this.

@ijpatricio Can you re-test this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erwinw picture erwinw  路  6Comments

nunomaduro picture nunomaduro  路  5Comments

sciracioglu picture sciracioglu  路  3Comments

Knudian picture Knudian  路  3Comments

Gummibeer picture Gummibeer  路  4Comments