Passed
Push — master ( 684bcb...2808dd )
by Sebastian
09:28
created
src/XMLHelper/Converter.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 {
42 42
     const ERROR_FAILED_CONVERTING_TO_JSON = 37901;
43 43
     
44
-   /**
45
-    * @var \SimpleXMLElement
46
-    */
44
+    /**
45
+     * @var \SimpleXMLElement
46
+     */
47 47
     protected $xml;
48 48
     
49
-   /**
50
-    * @var string
51
-    */
49
+    /**
50
+     * @var string
51
+     */
52 52
     protected $json;
53 53
     
54 54
     protected function __construct(\SimpleXMLElement $element)
@@ -56,24 +56,24 @@  discard block
 block discarded – undo
56 56
         $this->xml = $element;
57 57
     }
58 58
     
59
-   /**
60
-    * Factory method: creates a converter from an XML file on disk.
61
-    * 
62
-    * @param string $path
63
-    * @return \AppUtils\XMLHelper_Converter
64
-    */
59
+    /**
60
+     * Factory method: creates a converter from an XML file on disk.
61
+     * 
62
+     * @param string $path
63
+     * @return \AppUtils\XMLHelper_Converter
64
+     */
65 65
     public static function fromFile(string $path)
66 66
     {
67 67
         $xmlString = file_get_contents($path);
68 68
         return self::fromString($xmlString);
69 69
     }
70 70
  
71
-   /**
72
-    * Factory method: creates a converter from an XML string.
73
-    * 
74
-    * @param string $xmlString
75
-    * @return \AppUtils\XMLHelper_Converter
76
-    */
71
+    /**
72
+     * Factory method: creates a converter from an XML string.
73
+     * 
74
+     * @param string $xmlString
75
+     * @return \AppUtils\XMLHelper_Converter
76
+     */
77 77
     public static function fromString(string $xmlString)
78 78
     {
79 79
         $element = new \SimpleXMLElement($xmlString);
@@ -81,36 +81,36 @@  discard block
 block discarded – undo
81 81
         return self::fromElement($element);
82 82
     }
83 83
     
84
-   /**
85
-    * Factory method: creates a converter from an existing SimpleXMLElement instance.
86
-    * 
87
-    * @param \SimpleXMLElement $element
88
-    * @return \AppUtils\XMLHelper_Converter
89
-    */
84
+    /**
85
+     * Factory method: creates a converter from an existing SimpleXMLElement instance.
86
+     * 
87
+     * @param \SimpleXMLElement $element
88
+     * @return \AppUtils\XMLHelper_Converter
89
+     */
90 90
     public static function fromElement(\SimpleXMLElement $element)
91 91
     {
92 92
         $obj = new XMLHelper_Converter($element);
93 93
         return $obj;
94 94
     }
95 95
 
96
-   /**
97
-    * Factory method: creates a converter from an existing SimpleXMLElement instance.
98
-    *
99
-    * @param \DOMElement $element
100
-    * @return \AppUtils\XMLHelper_Converter
101
-    */
96
+    /**
97
+     * Factory method: creates a converter from an existing SimpleXMLElement instance.
98
+     *
99
+     * @param \DOMElement $element
100
+     * @return \AppUtils\XMLHelper_Converter
101
+     */
102 102
     public static function fromDOMElement(\DOMElement $element)
103 103
     {
104 104
         $obj = new XMLHelper_Converter(simplexml_import_dom($element));
105 105
         return $obj;
106 106
     }
107 107
     
108
-   /**
109
-    * Converts the XML to JSON.
110
-    * 
111
-    * @throws XMLHelper_Exception
112
-    * @return string
113
-    */
108
+    /**
109
+     * Converts the XML to JSON.
110
+     * 
111
+     * @throws XMLHelper_Exception
112
+     * @return string
113
+     */
114 114
     public function toJSON() : string
115 115
     {
116 116
         if(isset($this->json)) {
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
         );
139 139
     }
140 140
     
141
-   /**
142
-    * Converts the XML to an associative array.
143
-    * @return array
144
-    * @throws XMLHelper_Exception
145
-    */
141
+    /**
142
+     * Converts the XML to an associative array.
143
+     * @return array
144
+     * @throws XMLHelper_Exception
145
+     */
146 146
     public function toArray() : array 
147 147
     {
148 148
         $json = $this->toJSON();
Please login to merge, or discard this patch.
src/RegexHelper.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
     
43 43
     const REGEX_MD5 = '/^[a-f0-9]{32}$/i';
44 44
 
45
-   /**
46
-    * @var string
47
-    * @see https://en.wikipedia.org/wiki/Email_address#Local-part
48
-    */
45
+    /**
46
+     * @var string
47
+     * @see https://en.wikipedia.org/wiki/Email_address#Local-part
48
+     */
49 49
     const REGEX_EMAIL = '/[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i';
50 50
     
51 51
     const REGEX_PHONE = '/\A[+0-9][0-9 +\-()]+\z/m';
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
      */
98 98
     const REGEX_IS_HTML = '%<{0,1}[a-z\/][\s\S]*>|<[a-z\/][\s\S]*>{0,1}%i';
99 99
     
100
-   /**
101
-    * Hexadecimal color codes. Allows the following formats:
102
-    * 
103
-    * FFFFFF
104
-    * FFF
105
-    * 
106
-    * @var string
107
-    */
100
+    /**
101
+     * Hexadecimal color codes. Allows the following formats:
102
+     * 
103
+     * FFFFFF
104
+     * FFF
105
+     * 
106
+     * @var string
107
+     */
108 108
     const REGEX_HEX_COLOR_CODE = '/\A(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{3})\z/iU';
109 109
 }
Please login to merge, or discard this patch.
src/IniHelper/Line.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -38,38 +38,38 @@
 block discarded – undo
38 38
      */
39 39
     protected $text;
40 40
     
41
-   /**
42
-    * @var string
43
-    */
41
+    /**
42
+     * @var string
43
+     */
44 44
     protected $trimmed;
45 45
     
46
-   /**
47
-    * @var int
48
-    */
46
+    /**
47
+     * @var int
48
+     */
49 49
     protected $lineNumber;
50 50
     
51
-   /**
52
-    * @var string
53
-    */
51
+    /**
52
+     * @var string
53
+     */
54 54
     protected $type;
55 55
     
56
-   /**
57
-    * @var string
58
-    */
56
+    /**
57
+     * @var string
58
+     */
59 59
     protected $varName = '';
60 60
     
61
-   /**
62
-    * @var string
63
-    */
61
+    /**
62
+     * @var string
63
+     */
64 64
     protected $varValue = '';
65 65
     
66 66
     protected $valueUnquoted = '';
67 67
     
68 68
     protected $quoteStyle = '';
69 69
     
70
-   /**
71
-    * @var string
72
-    */
70
+    /**
71
+     * @var string
72
+     */
73 73
     protected $sectionName = '';
74 74
     
75 75
     public function __construct(string $text, int $lineNumber)
Please login to merge, or discard this patch.
src/IniHelper/Section.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -21,19 +21,19 @@  discard block
 block discarded – undo
21 21
  */
22 22
 class IniHelper_Section
23 23
 {
24
-   /**
25
-    * @var IniHelper
26
-    */
24
+    /**
25
+     * @var IniHelper
26
+     */
27 27
     protected $ini;
28 28
     
29
-   /**
30
-    * @var string
31
-    */
29
+    /**
30
+     * @var string
31
+     */
32 32
     protected $name;
33 33
     
34
-   /**
35
-    * @var IniHelper_Line[]
36
-    */
34
+    /**
35
+     * @var IniHelper_Line[]
36
+     */
37 37
     protected $lines = array();
38 38
     
39 39
     public function __construct(IniHelper $ini, string $name)
@@ -42,33 +42,33 @@  discard block
 block discarded – undo
42 42
         $this->name = $name;
43 43
     }
44 44
     
45
-   /**
46
-    * The section's name.
47
-    * @return string
48
-    */
45
+    /**
46
+     * The section's name.
47
+     * @return string
48
+     */
49 49
     public function getName() : string
50 50
     {
51 51
         return $this->name;
52 52
     }
53 53
     
54
-   /**
55
-    * Whether this is the default section: this 
56
-    * is used internally to store all variables that
57
-    * are not in any specific section.
58
-    * 
59
-    * @return bool
60
-    */
54
+    /**
55
+     * Whether this is the default section: this 
56
+     * is used internally to store all variables that
57
+     * are not in any specific section.
58
+     * 
59
+     * @return bool
60
+     */
61 61
     public function isDefault() : bool
62 62
     {
63 63
         return $this->name === IniHelper::SECTION_DEFAULT;
64 64
     }
65 65
     
66
-   /**
67
-    * Adds a line instance to the section.
68
-    * 
69
-    * @param IniHelper_Line $line
70
-    * @return IniHelper_Section
71
-    */
66
+    /**
67
+     * Adds a line instance to the section.
68
+     * 
69
+     * @param IniHelper_Line $line
70
+     * @return IniHelper_Section
71
+     */
72 72
     public function addLine(IniHelper_Line $line) : IniHelper_Section
73 73
     {
74 74
         $this->lines[] = $line;
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
         return $this;
77 77
     }
78 78
     
79
-   /**
80
-    * Converts the values contained in the section into 
81
-    * an associative array.
82
-    * 
83
-    * @return array
84
-    */
79
+    /**
80
+     * Converts the values contained in the section into 
81
+     * an associative array.
82
+     * 
83
+     * @return array
84
+     */
85 85
     public function toArray() : array
86 86
     {
87 87
         $result = array();
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
         return $result;
115 115
     }
116 116
     
117
-   /**
118
-    * Converts the section's lines into an INI string.
119
-    * 
120
-    * @return string
121
-    */
117
+    /**
118
+     * Converts the section's lines into an INI string.
119
+     * 
120
+     * @return string
121
+     */
122 122
     public function toString()
123 123
     {
124 124
         $lines = array();
@@ -140,12 +140,12 @@  discard block
 block discarded – undo
140 140
         return implode($this->ini->getEOLChar(), $lines);
141 141
     }
142 142
 
143
-   /**
144
-    * Deletes a line from the section.
145
-    * 
146
-    * @param IniHelper_Line $toDelete
147
-    * @return IniHelper_Section
148
-    */
143
+    /**
144
+     * Deletes a line from the section.
145
+     * 
146
+     * @param IniHelper_Line $toDelete
147
+     * @return IniHelper_Section
148
+     */
149 149
     public function deleteLine(IniHelper_Line $toDelete) : IniHelper_Section
150 150
     {
151 151
         $keep = array();
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
         return $this;
163 163
     }
164 164
     
165
-   /**
166
-    * Sets the value of a variable, overwriting any existing value.
167
-    * 
168
-    * @param string $name
169
-    * @param mixed $value If an array is specified, it is treated as duplicate keys and will add a line for each value.
170
-    * @return IniHelper_Section
171
-    */
165
+    /**
166
+     * Sets the value of a variable, overwriting any existing value.
167
+     * 
168
+     * @param string $name
169
+     * @param mixed $value If an array is specified, it is treated as duplicate keys and will add a line for each value.
170
+     * @return IniHelper_Section
171
+     */
172 172
     public function setValue(string $name, $value) : IniHelper_Section
173 173
     {
174 174
         $lines = $this->getLinesByVariable($name);
@@ -229,15 +229,15 @@  discard block
 block discarded – undo
229 229
         return $this;
230 230
     }
231 231
     
232
-   /**
233
-    * Adds a variable value to the section. Unlike setValue(), this
234
-    * will not overwrite any existing value. If the name is an existing
235
-    * variable name, it will be converted to duplicate keys.
236
-    * 
237
-    * @param string $name
238
-    * @param mixed $value If this is an array, it will be treated as duplicate keys, and all values that are not present yet will be added.
239
-    * @return IniHelper_Section
240
-    */
232
+    /**
233
+     * Adds a variable value to the section. Unlike setValue(), this
234
+     * will not overwrite any existing value. If the name is an existing
235
+     * variable name, it will be converted to duplicate keys.
236
+     * 
237
+     * @param string $name
238
+     * @param mixed $value If this is an array, it will be treated as duplicate keys, and all values that are not present yet will be added.
239
+     * @return IniHelper_Section
240
+     */
241 241
     public function addValue(string $name, $value) : IniHelper_Section
242 242
     {
243 243
         // array value? Treat it as duplicate keys.
@@ -295,12 +295,12 @@  discard block
 block discarded – undo
295 295
     }
296 296
     
297 297
     
298
-   /**
299
-    * Retrieves all lines for the specified variable name.
300
-    *  
301
-    * @param string $name
302
-    * @return \AppUtils\IniHelper_Line[]
303
-    */
298
+    /**
299
+     * Retrieves all lines for the specified variable name.
300
+     *  
301
+     * @param string $name
302
+     * @return \AppUtils\IniHelper_Line[]
303
+     */
304 304
     public function getLinesByVariable(string $name)
305 305
     {
306 306
         $result = array();
Please login to merge, or discard this patch.
src/FileHelper/PHPClassInfo.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -36,17 +36,17 @@  discard block
 block discarded – undo
36 36
     
37 37
     protected $classes = array();
38 38
     
39
-   /**
40
-    * The namespace detected in the file, if any.
41
-    * @var string
42
-    */
39
+    /**
40
+     * The namespace detected in the file, if any.
41
+     * @var string
42
+     */
43 43
     protected $namespace = '';
44 44
     
45
-   /**
46
-    * @param string $path The path to the PHP file to parse.
47
-    * @throws FileHelper_Exception
48
-    * @see FileHelper::findPHPClasses()
49
-    */
45
+    /**
46
+     * @param string $path The path to the PHP file to parse.
47
+     * @throws FileHelper_Exception
48
+     * @see FileHelper::findPHPClasses()
49
+     */
50 50
     public function __construct(string $path)
51 51
     {
52 52
         $this->path = realpath($path);
@@ -66,66 +66,66 @@  discard block
 block discarded – undo
66 66
         $this->parseFile();
67 67
     }
68 68
     
69
-   /**
70
-    * The name of the namespace of the classes in the file, if any.
71
-    * @return string
72
-    */
69
+    /**
70
+     * The name of the namespace of the classes in the file, if any.
71
+     * @return string
72
+     */
73 73
     public function getNamespace() : string
74 74
     {
75 75
         return $this->namespace;
76 76
     }
77 77
     
78
-   /**
79
-    * Whether the file contains a namespace.
80
-    * @return bool
81
-    */
78
+    /**
79
+     * Whether the file contains a namespace.
80
+     * @return bool
81
+     */
82 82
     public function hasNamespace() : bool
83 83
     {
84 84
         return !empty($this->namespace);
85 85
     }
86 86
     
87
-   /**
88
-    * The absolute path to the file.
89
-    * @return string
90
-    */
87
+    /**
88
+     * The absolute path to the file.
89
+     * @return string
90
+     */
91 91
     public function getPath() : string
92 92
     {
93 93
         return $this->path;
94 94
     }
95 95
    
96
-   /**
97
-    * Whether any classes were found in the file.
98
-    * @return bool
99
-    */
96
+    /**
97
+     * Whether any classes were found in the file.
98
+     * @return bool
99
+     */
100 100
     public function hasClasses() : bool
101 101
     {
102 102
         return !empty($this->classes);
103 103
     }
104 104
     
105
-   /**
106
-    * The names of the classes that were found in the file (with namespace if any).
107
-    * @return string[]
108
-    */
105
+    /**
106
+     * The names of the classes that were found in the file (with namespace if any).
107
+     * @return string[]
108
+     */
109 109
     public function getClassNames() : array
110 110
     {
111 111
         return array_keys($this->classes);
112 112
     }
113 113
     
114
-   /**
115
-    * Retrieves all classes that were detected in the file,
116
-    * which can be used to retrieve more information about
117
-    * them.
118
-    * 
119
-    * @return FileHelper_PHPClassInfo_Class[]
120
-    */
114
+    /**
115
+     * Retrieves all classes that were detected in the file,
116
+     * which can be used to retrieve more information about
117
+     * them.
118
+     * 
119
+     * @return FileHelper_PHPClassInfo_Class[]
120
+     */
121 121
     public function getClasses()
122 122
     {
123 123
         return $this->classes;
124 124
     }
125 125
     
126
-   /**
127
-    * @throws FileHelper_Exception
128
-    */
126
+    /**
127
+     * @throws FileHelper_Exception
128
+     */
129 129
     protected function parseFile()
130 130
     {
131 131
         $code = file_get_contents($this->path);
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
         }
181 181
     }
182 182
     
183
-   /**
184
-    * Strips all whitespace from the string, replacing it with 
185
-    * regular spaces (newlines, tabs, etc.).
186
-    * 
187
-    * @param string $string
188
-    * @return string
189
-    */
183
+    /**
184
+     * Strips all whitespace from the string, replacing it with 
185
+     * regular spaces (newlines, tabs, etc.).
186
+     * 
187
+     * @param string $string
188
+     * @return string
189
+     */
190 190
     protected function stripWhitespace(string $string) : string 
191 191
     {
192 192
         return preg_replace('/[\s]/', ' ', $string);
Please login to merge, or discard this patch.
src/FileHelper/PHPClassInfo/Class.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -22,51 +22,51 @@  discard block
 block discarded – undo
22 22
  */
23 23
 class FileHelper_PHPClassInfo_Class 
24 24
 {
25
-   /**
26
-    * @var FileHelper_PHPClassInfo
27
-    */
25
+    /**
26
+     * @var FileHelper_PHPClassInfo
27
+     */
28 28
     protected $info;
29 29
 
30
-   /**
31
-    * @var bool
32
-    */
30
+    /**
31
+     * @var bool
32
+     */
33 33
     protected $abstract = false;
34 34
     
35
-   /**
36
-    * @var bool
37
-    */
35
+    /**
36
+     * @var bool
37
+     */
38 38
     protected $final = false;
39 39
     
40
-   /**
41
-    * @var string
42
-    */
40
+    /**
41
+     * @var string
42
+     */
43 43
     protected $extends = '';
44 44
     
45
-   /**
46
-    * @var string[]
47
-    */
45
+    /**
46
+     * @var string[]
47
+     */
48 48
     protected $implements = array();
49 49
     
50
-   /**
51
-    * @var string
52
-    */
50
+    /**
51
+     * @var string
52
+     */
53 53
     protected $name;
54 54
     
55
-   /**
56
-    * @var string
57
-    */
55
+    /**
56
+     * @var string
57
+     */
58 58
     protected $declaration;
59 59
     
60
-   /**
61
-    * @var string
62
-    */
60
+    /**
61
+     * @var string
62
+     */
63 63
     protected $keyword;
64 64
     
65
-   /**
66
-    * @param FileHelper_PHPClassInfo $info The class info instance.
67
-    * @param string $declaration The full class declaration, e.g. "class SomeName extends SomeOtherClass".
68
-    * @param string $keyword The class keyword, if any, i.e. "abstract" or "final".
69
-    */
65
+    /**
66
+     * @param FileHelper_PHPClassInfo $info The class info instance.
67
+     * @param string $declaration The full class declaration, e.g. "class SomeName extends SomeOtherClass".
68
+     * @param string $keyword The class keyword, if any, i.e. "abstract" or "final".
69
+     */
70 70
     public function __construct(FileHelper_PHPClassInfo $info, string $declaration, string $keyword)
71 71
     {
72 72
         $this->info = $info;
@@ -76,31 +76,31 @@  discard block
 block discarded – undo
76 76
         $this->analyzeCode();
77 77
     }
78 78
     
79
-   /**
80
-    * Check if this class is a subclass of the specified
81
-    * class name.
82
-    * 
83
-    * @param string $className
84
-    * @return bool
85
-    */
79
+    /**
80
+     * Check if this class is a subclass of the specified
81
+     * class name.
82
+     * 
83
+     * @param string $className
84
+     * @return bool
85
+     */
86 86
     public function isSublassOf(string $className) : bool
87 87
     {
88 88
         return is_subclass_of($this->getNameNS(), $className);
89 89
     }
90 90
     
91
-   /**
92
-    * The class name without namespace.
93
-    * @return string
94
-    */
91
+    /**
92
+     * The class name without namespace.
93
+     * @return string
94
+     */
95 95
     public function getName() : string
96 96
     {
97 97
         return $this->name;
98 98
     }
99 99
     
100
-   /**
101
-    * The absolute class name with namespace (if any).
102
-    * @return string
103
-    */
100
+    /**
101
+     * The absolute class name with namespace (if any).
102
+     * @return string
103
+     */
104 104
     public function getNameNS() : string
105 105
     {
106 106
         $name = $this->getName();
@@ -112,48 +112,48 @@  discard block
 block discarded – undo
112 112
         return $name;
113 113
     }
114 114
     
115
-   /**
116
-    * Whether it is an abstract class.
117
-    * @return bool
118
-    */
115
+    /**
116
+     * Whether it is an abstract class.
117
+     * @return bool
118
+     */
119 119
     public function isAbstract() : bool
120 120
     {
121 121
         return $this->abstract;
122 122
     }
123 123
     
124
-   /**
125
-    * Whether it is a final class.
126
-    * @return bool
127
-    */
124
+    /**
125
+     * Whether it is a final class.
126
+     * @return bool
127
+     */
128 128
     public function isFinal() : bool
129 129
     {
130 130
         return $this->final;
131 131
     }
132 132
 
133
-   /**
134
-    * The name of the class that this class extends (with namespace, if specified).
135
-    * @return string
136
-    */
133
+    /**
134
+     * The name of the class that this class extends (with namespace, if specified).
135
+     * @return string
136
+     */
137 137
     public function getExtends() : string
138 138
     {
139 139
         return $this->extends;
140 140
     }
141 141
     
142
-   /**
143
-    * A list of interfaces the class implements, if any.
144
-    * @return array
145
-    */
142
+    /**
143
+     * A list of interfaces the class implements, if any.
144
+     * @return array
145
+     */
146 146
     public function getImplements() : array
147 147
     {
148 148
         return $this->implements;
149 149
     }
150 150
     
151
-   /**
152
-    * The class declaration string, with normalized spaces and sorted interface names.
153
-    * NOTE: does not include the keyword "abstract" or "final".
154
-    * 
155
-    * @return string
156
-    */
151
+    /**
152
+     * The class declaration string, with normalized spaces and sorted interface names.
153
+     * NOTE: does not include the keyword "abstract" or "final".
154
+     * 
155
+     * @return string
156
+     */
157 157
     public function getDeclaration() : string
158 158
     {
159 159
         $parts = array();
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
         return implode(' ', $parts);
174 174
     }
175 175
     
176
-   /**
177
-    * The keyword before "class", e.g. "abstract".
178
-    * @return string
179
-    */
176
+    /**
177
+     * The keyword before "class", e.g. "abstract".
178
+     * @return string
179
+     */
180 180
     public function getKeyword() : string
181 181
     {
182 182
         return $this->keyword;
Please login to merge, or discard this patch.
examples/URLInfo/highlighting.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@
 block discarded – undo
7 7
  * @author Sebastian Mordziol <[email protected]>
8 8
  */
9 9
 
10
-   /**
11
-    * Examples environment config
12
-    */
10
+    /**
11
+     * Examples environment config
12
+     */
13 13
     require_once '../prepend.php';
14 14
 
15 15
     use function AppUtils\parseURL;
Please login to merge, or discard this patch.
examples/prepend.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,33 +17,33 @@
 block discarded – undo
17 17
         die('<b>ERROR:</b> Autoloader not present. Run composer update first.');
18 18
     }
19 19
     
20
-   /**
21
-    * The composer autoloader
22
-    */
20
+    /**
21
+     * The composer autoloader
22
+     */
23 23
     require_once $autoload;
24 24
 
25
-   /**
26
-    * Translation global function.
27
-    * @return string
28
-    */
25
+    /**
26
+     * Translation global function.
27
+     * @return string
28
+     */
29 29
     function t()
30 30
     {
31 31
         return call_user_func_array('\AppLocalize\t', func_get_args());
32 32
     }
33 33
     
34
-   /**
35
-    * Translation global function.
36
-    * @return string
37
-    */
34
+    /**
35
+     * Translation global function.
36
+     * @return string
37
+     */
38 38
     function pt()
39 39
     {
40 40
         return call_user_func_array('\AppLocalize\pt', func_get_args());
41 41
     }
42 42
     
43
-   /**
44
-    * Translation global function.
45
-    * @return string
46
-    */
43
+    /**
44
+     * Translation global function.
45
+     * @return string
46
+     */
47 47
     function pts()
48 48
     {
49 49
         return call_user_func_array('\AppLocalize\pts', func_get_args());
Please login to merge, or discard this patch.
src/CSVHelper.php 1 patch
Indentation   +130 added lines, -130 removed lines patch added patch discarded remove patch
@@ -50,20 +50,20 @@  discard block
 block discarded – undo
50 50
         
51 51
     }
52 52
 
53
-   /**
54
-    * Creates and returns a new instance of the CSV builder which
55
-    * can be used to build CSV from scratch.
56
-    * 
57
-    * @return CSVHelper_Builder
58
-    */
53
+    /**
54
+     * Creates and returns a new instance of the CSV builder which
55
+     * can be used to build CSV from scratch.
56
+     * 
57
+     * @return CSVHelper_Builder
58
+     */
59 59
     public static function createBuilder()
60 60
     {
61 61
         return new CSVHelper_Builder();
62 62
     }
63 63
 
64
-   /**
65
-    * @var string
66
-    */
64
+    /**
65
+     * @var string
66
+     */
67 67
     protected $csv = '';
68 68
     
69 69
     protected $data = array();
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
     
73 73
     protected $headersPosition = self::HEADERS_NONE;
74 74
     
75
-   /**
76
-    * Loads CSV data from a string. 
77
-    * 
78
-    * Note: Use the {@link hasErrors()} method to 
79
-    * check if the string could be parsed correctly
80
-    * afterwards.
81
-    * 
82
-    * @param string $string
83
-    * @return CSVHelper
84
-    */
75
+    /**
76
+     * Loads CSV data from a string. 
77
+     * 
78
+     * Note: Use the {@link hasErrors()} method to 
79
+     * check if the string could be parsed correctly
80
+     * afterwards.
81
+     * 
82
+     * @param string $string
83
+     * @return CSVHelper
84
+     */
85 85
     public function loadString($string)
86 86
     {
87 87
         // remove any UTF byte order marks that may still be present in the string
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
         return $this;
96 96
     }
97 97
     
98
-   /**
99
-    * Loads CSV data from a file.
100
-    * 
101
-    * Note: Use the {@link hasErrors()} method to 
102
-    * check if the string could be parsed correctly
103
-    * afterwards.
104
-    * 
105
-    * @param string $file
106
-    * @throws FileHelper_Exception
107
-    * @return CSVHelper
108
-    * 
109
-    * @see FileHelper::ERROR_FILE_DOES_NOT_EXIST
110
-    * @see FileHelper::ERROR_CANNOT_READ_FILE_CONTENTS
111
-    */
98
+    /**
99
+     * Loads CSV data from a file.
100
+     * 
101
+     * Note: Use the {@link hasErrors()} method to 
102
+     * check if the string could be parsed correctly
103
+     * afterwards.
104
+     * 
105
+     * @param string $file
106
+     * @throws FileHelper_Exception
107
+     * @return CSVHelper
108
+     * 
109
+     * @see FileHelper::ERROR_FILE_DOES_NOT_EXIST
110
+     * @see FileHelper::ERROR_CANNOT_READ_FILE_CONTENTS
111
+     */
112 112
     public function loadFile(string $file) : CSVHelper
113 113
     {
114 114
         $csv = FileHelper::readContents($file);
@@ -122,28 +122,28 @@  discard block
 block discarded – undo
122 122
     
123 123
     protected $rowCount = 0;
124 124
     
125
-   /**
126
-    * Specifies that headers are positioned on top, horizontally.
127
-    * @return CSVHelper
128
-    */
125
+    /**
126
+     * Specifies that headers are positioned on top, horizontally.
127
+     * @return CSVHelper
128
+     */
129 129
     public function setHeadersTop()
130 130
     {
131 131
         return $this->setHeadersPosition(self::HEADERS_TOP);
132 132
     }
133 133
     
134
-   /**
135
-    * Specifies that headers are positioned on the left, vertically.
136
-    * @return CSVHelper
137
-    */
134
+    /**
135
+     * Specifies that headers are positioned on the left, vertically.
136
+     * @return CSVHelper
137
+     */
138 138
     public function setHeadersLeft()
139 139
     {
140 140
         return $this->setHeadersPosition(self::HEADERS_LEFT);
141 141
     }
142 142
     
143
-   /**
144
-    * Specifies that there are no headers in the file (default).
145
-    * @return CSVHelper
146
-    */
143
+    /**
144
+     * Specifies that there are no headers in the file (default).
145
+     * @return CSVHelper
146
+     */
147 147
     public function setHeadersNone()
148 148
     {
149 149
         return $this->setHeadersPosition(self::HEADERS_NONE);
@@ -173,18 +173,18 @@  discard block
 block discarded – undo
173 173
         return false;
174 174
     }
175 175
     
176
-   /**
177
-    * Specifies where the headers are positioned in the
178
-    * CSV, or turns them off entirely. Use the class constants
179
-    * to ensure the value is correct.
180
-    * 
181
-    * @param string $position
182
-    * @throws CSVHelper_Exception
183
-    * @return CSVHelper
184
-    * @see CSVHelper::HEADERS_LEFT
185
-    * @see CSVHelper::HEADERS_TOP
186
-    * @see CSVHelper::HEADERS_NONE
187
-    */
176
+    /**
177
+     * Specifies where the headers are positioned in the
178
+     * CSV, or turns them off entirely. Use the class constants
179
+     * to ensure the value is correct.
180
+     * 
181
+     * @param string $position
182
+     * @throws CSVHelper_Exception
183
+     * @return CSVHelper
184
+     * @see CSVHelper::HEADERS_LEFT
185
+     * @see CSVHelper::HEADERS_TOP
186
+     * @see CSVHelper::HEADERS_NONE
187
+     */
188 188
     public function setHeadersPosition($position)
189 189
     {
190 190
         $validPositions = array(
@@ -211,13 +211,13 @@  discard block
 block discarded – undo
211 211
         return $this;
212 212
     }
213 213
     
214
-   /**
215
-    * Resets all internal data, allowing to start entirely anew
216
-    * with a new file, or to start building a new CSV file from
217
-    * scratch.
218
-    * 
219
-    * @return CSVHelper
220
-    */
214
+    /**
215
+     * Resets all internal data, allowing to start entirely anew
216
+     * with a new file, or to start building a new CSV file from
217
+     * scratch.
218
+     * 
219
+     * @return CSVHelper
220
+     */
221 221
     public function reset()
222 222
     {
223 223
         $this->data = array();
@@ -234,19 +234,19 @@  discard block
 block discarded – undo
234 234
         return $this->data;
235 235
     }
236 236
     
237
-   /**
238
-    * Retrieves the row at the specified index.
239
-    * If there is no data at the index, this will
240
-    * return an array populated with empty strings
241
-    * for all available columns.
242
-    * 
243
-    * Tip: Use the {@link rowExists()} method to check
244
-    * whether the specified row exists.
245
-    * 
246
-    * @param integer $index
247
-    * @return array()
248
-    * @see rowExists()
249
-    */
237
+    /**
238
+     * Retrieves the row at the specified index.
239
+     * If there is no data at the index, this will
240
+     * return an array populated with empty strings
241
+     * for all available columns.
242
+     * 
243
+     * Tip: Use the {@link rowExists()} method to check
244
+     * whether the specified row exists.
245
+     * 
246
+     * @param integer $index
247
+     * @return array()
248
+     * @see rowExists()
249
+     */
250 250
     public function getRow($index)
251 251
     {
252 252
         if(isset($this->data[$index])) {
@@ -256,63 +256,63 @@  discard block
 block discarded – undo
256 256
         return array_fill(0, $this->rowCount, '');
257 257
     }
258 258
     
259
-   /**
260
-    * Checks whether the specified row exists in the data set.
261
-    * @param integer $index
262
-    * @return boolean
263
-    */
259
+    /**
260
+     * Checks whether the specified row exists in the data set.
261
+     * @param integer $index
262
+     * @return boolean
263
+     */
264 264
     public function rowExists($index)
265 265
     {
266 266
         return isset($this->data[$index]);
267 267
     }
268 268
     
269
-   /**
270
-    * Counts the amount of rows in the parsed CSV,
271
-    * excluding the headers if any, depending on 
272
-    * their position.
273
-    * 
274
-    * @return integer
275
-    */
269
+    /**
270
+     * Counts the amount of rows in the parsed CSV,
271
+     * excluding the headers if any, depending on 
272
+     * their position.
273
+     * 
274
+     * @return integer
275
+     */
276 276
     public function countRows()
277 277
     {
278 278
         return $this->rowCount;
279 279
     }
280 280
     
281
-   /**
282
-    * Counts the amount of rows in the parsed CSV, 
283
-    * excluding the headers if any, depending on
284
-    * their position.
285
-    * 
286
-    * @return integer
287
-    */
281
+    /**
282
+     * Counts the amount of rows in the parsed CSV, 
283
+     * excluding the headers if any, depending on
284
+     * their position.
285
+     * 
286
+     * @return integer
287
+     */
288 288
     public function countColumns()
289 289
     {
290 290
         return $this->columnCount;
291 291
     }
292 292
     
293
-   /**
294
-    * Retrieves the headers, if any. Specify the position of the
295
-    * headers first to ensure this works correctly.
296
-    * 
297
-    * @return array Indexed array with header names.
298
-    */
293
+    /**
294
+     * Retrieves the headers, if any. Specify the position of the
295
+     * headers first to ensure this works correctly.
296
+     * 
297
+     * @return array Indexed array with header names.
298
+     */
299 299
     public function getHeaders()
300 300
     {
301 301
         return $this->headers;
302 302
     }
303 303
     
304
-   /**
305
-    * Retrieves the column at the specified index. If there
306
-    * is no column at the index, this returns an array
307
-    * populated with empty strings.
308
-    * 
309
-    * Tip: Use the {@link columnExists()} method to check
310
-    * whether a column exists.
311
-    * 
312
-    * @param integer $index
313
-    * @return string[]
314
-    * @see columnExists()
315
-    */
304
+    /**
305
+     * Retrieves the column at the specified index. If there
306
+     * is no column at the index, this returns an array
307
+     * populated with empty strings.
308
+     * 
309
+     * Tip: Use the {@link columnExists()} method to check
310
+     * whether a column exists.
311
+     * 
312
+     * @param integer $index
313
+     * @return string[]
314
+     * @see columnExists()
315
+     */
316 316
     public function getColumn($index)
317 317
     {
318 318
         $data = array();
@@ -328,11 +328,11 @@  discard block
 block discarded – undo
328 328
         return $data;
329 329
     }
330 330
     
331
-   /**
332
-    * Checks whether the specified column exists in the data set.
333
-    * @param integer $index
334
-    * @return boolean
335
-    */
331
+    /**
332
+     * Checks whether the specified column exists in the data set.
333
+     * @param integer $index
334
+     * @return boolean
335
+     */
336 336
     public function columnExists($index)
337 337
     {
338 338
         if($index < $this->columnCount) {
@@ -396,22 +396,22 @@  discard block
 block discarded – undo
396 396
         }
397 397
     }
398 398
     
399
-   /**
400
-    * Checks whether any errors have been encountered
401
-    * while parsing the CSV.
402
-    * 
403
-    * @return boolean
404
-    * @see getErrorMessages()
405
-    */
399
+    /**
400
+     * Checks whether any errors have been encountered
401
+     * while parsing the CSV.
402
+     * 
403
+     * @return boolean
404
+     * @see getErrorMessages()
405
+     */
406 406
     public function hasErrors()
407 407
     {
408 408
         return !empty($this->errors);
409 409
     }
410 410
     
411
-   /**
412
-    * Retrieves all error messages.
413
-    * @return array
414
-    */
411
+    /**
412
+     * Retrieves all error messages.
413
+     * @return array
414
+     */
415 415
     public function getErrorMessages()
416 416
     {
417 417
         return $this->errors;
Please login to merge, or discard this patch.