@@ -45,7 +45,7 @@ |
||
| 45 | 45 | |
| 46 | 46 | static function decodeClassId($s) { |
| 47 | 47 | $out = $m = array(); |
| 48 | - if(preg_match('/^[a-zA-Z0-9\_]+/', $s, $m)) |
|
| 48 | + if (preg_match('/^[a-zA-Z0-9\_]+/', $s, $m)) |
|
| 49 | 49 | $out['type'] = $m[0]; |
| 50 | 50 | preg_match_all('/[#\.][a-zA-Z0-9\-\_]+/m', $s, $m); |
| 51 | 51 | if (isset($m[0])) foreach ($m[0] as $s) { |
@@ -34,11 +34,11 @@ |
||
| 34 | 34 | * @param string $class Class name to be autoloaded |
| 35 | 35 | */ |
| 36 | 36 | spl_autoload_register(function($class) {
|
| 37 | - if(strpos($class, "Seufert\\Hamle\\") === 0) {
|
|
| 37 | + if (strpos($class, "Seufert\\Hamle\\") === 0) {
|
|
| 38 | 38 | $s = DIRECTORY_SEPARATOR; |
| 39 | - $class = str_replace("\\",$s,substr($class,14));
|
|
| 39 | + $class = str_replace("\\", $s, substr($class, 14));
|
|
| 40 | 40 | $path = __DIR__.$s."hamle".$s."$class.php"; |
| 41 | - if(is_file($path)) include_once($path); |
|
| 41 | + if (is_file($path)) include_once($path); |
|
| 42 | 42 | } |
| 43 | -},true,true); |
|
| 43 | +},true, true); |
|
| 44 | 44 | |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function cachePath($f) {
|
| 42 | 42 | $s = DIRECTORY_SEPARATOR; |
| 43 | - $dir = implode($s,[__DIR__,"..","..","cache",""]); |
|
| 44 | - if(!is_dir($dir)) mkdir($dir); |
|
| 43 | + $dir = implode($s, [__DIR__, "..", "..", "cache", ""]); |
|
| 44 | + if (!is_dir($dir)) mkdir($dir); |
|
| 45 | 45 | return $dir.$f; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @throws Exception\RunTime |
| 68 | 68 | */ |
| 69 | 69 | public function getModelTypeID($typeId, $sort = [], $limit = 0, $offset = 0) {
|
| 70 | - if(count($typeId) > 1) |
|
| 70 | + if (count($typeId) > 1) |
|
| 71 | 71 | throw new Exception\RunTime("Unable to open more than one ID at a time");
|
| 72 | 72 | return new Model\Zero(); |
| 73 | 73 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | function __construct($message = "", $code = 0, $previous = NULL) { |
| 34 | 34 | ///@todo Include Line number & file name within parse error exceptions |
| 35 | - $message .= ", on line " . Hamle\Hamle::getLineNo() . " in file ?.hamle"; |
|
| 35 | + $message .= ", on line ".Hamle\Hamle::getLineNo()." in file ?.hamle"; |
|
| 36 | 36 | parent::__construct($message, $code, $previous); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -144,11 +144,11 @@ discard block |
||
| 144 | 144 | //if(strtoupper($this->type) == "A") var_dump($this); |
| 145 | 145 | $ind = $doIndent ? str_pad("", $indent, " ") : "";
|
| 146 | 146 | $oneliner = ((count($this->content) > 1 || $this->tags) ? false : true); |
| 147 | - $out = $ind . $this->renderStTag() . ($oneliner ? "" : "\n"); |
|
| 147 | + $out = $ind.$this->renderStTag().($oneliner ? "" : "\n"); |
|
| 148 | 148 | if ($this->content) $out .= $this->renderContent($ind, $oneliner); |
| 149 | 149 | foreach ($this->tags as $tag) |
| 150 | 150 | $out .= $tag->render($indent + self::INDENT_SIZE); |
| 151 | - $out .= ($oneliner ? "" : $ind) . $this->renderEnTag() . "\n"; |
|
| 151 | + $out .= ($oneliner ? "" : $ind).$this->renderEnTag()."\n"; |
|
| 152 | 152 | return $out; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | function renderContent($pad = "", $oneliner = false) {
|
| 163 | 163 | $out = ""; |
| 164 | 164 | foreach ($this->content as $c) |
| 165 | - $out .= ($oneliner ? "" : $pad) . $c . ($oneliner ? "" : "\n"); |
|
| 165 | + $out .= ($oneliner ? "" : $pad).$c.($oneliner ? "" : "\n"); |
|
| 166 | 166 | return $out; |
| 167 | 167 | } |
| 168 | 168 | |
@@ -112,19 +112,19 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | function getValue() {
|
| 114 | 114 | if (!is_null($this->setValue)) return $this->setValue; |
| 115 | - if (isset($_REQUEST[$this->form . "_" . $this->name])) {
|
|
| 115 | + if (isset($_REQUEST[$this->form."_".$this->name])) {
|
|
| 116 | 116 | if (get_magic_quotes_runtime()) |
| 117 | - return stripslashes($_REQUEST[$this->form . "_" . $this->name]); |
|
| 117 | + return stripslashes($_REQUEST[$this->form."_".$this->name]); |
|
| 118 | 118 | else |
| 119 | - return $_REQUEST[$this->form . "_" . $this->name]; |
|
| 119 | + return $_REQUEST[$this->form."_".$this->name]; |
|
| 120 | 120 | } |
| 121 | 121 | return $this->opt['default']; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | function getInputAttStatic(&$atts, &$type, &$content) {
|
| 125 | - $atts['id'] = $atts['name'] = $this->form . "_" . $this->name; |
|
| 125 | + $atts['id'] = $atts['name'] = $this->form."_".$this->name; |
|
| 126 | 126 | $atts['type'] = "text"; |
| 127 | - $atts['class'][] = str_replace(['Seufert\\','\\'],['','_'],get_class($this)); |
|
| 127 | + $atts['class'][] = str_replace(['Seufert\\', '\\'], ['', '_'], get_class($this)); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | function getInputAttDynamic(&$atts, &$type, &$content) {
|
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | function getLabelAttStatic(&$atts, &$type, &$content) {
|
| 145 | - $atts['class'][] = str_replace(['Seufert\\','\\'],['','_'],get_class($this)); |
|
| 146 | - $atts["for"] = $this->form . "_" . $this->name; |
|
| 145 | + $atts['class'][] = str_replace(['Seufert\\', '\\'], ['', '_'], get_class($this)); |
|
| 146 | + $atts["for"] = $this->form."_".$this->name; |
|
| 147 | 147 | $content = array($this->opt['label']); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | function getHintAttStatic(&$atts, &$type, &$content) {
|
| 154 | - $atts['class'][] = str_replace(['Seufert\\','\\'],['','_'],get_class($this)); |
|
| 154 | + $atts['class'][] = str_replace(['Seufert\\', '\\'], ['', '_'], get_class($this)); |
|
| 155 | 155 | $atts['class'][] = "hamleFormHint"; |
| 156 | 156 | } |
| 157 | 157 | |
@@ -42,6 +42,6 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | function isClicked() { |
| 45 | - return isset($_REQUEST[$this->form . "_" . $this->name]); |
|
| 45 | + return isset($_REQUEST[$this->form."_".$this->name]); |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | \ No newline at end of file |
@@ -42,8 +42,8 @@ |
||
| 42 | 42 | |
| 43 | 43 | function getValue() { |
| 44 | 44 | if (!is_null($this->setValue)) return $this->setValue; |
| 45 | - if (isset($_REQUEST[$this->form . "__submit"])) |
|
| 46 | - return isset($_REQUEST[$this->form . "_" . $this->name]); |
|
| 45 | + if (isset($_REQUEST[$this->form."__submit"])) |
|
| 46 | + return isset($_REQUEST[$this->form."_".$this->name]); |
|
| 47 | 47 | return $this->opt['default']; |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | \ No newline at end of file |
@@ -101,15 +101,15 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | function doEval() { |
| 104 | - return eval('return ' . $this->toPHP() . ';'); |
|
| 104 | + return eval('return '.$this->toPHP().';'); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | static function varToCode($var) { |
| 108 | 108 | if (is_array($var)) { |
| 109 | 109 | $code = array(); |
| 110 | 110 | foreach ($var as $key => $value) |
| 111 | - $code[] = self::varToCode($key) . "=>" . self::varToCode($value); |
|
| 112 | - return 'array(' . implode(",", $code) . ')'; //remove unnecessary coma |
|
| 111 | + $code[] = self::varToCode($key)."=>".self::varToCode($value); |
|
| 112 | + return 'array('.implode(",", $code).')'; //remove unnecessary coma |
|
| 113 | 113 | } elseif (is_bool($var)) { |
| 114 | 114 | return ($var ? 'TRUE' : 'FALSE'); |
| 115 | 115 | } elseif (is_int($var) || is_float($var) || is_numeric($var)) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } elseif ($var instanceof Text) { |
| 118 | 118 | return $var->toPHP(); |
| 119 | 119 | } else { |
| 120 | - return "'" . str_replace(array('$', "'"), array('\\$', "\\'"), $var) . "'"; |
|
| 120 | + return "'".str_replace(array('$', "'"), array('\\$', "\\'"), $var)."'"; |
|
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |