Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
AbstractEditObject | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
5 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
getImage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setImage | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
hasImage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (http://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@nolainteractive.com> |
7 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
8 | * @license http://www.popphp.org/license New BSD License |
9 | */ |
10 | |
11 | /** |
12 | * @namespace |
13 | */ |
14 | namespace Pop\Image; |
15 | |
16 | use Pop\Image\Adapter\AbstractAdapter; |
17 | |
18 | /** |
19 | * Abstract image edit class |
20 | * |
21 | * @category Pop |
22 | * @package Pop\Image |
23 | * @author Nick Sagona, III <dev@nolainteractive.com> |
24 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
25 | * @license http://www.popphp.org/license New BSD License |
26 | * @version 4.0.0 |
27 | */ |
28 | abstract class AbstractEditObject |
29 | { |
30 | |
31 | /** |
32 | * Image object |
33 | * @var mixed |
34 | */ |
35 | protected mixed $image = null; |
36 | |
37 | /** |
38 | * Constructor |
39 | * |
40 | * Instantiate an image edit object |
41 | * |
42 | * @param ?AbstractAdapter $image |
43 | */ |
44 | public function __construct(?AbstractAdapter $image = null) |
45 | { |
46 | if ($image !== null) { |
47 | $this->setImage($image); |
48 | } |
49 | } |
50 | |
51 | /** |
52 | * Get the image object |
53 | * |
54 | * @return AbstractAdapter|null |
55 | */ |
56 | public function getImage(): AbstractAdapter|null |
57 | { |
58 | return $this->image; |
59 | } |
60 | |
61 | /** |
62 | * Set the image object |
63 | * |
64 | * @param AbstractAdapter $image |
65 | * @return AbstractEditObject |
66 | */ |
67 | public function setImage(AbstractAdapter $image): AbstractEditObject |
68 | { |
69 | $this->image = $image; |
70 | return $this; |
71 | } |
72 | |
73 | /** |
74 | * Has the image object |
75 | * |
76 | * @return bool |
77 | */ |
78 | public function hasImage(): bool |
79 | { |
80 | return ($this->image !== null); |
81 | } |
82 | |
83 | } |