Variables   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 15 4
1
<?php
2
3
/**
4
 * @package Cadmium\System\Utils
5
 * @author Anton Romanov
6
 * @copyright Copyright (c) 2015-2017, Anton Romanov
7
 * @link http://cadmium-cms.com
8
 */
9
10
namespace Utils\Template {
11
12
	use DB;
13
14
	abstract class Variables {
15
16
		/**
17
		 * Generate the variables list
18
		 */
19
20
		public static function generate() : \Generator {
21
22
			# Process selection
23
24
			DB::select(TABLE_VARIABLES, ['name', 'value'], null, ['name' => 'ASC']);
25
26
			if (!(DB::getLast() && DB::getLast()->status)) return;
27
28
			# Process results
29
30
			while (null !== ($variable = DB::getLast()->getRow())) {
31
32
				yield $variable['name'] => $variable['value'];
33
			}
34
		}
35
	}
36
}
37