Completed
Push — master ( 55b21a...aec22b )
by Thomas
06:20
created

ComparatorFactory::createMethodComparator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
namespace gossi\codegen\generator;
3
4
use gossi\codegen\generator\comparator\DefaultConstantComparator;
5
use gossi\codegen\generator\comparator\DefaultMethodComparator;
6
use gossi\codegen\generator\comparator\DefaultPropertyComparator;
7
use gossi\codegen\generator\comparator\DefaultUseStatementComparator;
8
use phootwork\lang\Comparator;
9
10
class ComparatorFactory {
11
12
	/**
13
	 * Creates a comparator for use statements
14
	 * 
15
	 * @param string $type
16
	 * @return Comparator
17
	 */
18 14
	public static function createUseStatementComparator($type) {
1 ignored issue
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...
19
// 		switch ($type) {
1 ignored issue
show
Unused Code Comprehensibility introduced by
49% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
20
// 			case CodeGenerator::SORT_USESTATEMENTS_DEFAULT:
21
// 			default:
22
// 				return new DefaultUseStatementComparator();
23
// 		}
24 14
		return new DefaultUseStatementComparator();
25
	}
26
	
27
	/**
28
	 * Creates a comparator for constants
29
	 * 
30
	 * @param string $type
31
	 * @return Comparator
32
	 */
33 13
	public static function createConstantComparator($type) {
1 ignored issue
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...
34
// 		switch ($type) {
1 ignored issue
show
Unused Code Comprehensibility introduced by
49% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
35
// 			case CodeGenerator::SORT_CONSTANTS_DEFAULT:
36
// 			default:
37
// 				return new DefaultConstantComparator();
38
// 		}
39 13
		return new DefaultConstantComparator();
40
	}
41
	
42
	/**
43
	 * Creates a comparator for properties
44
	 * 
45
	 * @param string $type
46
	 * @return Comparator
47
	 */
48 12
	public static function createPropertyComparator($type) {
1 ignored issue
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...
49
// 		switch ($type) {
1 ignored issue
show
Unused Code Comprehensibility introduced by
49% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
50
// 			case CodeGenerator::SORT_PROPERTIES_DEFAULT:
51
// 			default:
52
// 				return new DefaultPropertyComparator();
53
// 		}
54 12
		return new DefaultPropertyComparator();
55
	}
56
	
57
	/**
58
	 * Creates a comparator for methods
59
	 * 
60
	 * @param string $type
61
	 * @return Comparator
62
	 */
63 14
	public static function createMethodComparator($type) {
1 ignored issue
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...
64
// 		switch ($type) {
1 ignored issue
show
Unused Code Comprehensibility introduced by
49% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
65
// 			case CodeGenerator::SORT_METHODS_DEFAULT:
66
// 			default:
67
// 				return new DefaultMethodComparator();
68
// 		}
69 14
		return new DefaultMethodComparator();
70
	}
71
}