1 | <?php declare(strict_types=1); |
||
9 | abstract class AbstractServiceAdapter implements VideoAdapterInterface |
||
10 | { |
||
11 | public $rawUrl; |
||
12 | public $videoId; |
||
13 | public $pattern; |
||
14 | public $renderer; |
||
15 | |||
16 | public function __construct(string $url, string $pattern, EmbedRendererInterface $renderer) |
||
17 | { |
||
18 | $this->rawUrl = $url; |
||
|
|||
19 | $this->pattern = $pattern; |
||
20 | $this->renderer = $renderer; |
||
21 | } |
||
22 | |||
23 | public function getRawUrl(): string |
||
24 | { |
||
25 | return $this->rawUrl; |
||
26 | } |
||
27 | |||
28 | public function setRawUrl(string $rawUrl) |
||
29 | { |
||
30 | $this->rawUrl = $rawUrl; |
||
31 | } |
||
32 | |||
33 | public function getVideoId(): string |
||
34 | { |
||
35 | return $this->videoId; |
||
36 | } |
||
37 | |||
38 | public function setVideoId(string $videoId) |
||
39 | { |
||
40 | $this->videoId = $videoId; |
||
41 | } |
||
42 | 55 | ||
43 | public function getPattern(): string |
||
44 | 55 | { |
|
45 | 55 | return $this->pattern; |
|
46 | 55 | } |
|
47 | 55 | ||
48 | public function setPattern(string $pattern) |
||
49 | { |
||
50 | $this->pattern = $pattern; |
||
51 | } |
||
52 | |||
53 | public function getRenderer(): EmbedRendererInterface |
||
57 | |||
58 | public function setRenderer(EmbedRendererInterface $renderer) |
||
59 | { |
||
60 | $this->renderer = $renderer; |
||
61 | } |
||
62 | 1 | ||
63 | /** |
||
64 | 1 | * @throws NotEmbeddableException |
|
65 | 1 | */ |
|
66 | public function getEmbedCode( |
||
84 | |||
85 | /** |
||
86 | 2 | * @throws InvalidUrlException |
|
87 | */ |
||
88 | 2 | public function getScheme(bool $forceSecure = false): string |
|
102 | 2 | ||
103 | public function isThumbnailSizeAvailable($intendedSize): bool |
||
107 | } |
||
108 |
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.