1 | <?php |
||
26 | abstract class AbstractController extends BaseController implements EnsureSAMLPlugin |
||
27 | { |
||
28 | |||
29 | const TEMPLATE_INDEX = DIRECTORY_SEPARATOR . '_cp'; |
||
30 | |||
31 | /** |
||
32 | * @throws \yii\base\InvalidConfigException |
||
33 | */ |
||
34 | public function init() |
||
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | protected function getTemplateIndex() |
||
46 | { |
||
47 | return $this->getPlugin()->getTemplateRootKey(); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return array |
||
52 | */ |
||
53 | protected function getBaseVariables() |
||
54 | { |
||
55 | $variables = [ |
||
56 | 'plugin' => $this->getPlugin(), |
||
57 | 'title' => $this->getPlugin()->name, |
||
58 | // 'pluginHandle' => $this->getPlugin()->getHandle(), |
||
59 | 'pluginVariable' => $this->getPlugin()->getPluginVariableHandle(), |
||
60 | 'ownEntityId' => $this->getPlugin()->getSettings()->getEntityId(), |
||
61 | 'settings' => $this->getPlugin()->getSettings(), |
||
62 | |||
63 | // Set the "Continue Editing" URL |
||
64 | 'continueEditingUrl' => $this->getBaseCpPath(), |
||
65 | 'baseActionPath' => $this->getBaseCpPath(), |
||
66 | 'baseCpPath' => $this->getBaseCpPath(), |
||
67 | 'templateIndex' => $this->getTemplateIndex(), |
||
68 | 'ownProvider' => $ownProvider = $this->getPlugin()->getProvider()->findOwn(), |
||
69 | |||
70 | 'actions' => [], |
||
71 | ]; |
||
72 | |||
73 | $variables['selectedSubnavItem'] = $this->getSubNavKey(); |
||
74 | |||
75 | /** @var ProviderInterface $ownProvider */ |
||
76 | if ($ownProvider) { |
||
77 | $variables = array_merge( |
||
78 | $this->addUrls($ownProvider), |
||
79 | $variables |
||
80 | ); |
||
81 | } |
||
82 | |||
83 | return $variables; |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @return null|string |
||
88 | */ |
||
89 | protected function getSubNavKey() |
||
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | */ |
||
120 | protected function getBaseCpPath(): string |
||
121 | { |
||
122 | return $this->getPlugin()->getHandle(); |
||
123 | } |
||
124 | |||
125 | /** |
||
126 | * @param ProviderInterface $provider |
||
127 | * @param array $variables |
||
|
|||
128 | * @return array |
||
129 | */ |
||
130 | protected function addUrls(ProviderInterface $provider) |
||
197 | |||
198 | /** |
||
199 | * @param $endpoints |
||
200 | * @return EndpointType|null |
||
201 | */ |
||
202 | protected function getFirstEndpoint($endpoints) |
||
210 | |||
211 | |||
212 | /** |
||
213 | * @param $type |
||
214 | * @return string |
||
215 | */ |
||
216 | protected function getTitle($type) |
||
220 | } |
||
221 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.