dfuncd / repofuck

Fucking with the Repository Design Pattern
6 stars 2 forks source link

Thrown `Exception` in `resolve()` method parses to a wrong path #76

Closed makoru-hikage closed 7 years ago

makoru-hikage commented 7 years ago

L97 of class Entities:

throw new Exceptions\EntityNotDefined;

is read as

Prjkt\Component\Repofuck\Containers\Exceptions\EntityNotDefined;

instead of:

Prjkt\Component\Repofuck\Exceptions\EntityNotDefined;

L97 should be:

throw new EntityNotDefined; only.

This is a semantic error. There must be no more than one word from a use statement used inline. If there is more than one word used inline such as this:

throw new Exceptions\EntityNotDefined;

It'll be parsed based on the namespace

However if only one word has been used such as this:

throw new EntityNotDefined;

It'll be based on a valid use statement; in absence of use statement, the namespace shall be used instead.

rmrhz commented 7 years ago

@makoru-hikage create a pull request to this repository.