1 | <?php |
||
29 | final class AssetVideo extends AssetsAbstract implements AssetVideoInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * Autoplay video |
||
34 | * |
||
35 | * @var bool |
||
36 | */ |
||
37 | protected $attr_autoplay; |
||
38 | |||
39 | /** |
||
40 | * Preload video |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $attr_preload; |
||
45 | |||
46 | /** |
||
47 | * Asset constructor set asset ID |
||
48 | * |
||
49 | * @param string $id |
||
50 | */ |
||
51 | 1 | public function __construct(string $id) |
|
56 | |||
57 | /** |
||
58 | * Autoplay video |
||
59 | * |
||
60 | * @param bool $autoplay |
||
61 | * @return AssetVideoInterface |
||
62 | */ |
||
63 | 1 | public function autoplay(bool $autoplay = true): AssetVideoInterface |
|
68 | |||
69 | /** |
||
70 | * Preload video |
||
71 | * |
||
72 | * @param string $preload |
||
73 | * @return AssetVideoInterface |
||
74 | */ |
||
75 | 1 | public function preload(string $preload = 'auto'): AssetVideoInterface |
|
80 | |||
81 | /** |
||
82 | * Set crossorigin attribute of the video |
||
83 | * |
||
84 | * @param string $crossorigin |
||
85 | * @return AssetVideoInterface |
||
86 | */ |
||
87 | 1 | public function crossorigin(string $crossorigin = 'anonymous'): AssetVideoInterface |
|
92 | } |
||
93 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: