ComparatorFactory::createConstantComparator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace gossi\codegen\generator;
5
6
use gossi\codegen\generator\comparator\DefaultConstantComparator;
7
use gossi\codegen\generator\comparator\DefaultMethodComparator;
8
use gossi\codegen\generator\comparator\DefaultPropertyComparator;
9
use gossi\codegen\generator\comparator\DefaultUseStatementComparator;
10
use phootwork\lang\Comparator;
11
12
class ComparatorFactory {
13
14
	/**
15
	 * Creates a comparator for use statements
16
	 *
17
	 * @param string $type
18
	 * @return Comparator
19
	 */
20 16
	public static function createUseStatementComparator(string $type): Comparator {
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
// 		switch ($type) {
22
// 			case CodeGenerator::SORT_USESTATEMENTS_DEFAULT:
23
// 			default:
24
// 				return new DefaultUseStatementComparator();
25
// 		}
26 16
		return new DefaultUseStatementComparator();
27
	}
28
29
	/**
30
	 * Creates a comparator for constants
31
	 *
32
	 * @param string $type
33
	 * @return Comparator
34
	 */
35 15
	public static function createConstantComparator(string $type): Comparator {
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36
// 		switch ($type) {
37
// 			case CodeGenerator::SORT_CONSTANTS_DEFAULT:
38
// 			default:
39
// 				return new DefaultConstantComparator();
40
// 		}
41 15
		return new DefaultConstantComparator();
42
	}
43
44
	/**
45
	 * Creates a comparator for properties
46
	 *
47
	 * @param string $type
48
	 * @return Comparator
49
	 */
50 14
	public static function createPropertyComparator(string $type): Comparator {
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
51
// 		switch ($type) {
52
// 			case CodeGenerator::SORT_PROPERTIES_DEFAULT:
53
// 			default:
54
// 				return new DefaultPropertyComparator();
55
// 		}
56 14
		return new DefaultPropertyComparator();
57
	}
58
59
	/**
60
	 * Creates a comparator for methods
61
	 *
62
	 * @param string $type
63
	 * @return Comparator
64
	 */
65 16
	public static function createMethodComparator(string $type): Comparator {
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
66
// 		switch ($type) {
67
// 			case CodeGenerator::SORT_METHODS_DEFAULT:
68
// 			default:
69
// 				return new DefaultMethodComparator();
70
// 		}
71 16
		return new DefaultMethodComparator();
72
	}
73
}
74