1 | <?php |
||
41 | class SelfTestController extends AbstractController |
||
42 | { |
||
43 | /** |
||
44 | * Retrieve the results of all tests. |
||
45 | * |
||
46 | * @return JsonResponse |
||
47 | * |
||
48 | * @ApiDoc( |
||
49 | * section="selftest", |
||
50 | * statusCodes = { |
||
51 | * 200 = "When everything worked out ok" |
||
52 | * }, |
||
53 | * authentication = true, |
||
54 | * authenticationRoles = { |
||
55 | * "ROLE_MANIPULATE_REQUIREMENTS" |
||
56 | * } |
||
57 | * ) |
||
58 | * @ApiDescription( |
||
59 | * response={ |
||
60 | * "results" = { |
||
61 | * "actualType" = "collection", |
||
62 | * "subType" = "object", |
||
63 | * "description" = "The test results.", |
||
64 | * "children" = { |
||
65 | * "name" = { |
||
66 | * "dataType" = "string", |
||
67 | * "description" = "The name of the test" |
||
68 | * }, |
||
69 | * "state" = { |
||
70 | * "dataType" = "choice", |
||
71 | * "description" = "The test result state.", |
||
72 | * "format" = "[FAIL|SKIPPED|SUCCESS|WARNING]" |
||
73 | * }, |
||
74 | * "message" = { |
||
75 | * "dataType" = "string", |
||
76 | * "description" = "The detailed message of the test result." |
||
77 | * }, |
||
78 | * "explain" = { |
||
79 | * "dataType" = "string", |
||
80 | * "description" = "Optional description that could hint any problems and/or explain the error further." |
||
81 | * } |
||
82 | * } |
||
83 | * } |
||
84 | * } |
||
85 | * ) |
||
86 | */ |
||
87 | public function getAllTestsAction() |
||
103 | |||
104 | /** |
||
105 | * Retrieve the automatic generated tenside configuration. |
||
106 | * |
||
107 | * The automatic configuration consists of several values. |
||
108 | * |
||
109 | * @return JsonResponse |
||
110 | * |
||
111 | * @ApiDoc( |
||
112 | * section="selftest", |
||
113 | * statusCodes = { |
||
114 | * 200 = "When everything worked out ok" |
||
115 | * }, |
||
116 | * authentication = true, |
||
117 | * authenticationRoles = { |
||
118 | * "ROLE_MANIPULATE_REQUIREMENTS" |
||
119 | * } |
||
120 | * ) |
||
121 | * @ApiDescription( |
||
122 | * response={ |
||
123 | * "php_cli" = { |
||
124 | * "dataType" = "string", |
||
125 | * "description" = "The PHP interpreter to run on command line." |
||
126 | * }, |
||
127 | * "php_cli_arguments" = { |
||
128 | * "dataType" = "string", |
||
129 | * "description" = "Command line arguments to add." |
||
130 | * } |
||
131 | * } |
||
132 | * ) |
||
133 | */ |
||
134 | public function getAutoConfigAction() |
||
160 | |||
161 | /** |
||
162 | * Create a slug from a test class. |
||
163 | * |
||
164 | * @param string $className The class name to convert. |
||
165 | * |
||
166 | * @return string |
||
167 | */ |
||
168 | private function testClassToSlug($className) |
||
180 | |||
181 | /** |
||
182 | * Prepare the tests. |
||
183 | * |
||
184 | * @return SelfTest |
||
185 | */ |
||
186 | private function prepareTests() |
||
203 | } |
||
204 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.