1 | <?php |
||
34 | class ArticleLoader implements LoaderInterface |
||
35 | { |
||
36 | /** |
||
37 | * @var ArticleProviderInterface |
||
38 | */ |
||
39 | protected $articleProvider; |
||
40 | |||
41 | /** |
||
42 | * @var RouteProviderInterface |
||
43 | */ |
||
44 | protected $routeProvider; |
||
45 | |||
46 | /** |
||
47 | * @var DocumentManager |
||
48 | */ |
||
49 | protected $dm; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $routeBasepaths; |
||
55 | |||
56 | /** |
||
57 | * @var MetaFactoryInterface |
||
58 | */ |
||
59 | protected $metaFactory; |
||
60 | |||
61 | /** |
||
62 | * @var Context |
||
63 | */ |
||
64 | protected $context; |
||
65 | |||
66 | /** |
||
67 | * ArticleLoader constructor. |
||
68 | * |
||
69 | * @param ArticleProviderInterface $articleProvider |
||
70 | * @param RouteProviderInterface $routeProvider |
||
71 | * @param DocumentManager $dm |
||
72 | * @param MetaFactoryInterface $metaFactory |
||
73 | * @param Context $context |
||
74 | */ |
||
75 | 98 | public function __construct( |
|
88 | |||
89 | /** |
||
90 | * Load meta object by provided type and parameters. |
||
91 | * |
||
92 | * @MetaLoaderDoc( |
||
93 | * description="Article Loader loads articles from Content Repository", |
||
94 | * parameters={ |
||
95 | * contentPath="SINGLE|required content path", |
||
96 | * slug="SINGLE|required content slug", |
||
97 | * pageName="COLLECTiON|name of Page for required articles" |
||
98 | * } |
||
99 | * ) |
||
100 | * |
||
101 | * @param string $type object type |
||
102 | * @param array $parameters parameters needed to load required object type |
||
103 | * @param int $responseType response type: single meta (LoaderInterface::SINGLE) or collection of metas (LoaderInterface::COLLECTION) |
||
104 | * |
||
105 | * @return Meta|Meta[]|bool false if meta cannot be loaded, a Meta instance otherwise |
||
106 | * |
||
107 | * @throws \Exception |
||
108 | */ |
||
109 | 18 | public function load($type, $parameters = [], $responseType = LoaderInterface::SINGLE) |
|
169 | |||
170 | /** |
||
171 | * Checks if Loader supports provided type. |
||
172 | * |
||
173 | * @param string $type |
||
174 | * |
||
175 | * @return bool |
||
176 | */ |
||
177 | 17 | public function isSupported(string $type) : bool |
|
181 | |||
182 | 17 | private function getArticleMeta($article) |
|
190 | |||
191 | /** |
||
192 | * @param Route $route |
||
193 | * @param array $parameters |
||
194 | * |
||
195 | * @return SqlQuery |
||
196 | */ |
||
197 | 6 | private function getRouteArticlesQuery(Route $route, array $parameters) : SqlQuery |
|
207 | } |
||
208 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.