Conditions | 5 |
Paths | 5 |
Total Lines | 25 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function actionIndex($class = null, $result = null) |
||
18 | { |
||
19 | /** |
||
20 | * @var TestingClass $testingClass |
||
21 | * @var TestingClass $resultClass |
||
22 | */ |
||
23 | $testingClass = null; |
||
24 | $resultClass = null; |
||
25 | if ($class) { |
||
26 | $className = 'carono\exchange1c\models\\' . $class; |
||
27 | if (class_exists($className)) { |
||
28 | $testingClass = new $className(); |
||
29 | } else { |
||
30 | throw new \Exception("Class $className not found"); |
||
31 | } |
||
32 | |||
33 | if ($testingClass::testImplementsClass()->hasErrors()) { |
||
34 | throw new \Exception('Ошибки реализации интерфейсов.'); |
||
35 | } |
||
36 | |||
37 | if ($result) { |
||
38 | $resultClass = new $className(['method' => $result]); |
||
39 | } |
||
40 | } |
||
41 | return $this->render('index', ['testingClass' => $testingClass, 'resultClass' => $resultClass]); |
||
42 | } |
||
43 | } |