1 | <?php |
||
24 | class ShortUrlPropertyAnnotator implements PropertyAnnotator { |
||
25 | |||
26 | /** |
||
27 | * Predefined property ID |
||
28 | */ |
||
29 | const PROP_ID = '___SHORTURL'; |
||
30 | |||
31 | /** |
||
32 | * @var AppFactory |
||
33 | */ |
||
34 | private $appFactory; |
||
35 | |||
36 | /** |
||
37 | * @since 2.0 |
||
38 | * |
||
39 | * @param AppFactory $appFactory |
||
40 | */ |
||
41 | 2 | public function __construct( AppFactory $appFactory ) { |
|
44 | |||
45 | /** |
||
46 | * @since 2.0 |
||
47 | * |
||
48 | * {@inheritDoc} |
||
49 | */ |
||
50 | 1 | public function isAnnotatorFor( DIProperty $property ) { |
|
53 | |||
54 | /** |
||
55 | * @since 2.0 |
||
56 | * |
||
57 | * {@inheritDoc} |
||
58 | */ |
||
59 | 2 | public function addAnnotation( DIProperty $property, SemanticData $semanticData ) { |
|
76 | |||
77 | protected function getShortUrl( Title $title ) { |
||
88 | |||
89 | protected function getUrlPrefix() { |
||
99 | |||
100 | protected function hasShortUrlUtils() { |
||
103 | |||
104 | } |
||
105 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: