This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'test'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface FooContext { | |
public function foo(); // i.e. cache | |
public function bar(); // i.e. dbConnection | |
public function baz(); // i.e. logger | |
} | |
// If we're not doing dependency injection, then you need to handle permutations like below... | |
// It's easy to see how quickly this gets out of control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class APIRequest extends FormRequest | |
{ | |
public function response(array $errors) | |
{ | |
if ($this->ajax() || $this->wantsJson()) | |
{ | |
return new JsonResponse($errors, $this->responseCode()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test! |