@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | //Searching for the page break tag |
85 | 85 | $breakTagPosition = strpos($text, "<!-- EndOfExcerptBlogOc -->"); |
86 | - if($breakTagPosition > 0){ |
|
86 | + if ($breakTagPosition > 0) { |
|
87 | 87 | return $this->completeDom(substr($text, 0, $breakTagPosition)); |
88 | 88 | } |
89 | 89 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $string = preg_split('/(<img[^>]+\>)|(<p[^>]+\>)|(<span[^>]+\>)|\s/', $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); |
92 | 92 | |
93 | 93 | //The preg split can return false, probably will never happen but just in case. |
94 | - if(!$string) |
|
94 | + if (!$string) |
|
95 | 95 | { |
96 | 96 | throw new \Error("excerpt generation failed"); |
97 | 97 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $trimed .= $string[$wordCounter]; |
105 | 105 | if ($wordCounter < $count - 1) { |
106 | 106 | $trimed .= " "; |
107 | - } else { |
|
107 | + }else { |
|
108 | 108 | $trimed .= "[...]"; |
109 | 109 | } |
110 | 110 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $result = true; |
156 | 156 | foreach ($strings as $string) |
157 | 157 | { |
158 | - if(!$this->isAlphaNum($string)) |
|
158 | + if (!$this->isAlphaNum($string)) |
|
159 | 159 | { |
160 | 160 | $result = false; |
161 | 161 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function isHexa(string $string):bool |
172 | 172 | { |
173 | - return preg_match("/[\da-f]/",$string); |
|
173 | + return preg_match("/[\da-f]/", $string); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Core\Dependency; |
4 | 4 | |
5 | -class Cookie{ |
|
5 | +class Cookie { |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * set a cookie |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function deleteCookie(string $name):void |
23 | 23 | { |
24 | - setcookie($name, "", time()-3600); //expire the cookie |
|
24 | + setcookie($name, "", time() - 3600); //expire the cookie |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -53,7 +53,7 @@ |
||
53 | 53 | public function viewUser(int $userId) |
54 | 54 | { |
55 | 55 | $this->onlyAdmin(); |
56 | - if(!$this->isInt($userId)) |
|
56 | + if (!$this->isInt($userId)) |
|
57 | 57 | { |
58 | 58 | throw new \Exception("Error in passed ID"); |
59 | 59 | } |