@@ -17,7 +17,7 @@ |
||
17 | 17 | : ( ( $type === self::UNKNOWN ) |
18 | 18 | ? ( 'existent' ) |
19 | 19 | : ( 'writable') |
20 | - ) |
|
20 | + ) |
|
21 | 21 | . ' in this context.' |
22 | 22 | ); |
23 | 23 | } |
@@ -6,17 +6,17 @@ |
||
6 | 6 | const WRITE = 2; |
7 | 7 | const UNKNOWN = 3; |
8 | 8 | |
9 | - public function __construct( $key, $type ) |
|
9 | + public function __construct($key, $type) |
|
10 | 10 | { |
11 | 11 | parent::__construct( |
12 | 12 | 'The option "' |
13 | 13 | . $key |
14 | 14 | . '" is not ' |
15 | - . ( $type === self::READ ) |
|
16 | - ? ( 'readable' ) |
|
17 | - : ( ( $type === self::UNKNOWN ) |
|
18 | - ? ( 'existent' ) |
|
19 | - : ( 'writable') |
|
15 | + . ($type === self::READ) |
|
16 | + ? ('readable') |
|
17 | + : (($type === self::UNKNOWN) |
|
18 | + ? ('existent') |
|
19 | + : ('writable') |
|
20 | 20 | ) |
21 | 21 | . ' in this context.' |
22 | 22 | ); |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | class plProcessorNotFoundException extends Exception |
4 | 4 | { |
5 | - public function __construct( $processor ) |
|
5 | + public function __construct($processor) |
|
6 | 6 | { |
7 | - parent::__construct( 'The needed processor class "' . $processor . '" could not be found.' ); |
|
7 | + parent::__construct('The needed processor class "' . $processor . '" could not be found.'); |
|
8 | 8 | } |
9 | 9 | } |
10 | 10 |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | |
3 | 3 | abstract class plProcessor |
4 | 4 | { |
5 | - public static function factory( $processor ) |
|
5 | + public static function factory($processor) |
|
6 | 6 | { |
7 | - $classname = 'pl' . ucfirst( $processor ) . 'Processor'; |
|
8 | - if ( class_exists( $classname ) === false ) |
|
7 | + $classname = 'pl' . ucfirst($processor) . 'Processor'; |
|
8 | + if (class_exists($classname) === false) |
|
9 | 9 | { |
10 | - throw new plProcessorNotFoundException( $processor ); |
|
10 | + throw new plProcessorNotFoundException($processor); |
|
11 | 11 | } |
12 | 12 | return new $classname(); |
13 | 13 | } |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | return $processors; |
24 | 24 | } |
25 | 25 | |
26 | - public function writeToDisk( $input, $output ) |
|
26 | + public function writeToDisk($input, $output) |
|
27 | 27 | { |
28 | - file_put_contents( $output, $input ); |
|
28 | + file_put_contents($output, $input); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | abstract public function getInputTypes(); |
32 | 32 | abstract public function getOutputType(); |
33 | - abstract public function process( $input, $type ); |
|
33 | + abstract public function process($input, $type); |
|
34 | 34 | |
35 | 35 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | private function elementsToDotLanguage(): string |
64 | 64 | { |
65 | - $dotFormat = array_map(function (HasDotRepresentation $element) { |
|
65 | + $dotFormat = array_map(function(HasDotRepresentation $element) { |
|
66 | 66 | return $element->toDotLanguage(); |
67 | 67 | }, $this->dotElements); |
68 | 68 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | public function __construct(Digraph $digraph = null) |
19 | 19 | { |
20 | 20 | $this->options = new plGraphvizProcessorOptions(); |
21 | - $labelBuilder = new NodeLabelBuilder(new TemplateEngine( |
|
21 | + $labelBuilder = new NodeLabelBuilder(new TemplateEngine( |
|
22 | 22 | new FileSystem(__DIR__ . '/../../Graphviz/templates') |
23 | 23 | ), new HtmlLabelStyle()); |
24 | 24 | $classElements = new ClassGraphElements($this->options->createAssociations, $labelBuilder); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | public function hasConstructor(): bool |
47 | 47 | { |
48 | - return \count(array_filter($this->functions, function (Method $function) { |
|
48 | + return \count(array_filter($this->functions, function(Method $function) { |
|
49 | 49 | return $function->isConstructor(); |
50 | 50 | })) === 1; |
51 | 51 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | return []; |
58 | 58 | } |
59 | 59 | |
60 | - $constructors = array_filter($this->functions, function (Method $function) { |
|
60 | + $constructors = array_filter($this->functions, function(Method $function) { |
|
61 | 61 | return $function->isConstructor(); |
62 | 62 | }); |
63 | 63 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
13 | - $this->options = new plProcessorOptions(); |
|
13 | + $this->options = new plProcessorOptions(); |
|
14 | 14 | $this->information = array(); |
15 | 15 | } |
16 | 16 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | return 'text/plain'; |
27 | 27 | } |
28 | 28 | |
29 | - public function process( $input, $type ) |
|
29 | + public function process($input, $type) |
|
30 | 30 | { |
31 | 31 | // Initialize the values |
32 | 32 | $this->information['interfaceCount'] = 0; |
@@ -42,38 +42,38 @@ discard block |
||
42 | 42 | $this->information['privateTypedAttributes'] = 0; |
43 | 43 | |
44 | 44 | // Loop through the classes and interfaces |
45 | - foreach ( $input->definitions() as $definition ) |
|
45 | + foreach ($input->definitions() as $definition) |
|
46 | 46 | { |
47 | - if ( $definition instanceof InterfaceDefinition ) |
|
47 | + if ($definition instanceof InterfaceDefinition) |
|
48 | 48 | { |
49 | 49 | $this->information['interfaceCount']++; |
50 | 50 | } |
51 | 51 | |
52 | - if ( $definition instanceof ClassDefinition ) |
|
52 | + if ($definition instanceof ClassDefinition) |
|
53 | 53 | { |
54 | 54 | $this->information['classCount']++; |
55 | 55 | |
56 | - foreach( $definition->attributes as $attribute ) |
|
56 | + foreach ($definition->attributes as $attribute) |
|
57 | 57 | { |
58 | - switch ( $attribute->modifier ) |
|
58 | + switch ($attribute->modifier) |
|
59 | 59 | { |
60 | 60 | case 'public': |
61 | 61 | $this->information['publicAttributeCount']++; |
62 | - if ( $attribute->type->isPresent() ) |
|
62 | + if ($attribute->type->isPresent()) |
|
63 | 63 | { |
64 | 64 | $this->information['publicTypedAttributes']++; |
65 | 65 | } |
66 | 66 | break; |
67 | 67 | case 'protected': |
68 | 68 | $this->information['protectedAttributeCount']++; |
69 | - if ( $attribute->type->isPresent() ) |
|
69 | + if ($attribute->type->isPresent()) |
|
70 | 70 | { |
71 | 71 | $this->information['protectedTypedAttributes']++; |
72 | 72 | } |
73 | 73 | break; |
74 | 74 | case 'private': |
75 | 75 | $this->information['privateAttributeCount']++; |
76 | - if ( $attribute->type->isPresent() ) |
|
76 | + if ($attribute->type->isPresent()) |
|
77 | 77 | { |
78 | 78 | $this->information['privateTypedAttributes']++; |
79 | 79 | } |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
85 | - foreach( $definition->functions as $function ) |
|
85 | + foreach ($definition->functions as $function) |
|
86 | 86 | { |
87 | - switch ( $function->modifier ) |
|
87 | + switch ($function->modifier) |
|
88 | 88 | { |
89 | 89 | case 'public': |
90 | 90 | $this->information['publicFunctionCount']++; |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $this->information['functionCount'] = $this->information['publicFunctionCount'] + $this->information['protectedFunctionCount'] + $this->information['privateFunctionCount']; |
103 | 103 | $this->information['attributeCount'] = $this->information['publicAttributeCount'] + $this->information['protectedAttributeCount'] + $this->information['privateAttributeCount']; |
104 | 104 | $this->information['typedAttributeCount'] = $this->information['publicTypedAttributes'] + $this->information['protectedTypedAttributes'] + $this->information['privateTypedAttributes']; |
105 | - $this->information['attributesPerClass'] = round( $this->information['attributeCount'] / $this->information['classCount'], 2 ); |
|
106 | - $this->information['functionsPerClass'] = round( $this->information['functionCount'] / $this->information['classCount'], 2 ); |
|
105 | + $this->information['attributesPerClass'] = round($this->information['attributeCount'] / $this->information['classCount'], 2); |
|
106 | + $this->information['functionsPerClass'] = round($this->information['functionCount'] / $this->information['classCount'], 2); |
|
107 | 107 | |
108 | 108 | // Generate the needed text output |
109 | 109 | return <<<END |