1 | <?php |
||
21 | class BrowscapOrg extends DownloadAbstract implements SourceInterface, SourceFactoryInterface |
||
22 | { |
||
23 | use DataSetsFromContentTrait { getContent as private getContentIgnore; } |
||
24 | |||
25 | const BASE_URI = 'http://browscap.org'; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | protected $type; |
||
31 | |||
32 | /** |
||
33 | * BrowscapOrg constructor. |
||
34 | * |
||
35 | * @param int $type |
||
36 | * @param array $clientOptions |
||
37 | * |
||
38 | * @throws SourceConditionNotSatisfiedException |
||
39 | * @throws UnexpectedValueException |
||
40 | */ |
||
41 | public function __construct(int $type = Type::STANDARD, array $clientOptions = []) |
||
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | * |
||
50 | * @throws SourceUnavailableException |
||
51 | * @throws \RuntimeException |
||
52 | */ |
||
53 | public function getReleaseTime() : int |
||
63 | |||
64 | /** |
||
65 | * @inheritdoc |
||
66 | * |
||
67 | * @throws SourceUnavailableException |
||
68 | * @throws \RuntimeException |
||
69 | */ |
||
70 | public function getVersion() : int |
||
80 | |||
81 | /** |
||
82 | * @param int $type |
||
83 | * |
||
84 | * @throws UnexpectedValueException |
||
85 | */ |
||
86 | protected function setType(int $type) |
||
105 | |||
106 | /** |
||
107 | * @inheritdoc |
||
108 | */ |
||
109 | public function getType() : int |
||
113 | |||
114 | /** |
||
115 | * Needs to be defined again, because the trait used here replaces |
||
116 | * the method of the parent class. |
||
117 | * |
||
118 | * @inheritdoc |
||
119 | */ |
||
120 | public function getContent() : \Generator |
||
124 | } |
||
125 |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.