1 | <?php declare(strict_types=1); |
||
11 | class VimeoServiceAdapter extends AbstractServiceAdapter |
||
12 | { |
||
13 | const THUMBNAIL_SMALL = 'thumbnail_small'; |
||
|
|||
14 | const THUMBNAIL_MEDIUM = 'thumbnail_medium'; |
||
15 | const THUMBNAIL_LARGE = 'thumbnail_large'; |
||
16 | |||
17 | public $title; |
||
18 | public $description; |
||
19 | public $thumbnails; |
||
20 | |||
21 | /** |
||
22 | * @throws ServiceApiNotAvailable |
||
23 | */ |
||
24 | 12 | public function __construct(string $url, string $pattern, EmbedRendererInterface $renderer) |
|
41 | |||
42 | 1 | public function getServiceName(): string |
|
46 | |||
47 | 1 | public function hasThumbnail(): bool |
|
51 | |||
52 | 1 | public function getTitle(): string |
|
56 | |||
57 | 12 | public function setTitle(string $title) |
|
61 | |||
62 | 1 | public function getDescription(): string |
|
66 | |||
67 | 12 | public function setDescription(string $description) |
|
71 | |||
72 | 12 | private function setThumbnails(array $thumbnails) |
|
78 | |||
79 | /** |
||
80 | * @throws InvalidThumbnailSizeException |
||
81 | * @throws InvalidUrlException |
||
82 | */ |
||
83 | 2 | public function getThumbnail(string $size, bool $forceSecure = false): string |
|
96 | |||
97 | /** |
||
98 | * @throws InvalidUrlException |
||
99 | */ |
||
100 | 2 | public function getEmbedUrl(bool $forceAutoplay = false, bool $forceSecure = false): string |
|
104 | |||
105 | 3 | public function getThumbNailSizes(): array |
|
113 | |||
114 | /** |
||
115 | * @throws InvalidThumbnailSizeException |
||
116 | * @throws InvalidUrlException |
||
117 | */ |
||
118 | 1 | public function getSmallThumbnail(bool $forceSecure = false): string |
|
122 | |||
123 | /** |
||
124 | * @throws InvalidThumbnailSizeException |
||
125 | * @throws InvalidUrlException |
||
126 | */ |
||
127 | 1 | public function getMediumThumbnail(bool $forceSecure = false): string |
|
131 | |||
132 | /** |
||
133 | * @throws InvalidThumbnailSizeException |
||
134 | * @throws InvalidUrlException |
||
135 | */ |
||
136 | 1 | public function getLargeThumbnail(bool $forceSecure = false): string |
|
140 | |||
141 | /** |
||
142 | * @throws InvalidThumbnailSizeException |
||
143 | * @throws InvalidUrlException |
||
144 | */ |
||
145 | 1 | public function getLargestThumbnail(bool $forceSecure = false): string |
|
149 | |||
150 | 1 | public function isEmbeddable(): bool |
|
154 | |||
155 | 12 | private function getVideoIdByPattern(string $url, string $pattern): string |
|
163 | |||
164 | /** |
||
165 | * TODO make this better by using guzzle |
||
166 | * @throws ServiceApiNotAvailable |
||
167 | */ |
||
168 | 12 | private function getVideoDataFromServiceApi(): array |
|
181 | } |
||
182 |
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.