Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
44.44% covered (warning)
44.44%
4 / 9
50.00% covered (warning)
50.00%
4 / 8
CRAP
0.00% covered (danger)
0.00%
0 / 1
AbstractTable
44.44% covered (warning)
44.44%
4 / 9
50.00% covered (warning)
50.00%
4 / 8
22.89
0.00% covered (danger)
0.00%
0 / 1
 offsetSet
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 offsetGet
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 offsetExists
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 offsetUnset
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
 __set
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 __get
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __isset
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 __unset
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
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\Pdf\Build\Font\TrueType\Table;
15
16use ReturnTypeWillChange;
17
18/**
19 * Abstract table class
20 *
21 * @category   Pop
22 * @package    Pop\Pdf
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    5.0.0
27 */
28abstract class AbstractTable implements \ArrayAccess, TableInterface
29{
30
31    /**
32     * Font table properties
33     * @var array
34     */
35    protected array $properties = [];
36
37    /**
38     * Read-only properties
39     * @var array
40     */
41    protected array $readOnly = [];
42
43    /**
44     * Offset set method
45     *
46     * @param  mixed $offset
47     * @param  mixed $value
48     * @return void
49     */
50    public function offsetSet(mixed $offset, mixed $value): void
51    {
52        $this->properties[$offset] = $value;
53    }
54
55    /**
56     * Offset get method
57     *
58     * @param  mixed $offset
59     * @return mixed
60     */
61    public function offsetGet(mixed $offset): mixed
62    {
63        return $this->properties[$offset] ?? null;
64    }
65
66    /**
67     * Offset exists method
68     *
69     * @param  mixed $offset
70     * @return bool
71     */
72    public function offsetExists(mixed $offset): bool
73    {
74        return isset($this->properties[$offset]);
75    }
76
77    /**
78     * Offset unset method
79     *
80     * @param  mixed $offset
81     * @return void
82     */
83    public function offsetUnset(mixed $offset): void
84    {
85        if (isset($this->properties[$offset])) {
86            unset($this->properties[$offset]);
87        }
88    }
89
90    /**
91     * Set method
92     *
93     * @param  string $name
94     * @param  mixed $value
95     * @return void
96     */
97    public function __set(string $name, mixed $value): void
98    {
99        $this->offsetSet($name, $value);
100    }
101
102    /**
103     * Get method
104     *
105     * @param  string $name
106     * @return mixed
107     */
108    public function __get(string $name): mixed
109    {
110        return $this->offsetGet($name);
111    }
112    /**
113     * Isset method
114     *
115     * @param  string $name
116     * @return bool
117     */
118    public function __isset(string $name): bool
119    {
120        return $this->offsetExists($name);
121    }
122    /**
123     * Unset fields[$name]
124     *
125     * @param  string $name
126     * @return void
127     */
128    public function __unset(string $name): void
129    {
130        $this->offsetUnset($name);
131    }
132
133}