1 | <?php |
||
13 | abstract class AbstractServiceAdapter implements VideoAdapterInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | public $rawUrl; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | public $videoId; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | public $pattern; |
||
29 | |||
30 | /** |
||
31 | * @var EmbedRendererInterface |
||
32 | */ |
||
33 | public $renderer; |
||
34 | |||
35 | /** |
||
36 | * AbstractVideoAdapter constructor. |
||
37 | * |
||
38 | * @param string $url |
||
39 | * @param string $pattern |
||
40 | * @param EmbedRendererInterface $renderer |
||
41 | */ |
||
42 | 55 | public function __construct($url, $pattern, EmbedRendererInterface $renderer) |
|
48 | |||
49 | /** |
||
50 | * Returns the input URL. |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | 2 | public function getRawUrl() |
|
58 | |||
59 | /** |
||
60 | * @param string $rawUrl |
||
61 | */ |
||
62 | 1 | public function setRawUrl($rawUrl) |
|
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | */ |
||
70 | 19 | public function getVideoId() |
|
74 | |||
75 | /** |
||
76 | * @param string $videoId |
||
77 | */ |
||
78 | 55 | public function setVideoId($videoId) |
|
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | 2 | public function getPattern() |
|
90 | |||
91 | /** |
||
92 | * @param string $pattern |
||
93 | */ |
||
94 | 1 | public function setPattern($pattern) |
|
98 | |||
99 | /** |
||
100 | * @return EmbedRendererInterface |
||
101 | */ |
||
102 | 2 | public function getRenderer() |
|
106 | |||
107 | /** |
||
108 | * @param EmbedRendererInterface $renderer |
||
109 | */ |
||
110 | 1 | public function setRenderer($renderer) |
|
114 | |||
115 | /** |
||
116 | * @param int $width |
||
117 | * @param int $height |
||
118 | * @param bool $forceAutoplay |
||
119 | * @param bool $forceSecure |
||
120 | * |
||
121 | * @return string |
||
122 | * @throws NotEmbeddableException |
||
123 | */ |
||
124 | 1 | public function getEmbedCode($width, $height, $forceAutoplay = false, $forceSecure = false) |
|
136 | |||
137 | /** |
||
138 | * Switches the protocol scheme between http and https in case you want to force https |
||
139 | * |
||
140 | * @param bool|false $forceSecure |
||
141 | * @return string |
||
142 | */ |
||
143 | 14 | public function getScheme($forceSecure = false) |
|
151 | } |
||
152 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.