1 | <?php |
||
10 | class Asset implements \JsonSerializable |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $value; |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $package; |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $packageDir; |
||
24 | /** |
||
25 | * @var float |
||
26 | */ |
||
27 | private $priority; |
||
28 | |||
29 | /** |
||
30 | * @var mixed |
||
31 | */ |
||
32 | private $metadata; |
||
33 | |||
34 | public function __construct(string $value, string $package, string $packageDir, float $priority, $metadata) |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | public function getValue(): string |
||
50 | |||
51 | /** |
||
52 | * Returns the name of the Composer package. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getPackage(): string |
||
60 | |||
61 | /** |
||
62 | * Returns the package directory, relative to root directory. |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | public function getPackageDir(): string |
||
70 | |||
71 | /** |
||
72 | * The higher the priority the earlier the asset in the array. |
||
73 | * |
||
74 | * @return float |
||
75 | */ |
||
76 | public function getPriority(): float |
||
80 | |||
81 | /** |
||
82 | * @return mixed |
||
83 | */ |
||
84 | public function getMetadata() |
||
88 | |||
89 | /** |
||
90 | * Specify data which should be serialized to JSON |
||
91 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
92 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
93 | * which is a value of any type other than a resource. |
||
94 | * @since 5.4.0 |
||
95 | */ |
||
96 | public function jsonSerialize() |
||
106 | |||
107 | public static function fromArray(array $array) : Asset |
||
111 | } |
||
112 |