-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathAssetInterface.php
More file actions
73 lines (64 loc) · 1.67 KB
/
Copy pathAssetInterface.php
File metadata and controls
73 lines (64 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* This file is part of the Cloudinary PHP package.
*
* (c) Cloudinary
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cloudinary\Asset;
use JsonSerializable;
/**
* Interface AssetInterface
*/
interface AssetInterface extends JsonSerializable
{
/**
* Creates a new asset from the provided string (URL).
*
* @param string $string The asset string (URL).
*
*/
public static function fromString(string $string): mixed;
/**
* Creates a new asset from the provided JSON.
*
* @param array|string $json The asset json. Can be an array or a JSON string.
*
*/
public static function fromJson(array|string $json): mixed;
/**
* Creates a new asset from the provided source and an array of (legacy) parameters.
*
* @param string $source The public ID of the asset.
* @param array $params The asset parameters.
*
*/
public static function fromParams(string $source, array $params): mixed;
/**
* Imports data from the provided string (URL).
*
* @param string $string The asset string (URL).
*
*/
public function importString(string $string): mixed;
/**
* Imports data from the provided JSON.
*
* @param array|string $json The asset json. Can be an array or a JSON string.
*
*/
public function importJson(array|string $json): mixed;
/**
* Serializes to string.
*
* @return string
*/
public function __toString();
/**
* Serializes to json.
*
*/
public function jsonSerialize(): array;
}