Closed delolmo closed 7 years ago
Hey, thank you. Good addition, but I think this option should be passed using a method, instead using the constructor. The general rule is: constructors only accept the most important argument of the middleware: the router instance, whoops instance, cors settings instance, etc. The other optional settings are passed through methods. So I'd do something like this:
$middleware[] = Middleware::cors($settings)
->logger($logger);
What do you think? Do you mind make this change?
Done!
Good job! Thank you
neomerx/cors-psr7 supports debug mode with a PSR-3 Logger Interface. The proposed changes allow passing such a logger to the object constructor so that logging can take place.