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
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\Layer;
16
17use Pop\Image\AbstractEditObject;
18
19/**
20 * Layer abstract 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 AbstractLayer extends AbstractEditObject implements LayerInterface
30{
31
32    /**
33     * Opacity
34     * @var int|float|null
35     */
36    protected int|float|null $opacity = null;
37
38    /**
39     * Get the opacity
40     *
41     * @return int|float|null
42     */
43    public function getOpacity(): int|float|null
44    {
45        return $this->opacity;
46    }
47
48    /**
49     * Set the image opacity.
50     *
51     * @param  int|float $opacity
52     * @return static
53     */
54    public function setOpacity(int|float $opacity): static
55    {
56        $this->opacity = $opacity;
57        return $this;
58    }
59
60}