@@ -88,21 +88,21 @@ discard block |
||
88 | 88 | { |
89 | 89 | // To provide debug information on line number processed |
90 | 90 | global $count; |
91 | - if (empty($count)) $count=1; |
|
91 | + if (empty($count)) $count = 1; |
|
92 | 92 | else $count++; |
93 | 93 | |
94 | - if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps |
|
94 | + if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps |
|
95 | 95 | $this->xml = $this->savxml; |
96 | - $tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values |
|
96 | + $tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values |
|
97 | 97 | |
98 | 98 | // Search all tags fou into condition to complete $tmpvars, so we will proceed all tests even if not defined |
99 | - $reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU'; |
|
99 | + $reg = '@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU'; |
|
100 | 100 | $matches = array(); |
101 | 101 | preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER); |
102 | 102 | //var_dump($tmpvars);exit; |
103 | 103 | foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it |
104 | - if (! empty($match[1]) && ! isset($tmpvars[$match[1]])) { |
|
105 | - $tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop |
|
104 | + if (!empty($match[1]) && !isset($tmpvars[$match[1]])) { |
|
105 | + $tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | // Remove the IF tag |
115 | 115 | $this->xml = str_replace('[!-- IF '.$key.' --]', '', $this->xml); |
116 | 116 | // Remove everything between the ELSE tag (if it exists) and the ENDIF tag |
117 | - $reg = '@(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
|
117 | + $reg = '@(\[!--\sELSE\s'.$key.'\s--\](.*))?\[!--\sENDIF\s'.$key.'\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
|
118 | 118 | $this->xml = preg_replace($reg, '', $this->xml); |
119 | 119 | } |
120 | 120 | // Else the value is false, then two cases: no ELSE and we're done, or there is at least one place where there is an ELSE clause, then we replace it |
121 | 121 | else { |
122 | 122 | // Find all conditional blocks for this variable: from IF to ELSE and to ENDIF |
123 | - $reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
|
123 | + $reg = '@\[!--\sIF\s'.$key.'\s--\](.*)(\[!--\sELSE\s'.$key.'\s--\](.*))?\[!--\sENDIF\s'.$key.'\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
|
124 | 124 | preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER); |
125 | 125 | foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause |
126 | 126 | if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->xmlParsed .= str_replace(array_keys($tmpvars), array_values($tmpvars), $this->xml); |
134 | 134 | if ($this->hasChildren()) { |
135 | 135 | foreach ($this->children as $child) { |
136 | - $this->xmlParsed = str_replace($child->xml, ($child->xmlParsed=="")?$child->merge():$child->xmlParsed, $this->xmlParsed); |
|
136 | + $this->xmlParsed = str_replace($child->xml, ($child->xmlParsed == "") ? $child->merge() : $child->xmlParsed, $this->xmlParsed); |
|
137 | 137 | $child->xmlParsed = ''; |
138 | 138 | } |
139 | 139 | } |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | $this->xmlParsed = $this->macroReplace($this->xmlParsed); |
144 | 144 | $this->file->open($this->odf->getTmpfile()); |
145 | 145 | foreach ($this->images as $imageKey => $imageValue) { |
146 | - if ($this->file->getFromName('Pictures/' . $imageValue) === false) { |
|
146 | + if ($this->file->getFromName('Pictures/'.$imageValue) === false) { |
|
147 | 147 | // Add the image inside the ODT document |
148 | - $this->file->addFile($imageKey, 'Pictures/' . $imageValue); |
|
148 | + $this->file->addFile($imageKey, 'Pictures/'.$imageValue); |
|
149 | 149 | // Add the image to the Manifest (which maintains a list of images, necessary to avoid "Corrupt ODT file. Repair?" when opening the file with LibreOffice) |
150 | 150 | $this->odf->addImageToManifest($imageValue); |
151 | 151 | } |
@@ -176,16 +176,16 @@ discard block |
||
176 | 176 | $dateinonemontharray = dol_get_next_month($hoy['mon'], $hoy['year']); |
177 | 177 | $nextMonth = $dateinonemontharray['month']; |
178 | 178 | |
179 | - $patterns=array( '/__CURRENTDAY__/u','/__CURENTWEEKDAY__/u', |
|
180 | - '/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u', |
|
181 | - '/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u', |
|
182 | - '/__CURRENTYEAR__/u','/__NEXTYEAR__/u' ); |
|
183 | - $values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['wday']), |
|
179 | + $patterns = array('/__CURRENTDAY__/u', '/__CURENTWEEKDAY__/u', |
|
180 | + '/__CURRENTMONTH__/u', '/__CURRENTMONTHLONG__/u', |
|
181 | + '/__NEXTMONTH__/u', '/__NEXTMONTHLONG__/u', |
|
182 | + '/__CURRENTYEAR__/u', '/__NEXTYEAR__/u'); |
|
183 | + $values = array($hoy['mday'], $langs->transnoentitiesnoconv($hoy['wday']), |
|
184 | 184 | $hoy['mon'], monthArray($langs)[$hoy['mon']], |
185 | 185 | $nextMonth, monthArray($langs)[$nextMonth], |
186 | - $hoy['year'], $hoy['year']+1 ); |
|
186 | + $hoy['year'], $hoy['year'] + 1); |
|
187 | 187 | |
188 | - $text=preg_replace($patterns, $values, $text); |
|
188 | + $text = preg_replace($patterns, $values, $text); |
|
189 | 189 | |
190 | 190 | return $text; |
191 | 191 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function setVars($key, $value, $encode = true, $charset = 'ISO-8859') |
225 | 225 | { |
226 | - $tag = $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT'); |
|
226 | + $tag = $this->odf->getConfig('DELIMITER_LEFT').$key.$this->odf->getConfig('DELIMITER_RIGHT'); |
|
227 | 227 | |
228 | 228 | if (strpos($this->xml, $tag) === false) { |
229 | 229 | //throw new SegmentException("var $key not found in {$this->getName()}"); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | if (array_key_exists($prop, $this->children)) { |
278 | 278 | return $this->children[$prop]; |
279 | 279 | } else { |
280 | - throw new SegmentException('child ' . $prop . ' does not exist'); |
|
280 | + throw new SegmentException('child '.$prop.' does not exist'); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | /** |
@@ -255,7 +255,7 @@ |
||
255 | 255 | foreach ($handlers as $handler) { |
256 | 256 | $assoc[$handler->getHandledKeyword()] = $handler; |
257 | 257 | } |
258 | - uasort($assoc, function ($a, $b) { |
|
258 | + uasort($assoc, function($a, $b) { |
|
259 | 259 | return $a->getPriorityOver($b->getHandledKeyword()); |
260 | 260 | }); |
261 | 261 | $this->handlers = $assoc; |
@@ -257,7 +257,7 @@ |
||
257 | 257 | } |
258 | 258 | $streamContext = stream_context_create($options); |
259 | 259 | |
260 | - set_error_handler(function ($type, $msg) { |
|
260 | + set_error_handler(function($type, $msg) { |
|
261 | 261 | throw new Swift_TransportException('Connection could not be established with host '.$this->params['host'].' :'.$msg); |
262 | 262 | }); |
263 | 263 | try { |
@@ -183,7 +183,7 @@ |
||
183 | 183 | { |
184 | 184 | list($domain, $username) = $this->getDomainAndUsername($username); |
185 | 185 | //$challenge, $context, $targetInfoH, $targetName, $domainName, $workstation, $DNSDomainName, $DNSServerName, $blob, $ter |
186 | - list($challenge, , , , , $workstation, , , $blob) = $this->parseMessage2($response); |
|
186 | + list($challenge,,,,, $workstation,,, $blob) = $this->parseMessage2($response); |
|
187 | 187 | |
188 | 188 | if (!$v2) { |
189 | 189 | // LMv1 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | require __DIR__.'/classes/Swift.php'; |
12 | 12 | |
13 | -Swift::registerAutoload(function () { |
|
13 | +Swift::registerAutoload(function() { |
|
14 | 14 | // Load in dependency maps |
15 | 15 | require __DIR__.'/dependency_maps/cache_deps.php'; |
16 | 16 | require __DIR__.'/dependency_maps/mime_deps.php'; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | namespace Egulias; |
8 | 8 | |
9 | -require_once __DIR__ . '/egulias/email-validator/AutoLoader.php'; |
|
9 | +require_once __DIR__.'/egulias/email-validator/AutoLoader.php'; |
|
10 | 10 | |
11 | 11 | $autoloader = new EguliasAutoLoader(__NAMESPACE__, dirname(__DIR__)); |
12 | 12 |
@@ -130,7 +130,7 @@ |
||
130 | 130 | */ |
131 | 131 | protected function addLongEmailWarning($localPart, $parsedDomainPart) |
132 | 132 | { |
133 | - if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAIL_MAX_LENGTH) { |
|
133 | + if (strlen($localPart.'@'.$parsedDomainPart) > self::EMAIL_MAX_LENGTH) { |
|
134 | 134 | $this->warnings[EmailTooLong::CODE] = new EmailTooLong(); |
135 | 135 | } |
136 | 136 | } |
@@ -10,6 +10,6 @@ |
||
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
13 | - $this->message = 'Email is too long, exceeds ' . EmailParser::EMAIL_MAX_LENGTH; |
|
13 | + $this->message = 'Email is too long, exceeds '.EmailParser::EMAIL_MAX_LENGTH; |
|
14 | 14 | } |
15 | 15 | } |
@@ -42,6 +42,6 @@ |
||
42 | 42 | |
43 | 43 | public function __toString() |
44 | 44 | { |
45 | - return $this->message() . " rfc: " . $this->rfcNumber . "interal code: " . static::CODE; |
|
45 | + return $this->message()." rfc: ".$this->rfcNumber."interal code: ".static::CODE; |
|
46 | 46 | } |
47 | 47 | } |