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