1 | <?php |
||
9 | class Api implements ApiInterface |
||
10 | { |
||
11 | /** |
||
12 | * Intervention image manager. |
||
13 | * @var ImageManager |
||
14 | */ |
||
15 | protected $imageManager; |
||
16 | |||
17 | /** |
||
18 | * Collection of manipulators. |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $manipulators; |
||
22 | |||
23 | /** |
||
24 | * Create API instance. |
||
25 | * @param ImageManager $imageManager Intervention image manager. |
||
26 | * @param array $manipulators Collection of manipulators. |
||
27 | */ |
||
28 | public function __construct(ImageManager $imageManager, array $manipulators) |
||
33 | |||
34 | /** |
||
35 | * Set the image manager. |
||
36 | * @param ImageManager $imageManager Intervention image manager. |
||
37 | */ |
||
38 | public function setImageManager(ImageManager $imageManager) |
||
42 | |||
43 | /** |
||
44 | * Get the image manager. |
||
45 | * @return ImageManager Intervention image manager. |
||
46 | */ |
||
47 | public function getImageManager() |
||
51 | |||
52 | /** |
||
53 | * Set the manipulators. |
||
54 | * @param array $manipulators Collection of manipulators. |
||
55 | */ |
||
56 | public function setManipulators(array $manipulators) |
||
66 | |||
67 | /** |
||
68 | * Get the manipulators. |
||
69 | * @return array Collection of manipulators. |
||
70 | */ |
||
71 | public function getManipulators() |
||
75 | |||
76 | /** |
||
77 | * Perform image manipulations. |
||
78 | * @param string $source Source image binary data. |
||
79 | * @param array $params The manipulation params. |
||
80 | * @return string Manipulated image binary data. |
||
81 | */ |
||
82 | public function run($source, array $params) |
||
94 | } |
||
95 |