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

fix(ObjectDescriptionFactory): swap function_exists with enum_exists #20

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

MirAlexSky
Copy link

The function_exists() function should be used first, so that the enum_exists() doesn't cause the composer autoloader to try to include a file that has already been included.

Basically, it is composer who should fix this, but they have decided it works fine.

To reproduce:

  1. Add a class with using a function like use function Psl\Str\Byte\pad_left in \App namespace.
  2. Add any rule with \App as target, for example: arch()->expect('App')->not->toImplement(Throwable::class)
  3. Run the test

Result: PHP Fatal error: Cannot redeclare Psl\Str\Byte\pad_left()

The function_exists() function should be used first, so that the composer autoloader doesn't try to include an already included file
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

Successfully merging this pull request may close these issues.

1 participant