1 | <?php |
||
15 | abstract class SwaggerTestCase extends TestCase |
||
16 | { |
||
17 | /** |
||
18 | * @var \ByJG\Swagger\SwaggerSchema |
||
19 | */ |
||
20 | protected $swaggerSchema; |
||
21 | |||
22 | protected $filePath; |
||
23 | |||
24 | /** |
||
25 | * @throws \Exception |
||
26 | */ |
||
27 | protected function setUp() |
||
35 | |||
36 | /** |
||
37 | * @param string $method The HTTP Method: GET, PUT, DELETE, POST, etc |
||
38 | * @param string $path The REST path call |
||
39 | * @param int $statusExpected |
||
40 | * @param array|null $query |
||
41 | * @param array|null $requestBody |
||
42 | * @param array $requestHeader |
||
43 | * @return mixed |
||
44 | * @deprecated Use assertRequest instead |
||
45 | * @throws \ByJG\Swagger\Exception\HttpMethodNotFoundException |
||
46 | * @throws \ByJG\Swagger\Exception\InvalidDefinitionException |
||
47 | * @throws \ByJG\Swagger\Exception\NotMatchedException |
||
48 | * @throws \ByJG\Swagger\Exception\PathNotFoundException |
||
49 | * @throws \ByJG\Swagger\Exception\RequiredArgumentNotFound |
||
50 | * @throws \Exception |
||
51 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
52 | */ |
||
53 | protected function makeRequest( |
||
80 | |||
81 | /** |
||
82 | * @param \ByJG\Swagger\SwaggerRequester $request |
||
83 | * @return mixed |
||
84 | * @throws \ByJG\Swagger\Exception\HttpMethodNotFoundException |
||
85 | * @throws \ByJG\Swagger\Exception\InvalidDefinitionException |
||
86 | * @throws \ByJG\Swagger\Exception\NotMatchedException |
||
87 | * @throws \ByJG\Swagger\Exception\PathNotFoundException |
||
88 | * @throws \ByJG\Swagger\Exception\RequiredArgumentNotFound |
||
89 | * @throws \Exception |
||
90 | */ |
||
91 | public function assertRequest(SwaggerRequester $request) |
||
106 | } |
||
107 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.