Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
AbstractLayer
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 getOpacity
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setOpacity
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
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 */
14namespace Pop\Image\Layer;
15
16use Pop\Image\AbstractEditObject;
17
18/**
19 * Layer abstract 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 */
28abstract class AbstractLayer extends AbstractEditObject implements LayerInterface
29{
30
31    /**
32     * Opacity
33     * @var mixed
34     */
35    protected int|float|null $opacity = null;
36
37    /**
38     * Get the opacity
39     *
40     * @return int|float|null
41     */
42    public function getOpacity(): int|float|null
43    {
44        return $this->opacity;
45    }
46
47    /**
48     * Set the image opacity.
49     *
50     * @param  int|float $opacity
51     * @return AbstractLayer
52     */
53    public function setOpacity(int|float $opacity): AbstractLayer
54    {
55        $this->opacity = $opacity;
56        return $this;
57    }
58
59}