@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** Converts $val into a \DateTime object if it's not already */ |
| 12 | 12 | private function getDate($val) { |
| 13 | 13 | $tz = new \DateTimeZone($this->locale['timezone']); |
| 14 | - $date = $val instanceof \DateTime ? $val : new \DateTime($val, $tz); |
|
| 14 | + $date = $val instanceof \DateTime ? $val : new \DateTime($val, $tz); |
|
| 15 | 15 | $date->setTimeZone($tz); |
| 16 | 16 | return $date; |
| 17 | 17 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | /** Formats \DateTime as Date and Time using formats from $locale */ |
| 32 | 32 | public function dateTime($val) { |
| 33 | - return $this->date($val, $this->locale['date_format'] . ' ' . $this->locale['time_format']); |
|
| 33 | + return $this->date($val, $this->locale['date_format'].' '.$this->locale['time_format']); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** Generates relative time offsets based on system clock. e.g "10 minutes ago" or "In 6 months" |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $diff = $now->diff($date); |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - $diffDays = $diff->invert === 1 ? $diff->days : 0- $diff->days; |
|
| 45 | + $diffDays = $diff->invert === 1 ? $diff->days : 0-$diff->days; |
|
| 46 | 46 | |
| 47 | 47 | if ($diffDays !== 0) return $this->dayOffset($diffDays); |
| 48 | 48 | else return $this->timeOffset($diff); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | /** Gets date ranges to represent uses of weeks/months/days/etc */ |
| 70 | 70 | private function getRanges($strings) { |
| 71 | - $ranges = [ |
|
| 71 | + $ranges = [ |
|
| 72 | 72 | [1, 1, $strings['yesterday'], 1, ''], |
| 73 | 73 | [1, 13, $strings['past'], 1, 'days'], |
| 74 | 74 | [13, 28, $strings['past'], 7, 'weeks'], |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | /** Converts "week" to "weeks", "month" to "months" etc when plural is required using language from $locale */ |
| 89 | 89 | private function getPlural($strings, $num, $interval) { |
| 90 | - if ($interval !== '') return $num == 1 ? $strings[$interval . '_singular'] : $strings[$interval . '_plural']; |
|
| 90 | + if ($interval !== '') return $num == 1 ? $strings[$interval.'_singular'] : $strings[$interval.'_plural']; |
|
| 91 | 91 | else return ''; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function currency($num) { |
| 15 | 15 | $num = $this->decimal($num, $this->locale['currency_decimals']); |
| 16 | - if ($this->locale['currency_position'] === 'before') return $this->locale['currency'] . $num; |
|
| 17 | - else return $num . $this->locale['currency']; |
|
| 16 | + if ($this->locale['currency_position'] === 'before') return $this->locale['currency'].$num; |
|
| 17 | + else return $num.$this->locale['currency']; |
|
| 18 | 18 | } |
| 19 | 19 | } |
| 20 | 20 | \ No newline at end of file |
@@ -39,9 +39,9 @@ |
||
| 39 | 39 | $num = (int) $frequency; |
| 40 | 40 | $unit = strtoupper(trim(str_replace($num, '', $frequency))); |
| 41 | 41 | |
| 42 | - $offset = $num * constant(self::class . '::' . $unit); |
|
| 42 | + $offset = $num * constant(self::class.'::'.$unit); |
|
| 43 | 43 | |
| 44 | - if ($time > $this->lastRun + $offset) return true; |
|
| 44 | + if ($time > $this->lastRun+$offset) return true; |
|
| 45 | 45 | else return false; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | $string = $this->extractString($i); |
| 106 | 106 | $length = strlen($string)+1; |
| 107 | 107 | $char = $this->getChar($char); |
| 108 | - $string = str_replace('\\' . $char, $char, $string); |
|
| 108 | + $string = str_replace('\\'.$char, $char, $string); |
|
| 109 | 109 | $tokens[] = ['type' => self::STRING, 'value' => $string]; |
| 110 | 110 | return $length; |
| 111 | 111 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * @version 1.0 */ |
| 7 | 7 | namespace Transphporm\TSSFunction; |
| 8 | 8 | /* Handles data() and iteration() function calls from the stylesheet */ |
| 9 | -class Data implements \Transphporm\TSSFunction{ |
|
| 9 | +class Data implements \Transphporm\TSSFunction { |
|
| 10 | 10 | private $data; |
| 11 | 11 | private $dataKey; |
| 12 | 12 | private $functionSet; |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | if ($token['type'] === $tokenType) $i++; |
| 79 | 79 | else $splitTokens[$i][] = $token; |
| 80 | 80 | } |
| 81 | - return array_map(function ($tokens) { |
|
| 81 | + return array_map(function($tokens) { |
|
| 82 | 82 | return new Tokens($tokens); |
| 83 | 83 | }, $splitTokens); |
| 84 | 84 | //return $splitTokens; |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | namespace Transphporm; |
| 3 | 3 | class RunException extends \Exception { |
| 4 | 4 | public function __construct($operationType, $operationName, \Exception $previous) { |
| 5 | - $message = 'TSS Error: Problem carrying out ' . $operationType . ' \'' . $operationName . '\''; |
|
| 5 | + $message = 'TSS Error: Problem carrying out '.$operationType.' \''.$operationName.'\''; |
|
| 6 | 6 | |
| 7 | 7 | parent::__construct($message, 0, $previous); |
| 8 | 8 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | const FORMATTER = 'formatter'; |
| 8 | 8 | |
| 9 | 9 | public function __construct(RunException $runException, $file, $line) { |
| 10 | - $message = $runException->getMessage() . ' on Line ' . $line . ' of ' . ($file === null ? 'tss' : $file); |
|
| 10 | + $message = $runException->getMessage().' on Line '.$line.' of '.($file === null ? 'tss' : $file); |
|
| 11 | 11 | |
| 12 | 12 | parent::__construct($message, 0, $runException->getPrevious()); |
| 13 | 13 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | private function getCacheKey($file) { |
| 28 | - return $file . $this->prefix . dirname(realpath($file)) . DIRECTORY_SEPARATOR; |
|
| 28 | + return $file.$this->prefix.dirname(realpath($file)).DIRECTORY_SEPARATOR; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function load($tss) { |