1 | <?php |
||
19 | abstract class ComponentAbstract extends ComponentBase |
||
|
|||
20 | { |
||
21 | /** |
||
22 | * Reference to the page name for linking to posts |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $postPage; |
||
27 | |||
28 | /** |
||
29 | * Reference to the page name for linking to categories |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $categoryPage; |
||
34 | |||
35 | /** |
||
36 | * @param Collection $items |
||
37 | * @param string $urlPage |
||
38 | * @param Controller $controller |
||
39 | * @param array $modelUrlParams |
||
40 | */ |
||
41 | protected function setUrls( |
||
53 | |||
54 | /** |
||
55 | * Set Urls to posts |
||
56 | * |
||
57 | * @param ArrayAccess $posts |
||
58 | */ |
||
59 | protected function setPostUrls(ArrayAccess $posts) |
||
78 | |||
79 | protected function setPostUrl(Post $post) |
||
86 | |||
87 | /** |
||
88 | * A helper function to get the real URL parameter name. For example, slug for posts |
||
89 | * can be injected as :post into URL. Real argument is necessary if you want to generate |
||
90 | * valid URLs for such pages |
||
91 | * |
||
92 | * @param ComponentBase|null $component |
||
93 | * @param string $name |
||
94 | * |
||
95 | * @return string|null |
||
96 | */ |
||
97 | protected function urlProperty(ComponentBase $component = null, string $name = '') |
||
113 | |||
114 | /** |
||
115 | * Returns page property defaulting to the value from defineProperties() array with fallback |
||
116 | * to explicitly passed default value |
||
117 | * |
||
118 | * @param string $property |
||
119 | * @param $default |
||
120 | * |
||
121 | * @return mixed |
||
122 | */ |
||
123 | public function getProperty(string $property, $default = null) |
||
127 | |||
128 | /** |
||
129 | * @param string $componentName |
||
130 | * @param string $page |
||
131 | * @return ComponentBase|null |
||
132 | */ |
||
133 | protected function getComponent(string $componentName, string $page) |
||
145 | } |
||
146 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.