zendframework / zend-expressive

PSR-15 middleware in minutes!
BSD 3-Clause "New" or "Revised" License
710 stars 197 forks source link

individual checks before calling `inject*` methods #634

Closed pine3ree closed 6 years ago

pine3ree commented 6 years ago

This could be considered just as a tiny refactoring / code-style change: no bugs, no new features

  1. don't call an inject* method with missing/empty related config values
  2. check for empty routes in injectRoutesFromConfig before checking is_array and running the loop on an empty array (this make more sense if the method is called outside this delegator, which, now, already checks for emptiness before calling it)
weierophinney commented 6 years ago

Thanks, @pine3ree.