@@ -944,7 +944,7 @@ |
||
944 | 944 | } |
945 | 945 | break; |
946 | 946 | default: |
947 | - $parameters = array('vals' => $vals[$tplline],'object' => $object,'nbcharactbyline' => $nbcharactbyline); |
|
947 | + $parameters = array('vals' => $vals[$tplline], 'object' => $object, 'nbcharactbyline' => $nbcharactbyline); |
|
948 | 948 | $action = ''; |
949 | 949 | $reshook = $hookmanager->executeHooks('sendToPrinterAfter', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
950 | 950 |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | protected function findImport($url) |
99 | 99 | { |
100 | 100 | foreach ((array) $this->importDir as $dir) { |
101 | - $full = $dir.(substr($dir, -1) != '/' ? '/' : '').$url; |
|
102 | - if ($this->fileExists($file = $full.'.less') || $this->fileExists($file = $full)) { |
|
101 | + $full = $dir . (substr($dir, -1) != '/' ? '/' : '') . $url; |
|
102 | + if ($this->fileExists($file = $full . '.less') || $this->fileExists($file = $full)) { |
|
103 | 103 | return $file; |
104 | 104 | } |
105 | 105 | } |
@@ -250,9 +250,9 @@ discard block |
||
250 | 250 | $this->compileMedia($block); |
251 | 251 | break; |
252 | 252 | case "directive": |
253 | - $name = "@".$block->name; |
|
253 | + $name = "@" . $block->name; |
|
254 | 254 | if (!empty($block->value)) { |
255 | - $name .= " ".$this->compileValue($this->reduce($block->value)); |
|
255 | + $name .= " " . $this->compileValue($this->reduce($block->value)); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | $this->compileNestedBlock($block, array($name)); |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | break; |
425 | 425 | case "mediaExp": |
426 | 426 | if (isset($q[2])) { |
427 | - $parts[] = "($q[1]: ". |
|
428 | - $this->compileValue($this->reduce($q[2])).")"; |
|
427 | + $parts[] = "($q[1]: " . |
|
428 | + $this->compileValue($this->reduce($q[2])) . ")"; |
|
429 | 429 | } else { |
430 | 430 | $parts[] = "($q[1])"; |
431 | 431 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | $out = "@media"; |
445 | 445 | if (!empty($parts)) { |
446 | - $out .= " ". |
|
446 | + $out .= " " . |
|
447 | 447 | implode($this->formatter->selectorSeparator, $compiledQueries); |
448 | 448 | } |
449 | 449 | return $out; |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | if ($count > 0) { |
531 | 531 | $out[] = trim($child); |
532 | 532 | } else { |
533 | - $out[] = trim($parent.' '.$child); |
|
533 | + $out[] = trim($parent . ' ' . $child); |
|
534 | 534 | } |
535 | 535 | } |
536 | 536 | } |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $value = $a[2]; |
736 | 736 | } else { |
737 | 737 | $value = null; // :( |
738 | - $this->throwError("Failed to assign arg ".$a[1]); // This ends function by throwing an exception |
|
738 | + $this->throwError("Failed to assign arg " . $a[1]); // This ends function by throwing an exception |
|
739 | 739 | } |
740 | 740 | |
741 | 741 | $value = $this->reduce($value); |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | $orderedArgs[] = $this->reduce($arg[1]); |
801 | 801 | break; |
802 | 802 | default: |
803 | - $this->throwError("Unknown arg type: ".$arg[0]); |
|
803 | + $this->throwError("Unknown arg type: " . $arg[0]); |
|
804 | 804 | } |
805 | 805 | } |
806 | 806 | |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | break; |
866 | 866 | case "directive": |
867 | 867 | list(, $name, $value) = $prop; |
868 | - $out->lines[] = "@$name ".$this->compileValue($this->reduce($value)).';'; |
|
868 | + $out->lines[] = "@$name " . $this->compileValue($this->reduce($value)) . ';'; |
|
869 | 869 | break; |
870 | 870 | case "comment": |
871 | 871 | $out->lines[] = $prop[1]; |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | $result = $this->tryImport($importPath, $block, $out); |
882 | 882 | |
883 | 883 | $this->env->imports[$importId] = $result === false ? |
884 | - array(false, "@import ".$this->compileValue($importPath).";") : $result; |
|
884 | + array(false, "@import " . $this->compileValue($importPath) . ";") : $result; |
|
885 | 885 | |
886 | 886 | break; |
887 | 887 | case "import_mixin": |
@@ -936,7 +936,7 @@ discard block |
||
936 | 936 | if ($this->numberPrecision !== null) { |
937 | 937 | $num = round($num, $this->numberPrecision); |
938 | 938 | } |
939 | - return $num.$unit; |
|
939 | + return $num . $unit; |
|
940 | 940 | case 'string': |
941 | 941 | // [1] - contents of string (includes quotes) |
942 | 942 | list(, $delim, $content) = $value; |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | $part = $this->compileValue($part); |
946 | 946 | } |
947 | 947 | } |
948 | - return $delim.implode($content).$delim; |
|
948 | + return $delim . implode($content) . $delim; |
|
949 | 949 | case 'color': |
950 | 950 | // [1] - red component (either number or a %) |
951 | 951 | // [2] - green component |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | $b = round($b); |
958 | 958 | |
959 | 959 | if (count($value) == 5 && $value[4] != 1) { // rgba |
960 | - return 'rgba('.$r.','.$g.','.$b.','.$value[4].')'; |
|
960 | + return 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $value[4] . ')'; |
|
961 | 961 | } |
962 | 962 | |
963 | 963 | $h = sprintf("#%02x%02x%02x", $r, $g, $b); |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | if (!empty($this->formatter->compressColors)) { |
966 | 966 | // Converting hex color to short notation (e.g. #003399 to #039) |
967 | 967 | if ($h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6]) { |
968 | - $h = '#'.$h[1].$h[3].$h[5]; |
|
968 | + $h = '#' . $h[1] . $h[3] . $h[5]; |
|
969 | 969 | } |
970 | 970 | } |
971 | 971 | |
@@ -973,7 +973,7 @@ discard block |
||
973 | 973 | |
974 | 974 | case 'function': |
975 | 975 | list(, $name, $args) = $value; |
976 | - return $name.'('.$this->compileValue($args).')'; |
|
976 | + return $name . '(' . $this->compileValue($args) . ')'; |
|
977 | 977 | default: // assumed to be unit |
978 | 978 | $this->throwError("unknown value type: $value[0]"); |
979 | 979 | } |
@@ -1138,7 +1138,7 @@ discard block |
||
1138 | 1138 | } |
1139 | 1139 | } |
1140 | 1140 | |
1141 | - return 'url("'.$url.'")'; |
|
1141 | + return 'url("' . $url . '")'; |
|
1142 | 1142 | } |
1143 | 1143 | |
1144 | 1144 | // utility func to unquote a string |
@@ -1186,7 +1186,7 @@ discard block |
||
1186 | 1186 | $i++; |
1187 | 1187 | $rep = $this->compileValue($this->lib_e($val)); |
1188 | 1188 | $template = preg_replace( |
1189 | - '/'.self::preg_quote($match).'/', |
|
1189 | + '/' . self::preg_quote($match) . '/', |
|
1190 | 1190 | $rep, |
1191 | 1191 | $template, |
1192 | 1192 | 1 |
@@ -1539,7 +1539,7 @@ discard block |
||
1539 | 1539 | $numValues = count($values); |
1540 | 1540 | if ($expectedArgs != $numValues) { |
1541 | 1541 | if ($name) { |
1542 | - $name = $name.": "; |
|
1542 | + $name = $name . ": "; |
|
1543 | 1543 | } |
1544 | 1544 | |
1545 | 1545 | $this->throwError("{$name}expecting $expectedArgs arguments, got $numValues"); |
@@ -1731,7 +1731,7 @@ discard block |
||
1731 | 1731 | case "interpolate": |
1732 | 1732 | $reduced = $this->reduce($value[1]); |
1733 | 1733 | $var = $this->compileValue($reduced); |
1734 | - $res = $this->reduce(array("variable", $this->vPrefix.$var)); |
|
1734 | + $res = $this->reduce(array("variable", $this->vPrefix . $var)); |
|
1735 | 1735 | |
1736 | 1736 | if ($res[0] == "raw_color") { |
1737 | 1737 | $res = $this->coerceColor($res); |
@@ -1746,7 +1746,7 @@ discard block |
||
1746 | 1746 | $key = $value[1]; |
1747 | 1747 | if (is_array($key)) { |
1748 | 1748 | $key = $this->reduce($key); |
1749 | - $key = $this->vPrefix.$this->compileValue($this->lib_e($key)); |
|
1749 | + $key = $this->vPrefix . $this->compileValue($this->lib_e($key)); |
|
1750 | 1750 | } |
1751 | 1751 | |
1752 | 1752 | $seen = & $this->env->seenNames; |
@@ -1792,7 +1792,7 @@ discard block |
||
1792 | 1792 | } |
1793 | 1793 | |
1794 | 1794 | $f = isset($this->libFunctions[$name]) ? |
1795 | - $this->libFunctions[$name] : array($this, 'lib_'.str_replace('-', '_', $name)); |
|
1795 | + $this->libFunctions[$name] : array($this, 'lib_' . str_replace('-', '_', $name)); |
|
1796 | 1796 | |
1797 | 1797 | if (is_callable($f)) { |
1798 | 1798 | if ($args[0] == 'list') { |
@@ -1868,7 +1868,7 @@ discard block |
||
1868 | 1868 | $t = intval($num) % $width; |
1869 | 1869 | $num /= $width; |
1870 | 1870 | |
1871 | - $c[$i] = $t * (256 / $width) + $t * floor(16/$width); |
|
1871 | + $c[$i] = $t * (256 / $width) + $t * floor(16 / $width); |
|
1872 | 1872 | } |
1873 | 1873 | |
1874 | 1874 | return $c; |
@@ -1957,7 +1957,7 @@ discard block |
||
1957 | 1957 | // make the expression look it did before being parsed |
1958 | 1958 | $paddedOp = $op; |
1959 | 1959 | if ($whiteBefore) { |
1960 | - $paddedOp = " ".$paddedOp; |
|
1960 | + $paddedOp = " " . $paddedOp; |
|
1961 | 1961 | } |
1962 | 1962 | if ($whiteAfter) { |
1963 | 1963 | $paddedOp .= " "; |
@@ -2047,7 +2047,7 @@ discard block |
||
2047 | 2047 | $out[] = $lval / $rval; |
2048 | 2048 | break; |
2049 | 2049 | default: |
2050 | - $this->throwError('evaluate error: color op number failed on op '.$op); |
|
2050 | + $this->throwError('evaluate error: color op number failed on op ' . $op); |
|
2051 | 2051 | } |
2052 | 2052 | } |
2053 | 2053 | return $this->fixColor($out); |
@@ -2118,7 +2118,7 @@ discard block |
||
2118 | 2118 | case '=<': |
2119 | 2119 | return $this->toBool($left[1] <= $right[1]); |
2120 | 2120 | default: |
2121 | - $this->throwError('parse error: unknown number operator: '.$op); |
|
2121 | + $this->throwError('parse error: unknown number operator: ' . $op); |
|
2122 | 2122 | } |
2123 | 2123 | |
2124 | 2124 | return array("number", $value, $unit); |
@@ -2170,7 +2170,7 @@ discard block |
||
2170 | 2170 | { |
2171 | 2171 | $current = $this->env; |
2172 | 2172 | |
2173 | - $isArguments = $name == $this->vPrefix.'arguments'; |
|
2173 | + $isArguments = $name == $this->vPrefix . 'arguments'; |
|
2174 | 2174 | while ($current) { |
2175 | 2175 | if ($isArguments && isset($current->arguments)) { |
2176 | 2176 | return array('list', ' ', $current->arguments); |
@@ -2195,7 +2195,7 @@ discard block |
||
2195 | 2195 | $value = null; |
2196 | 2196 | foreach ($args as $name => $strValue) { |
2197 | 2197 | if ($name[0] !== '@') { |
2198 | - $name = '@'.$name; |
|
2198 | + $name = '@' . $name; |
|
2199 | 2199 | } |
2200 | 2200 | $parser->count = 0; |
2201 | 2201 | $parser->buffer = (string) $strValue; |
@@ -2249,7 +2249,7 @@ discard block |
||
2249 | 2249 | public function compileFile($fname, $outFname = null) |
2250 | 2250 | { |
2251 | 2251 | if (!is_readable($fname)) { |
2252 | - throw new Exception('load error: failed to find '.$fname); |
|
2252 | + throw new Exception('load error: failed to find ' . $fname); |
|
2253 | 2253 | } |
2254 | 2254 | |
2255 | 2255 | $pi = pathinfo($fname); |
@@ -2257,7 +2257,7 @@ discard block |
||
2257 | 2257 | $oldImport = $this->importDir; |
2258 | 2258 | |
2259 | 2259 | $this->importDir = (array) $this->importDir; |
2260 | - $this->importDir[] = $pi['dirname'].'/'; |
|
2260 | + $this->importDir[] = $pi['dirname'] . '/'; |
|
2261 | 2261 | |
2262 | 2262 | $this->addParsedFile($fname); |
2263 | 2263 |
@@ -428,7 +428,7 @@ |
||
428 | 428 | // Sanitize to avoid stream execution when calling file_size(). Not that this is a second security because |
429 | 429 | // most streams are already disabled by stream_wrapper_unregister() in filefunc.inc.php |
430 | 430 | $uploaded_file = preg_replace('/\s*(http|ftp)s?:/i', '', $uploaded_file); |
431 | - $uploaded_file = realpath($uploaded_file); // A hack to be sure the file point to an existing file on disk (and is not a SSRF attack) |
|
431 | + $uploaded_file = realpath($uploaded_file); // A hack to be sure the file point to an existing file on disk (and is not a SSRF attack) |
|
432 | 432 | |
433 | 433 | $validate = $this->validate($uploaded_file, $file, $error, $index); |
434 | 434 |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | } elseif ($this->type == 'html') { |
899 | 899 | $out .= $this->generateInputFieldHtml(); |
900 | 900 | } elseif ($this->type == 'color') { |
901 | - $out .= $this->generateInputFieldColor(); |
|
901 | + $out .= $this->generateInputFieldColor(); |
|
902 | 902 | } elseif ($this->type == 'yesno') { |
903 | 903 | if (!empty($conf->use_javascript_ajax)) { |
904 | 904 | $out .= ajax_constantonoff($this->confKey); |
@@ -1209,9 +1209,9 @@ discard block |
||
1209 | 1209 | } elseif ($this->type == 'selectUser') { |
1210 | 1210 | $out .= $this->generateOutputFieldSelectUser(); |
1211 | 1211 | } elseif ($this->type == 'html') { |
1212 | - $out .= $this->fieldValue; |
|
1212 | + $out .= $this->fieldValue; |
|
1213 | 1213 | } elseif ($this->type == 'color') { |
1214 | - $out .= $this->generateOutputFieldColor(); |
|
1214 | + $out .= $this->generateOutputFieldColor(); |
|
1215 | 1215 | } elseif ($this->type == 'yesno') { |
1216 | 1216 | if (!empty($conf->use_javascript_ajax)) { |
1217 | 1217 | $out .= ajax_constantonoff($this->confKey, array(), $this->entity); // TODO possibility to add $input parameter |
@@ -113,7 +113,7 @@ |
||
113 | 113 | $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
114 | 114 | } else { |
115 | 115 | $disabled = 0; |
116 | - if (!$obj->fk_statut > 0 && ! $draftonly) { |
|
116 | + if (!$obj->fk_statut > 0 && !$draftonly) { |
|
117 | 117 | $disabled = 1; |
118 | 118 | $labeltoshow .= ' (' . $langs->trans("Draft") . ')'; |
119 | 119 | } |
@@ -387,7 +387,7 @@ |
||
387 | 387 | |
388 | 388 | $out .= '<div class="template-option" data-template="' . $template . '" data-content="' . htmlentities($contentHtml) . '">'; |
389 | 389 | $out .= '<img class="maillayout" alt="' . $template . '" src="' . constant('DOL_URL_ROOT') . '/theme/common/maillayout/' . $template . '.png" />'; |
390 | - $out .= '<span class="template-option-text">' . ($template != 'text' ? ucfirst($template) : ucfirst($templateFunction)) . '</span>'; |
|
390 | + $out .= '<span class="template-option-text">' . ($template != 'text' ? ucfirst($template) : ucfirst($templateFunction)) . '</span>'; |
|
391 | 391 | $out .= '</div>'; |
392 | 392 | } |
393 | 393 | $out .= '<input type="hidden" name="sample" value="" />'; |
@@ -886,7 +886,7 @@ |
||
886 | 886 | $maxfilesizearray = getMaxFileSizeArray(); |
887 | 887 | $maxmin = $maxfilesizearray['maxmin']; |
888 | 888 | if ($maxmin > 0) { |
889 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
889 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
890 | 890 | } |
891 | 891 | // Can add other files |
892 | 892 | if (!getDolGlobalString('FROM_MAIL_DONT_USE_INPUT_FILE_MULTIPLE')) { |
@@ -78,7 +78,7 @@ |
||
78 | 78 | if (!empty($selected) && $selected == $key) { |
79 | 79 | $html .= '<option value="' . $key . '" selected>'; |
80 | 80 | } else { |
81 | - $html .= '<option value="' . $key . '">'; |
|
81 | + $html .= '<option value="' . $key . '">'; |
|
82 | 82 | } |
83 | 83 | $html .= $langs->trans($val); |
84 | 84 | $html .= '</option>'; |
@@ -290,7 +290,7 @@ |
||
290 | 290 | '@phan-var-force array<string,CommonHookActions> $modules'; |
291 | 291 | // Loop on each active hooks of module for this context |
292 | 292 | foreach ($modules as $module => $actionclassinstance) { |
293 | - $module = preg_replace('/^\d+:/', '', $module); // $module string is 'priority:module' |
|
293 | + $module = preg_replace('/^\d+:/', '', $module); // $module string is 'priority:module' |
|
294 | 294 | //print "Before hook ".get_class($actionclassinstance)." method=".$method." module=".$module." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction."<br>\n"; |
295 | 295 | |
296 | 296 | // test to avoid running twice a hook, when a module implements several active contexts |