AccessorsPart   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 10
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 2 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the Phootwork package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 *
7
 * @license MIT License
8
 * @copyright Thomas Gossmann
9
 */
10
namespace phootwork\lang\parts;
11
12
trait AccessorsPart {
13
	/**
14
	 * Returns the element at the given index (or null if the index isn't present)
15
	 *
16
	 * @param int|string $index
17
	 *
18
	 * @return mixed
19
	 */
20 13
	public function get(int|string $index): mixed {
21 13
		return $this->array[$index] ?? null;
22
	}
23
}
24