1 | <?php |
||
20 | class DefaultController extends Controller |
||
21 | { |
||
22 | /** |
||
23 | * @var BannerServiceInterface |
||
24 | */ |
||
25 | private $_service; |
||
26 | |||
27 | |||
28 | /** |
||
29 | * @inheritdoc |
||
30 | * @param BannerServiceInterface $service |
||
31 | */ |
||
32 | public function __construct($id, $module, BannerServiceInterface $service, $config = []) |
||
37 | |||
38 | /** |
||
39 | * Renders banners list. |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | public function actionIndex() |
||
49 | |||
50 | /** |
||
51 | * Creates new banner. |
||
52 | * |
||
53 | * @return string|\yii\web\Response |
||
54 | */ |
||
55 | public function actionCreate() |
||
59 | |||
60 | /** |
||
61 | * Updates banner. |
||
62 | * |
||
63 | * @param int $id |
||
64 | * @return string|\yii\web\Response |
||
65 | */ |
||
66 | public function actionUpdate($id) |
||
70 | |||
71 | /** |
||
72 | * Common code for create and update actions. |
||
73 | * |
||
74 | * @param \yii\web\Response $redirect |
||
75 | * @param string $view |
||
76 | * @return string |
||
|
|||
77 | */ |
||
78 | protected function commonAction($redirect, $view) |
||
88 | |||
89 | /** |
||
90 | * Renders details about banner. |
||
91 | * |
||
92 | * @param int $id Banner model ID. |
||
93 | * @return string |
||
94 | */ |
||
95 | public function actionView($id) |
||
100 | |||
101 | /** |
||
102 | * Delete banner. |
||
103 | * |
||
104 | * @param int $id |
||
105 | * @return \yii\web\Response |
||
106 | */ |
||
107 | public function actionDelete($id) |
||
117 | } |
||
118 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.