Rareloop / lumberjack-core

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined Illuminate classes

GaryJones opened this issue · comments

The package has several use statements for Illuminate classes, like Illuminate\Contracts\Support\Arrayable, Illuminate\Support\Collection, Illuminate\Support\Arr.

These references should be removed, or the correct packages added to composer.json.

@GaryJones How are you running Lumberjack? This sounds like a composer autoload issue at first glance.

In terms of what is going on here, we bring in tightenco/collect, imports Laravel's Collections into without needing to require the entire Illuminate\Support package.

That package has the following namespaces for the classes you mentioned:

  • Tightenco\Collect\Contracts\Support\Arrayable
  • Tightenco\Collect\Support\Collection
  • Tightenco\Collect\Support\Arr

However, they also alias to the Illuminate namespace.

We prefer to use the Illuminate namespace rather than Tightenco\Collect namespace, incase Laravel decide to separate stuff out from the Illuminate\Support package. We would be able to switch over to the actual Laravel package rather than this github split, without a breaking change to namespaces.

👆 Sorry I meant it it doesn't look like PHP is aliasing the classes for you for some reason. Probably not composer.

However, they also alias to the Illuminate namespace.

All good then :-)

I meant it it doesn't look like PHP is aliasing the classes for you for some reason.

Specifically, it was PHPStorm that was grumpy:

screenshot 2018-07-26 13 26 30

Ah okay, we use VS Code. Might see if we can get some of this reporting in for us 👍