Passed
Push — master ( a357e7...195a07 )
by Anton
04:22 queued 01:11
created

Extension::getItems()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 21
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 21
rs 8.7624
c 2
b 0
f 0
cc 5
eloc 9
nc 4
nop 1
1
<?php
2
3
namespace Modules\Extend\Utils {
4
5
	abstract class Extension {
6
7
		protected static $loader = null;
8
9
		# Check if name valid
10
11
		public static function valid(string $name) {
12
13
			return (preg_match(static::$regex_name, $name) ? true : false);
14
		}
15
16
		# Validate name
17
18
		public static function validate(string $name) {
19
20
			return (preg_match(static::$regex_name, $name) ? $name : false);
21
		}
22
23
		# Static overloader
24
25
		public static function __callStatic($name, $arguments) {
26
27
			if (null !== static::$loader) return static::$loader->$name(...$arguments);
28
		}
29
	}
30
}
31