Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

lumen support #339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

mxp100
Copy link

@mxp100 mxp100 commented Feb 26, 2020

No description provided.


protected function isLumen()
{
return Str::contains($this->app->version(), 'Lumen');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, change this check to:

return $this->app() instanceof Laravel\Lumen\Application;

Because it's a lot faster then check the string (yeah, I'm crazy):

Benchmark for 9999999 repeations:

  • Laravel - using Str::contains(): 6.24s (436% slower)
  • Laravel - using instanceof: 1.43s
  • Lumen - using Str::contains(): 4.85s (664% slower)
  • Lumen - using instanceof: 0.73s

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants