This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | class View |
||
0 ignored issues
–
show
|
|||
4 | { |
||
5 | public $country; |
||
6 | public $city; |
||
7 | public $hashtag; |
||
8 | public $view; |
||
9 | public $postId; |
||
10 | public $isDetailedView; |
||
11 | public $baseUrl; |
||
12 | public $rights; |
||
13 | |||
14 | public $lastPostId = ''; |
||
15 | |||
16 | function __construct($baseUrl, $country, $city, $hashtag = '%23all', $view = 'time', $postId = '') |
||
0 ignored issues
–
show
|
|||
17 | { |
||
18 | $this->baseUrl = $baseUrl; |
||
19 | $this->country = $country; |
||
20 | $this->city = $city; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
21 | $this->hashtag = urldecode($hashtag); |
||
22 | $this->view = $view; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
23 | $this->postId = $postId; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
24 | |||
25 | if(isUserAdmin()) |
||
26 | { |
||
27 | $this->rights = 'admin'; |
||
28 | } |
||
29 | else if(isUserVoter()) |
||
30 | { |
||
31 | $this->rights = 'voter'; |
||
32 | } |
||
33 | else |
||
34 | { |
||
35 | $this->rights = 'user'; |
||
36 | } |
||
37 | |||
38 | if($postId == '') |
||
39 | { |
||
40 | $this->isDetailedView = FALSE; |
||
41 | } |
||
42 | else |
||
43 | { |
||
44 | $this->isDetailedView = TRUE; |
||
45 | } |
||
46 | } |
||
47 | /** |
||
48 | * Compute HTML Code |
||
49 | */ |
||
50 | function jodelToHtml($post) |
||
0 ignored issues
–
show
|
|||
51 | { //ToDO |
||
0 ignored issues
–
show
Comment refers to a TODO task
This check looks ``TODO``s show that something is left unfinished and should be attended to. ![]() |
|||
52 | //Replace # with link |
||
53 | //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
44% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||
54 | |||
55 | //Time to time difference |
||
56 | $now = new DateTime(); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
57 | $d = new DateTime($post['created_at']); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
58 | $timediff = $now->diff($d); |
||
59 | |||
60 | $timediff_inSeconds = (string)$timediff->format('%s'); |
||
61 | $timediff_inMinutes = (string)$timediff->format('%i'); |
||
62 | $timediff_inHours = (string)$timediff->format('%h'); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
63 | $timediff_inDays = (string)$timediff->format('%d'); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
64 | $timediff_inMonth = (string)$timediff->format('%m'); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
65 | |||
66 | if($timediff_inMonth!=0) |
||
67 | { |
||
68 | $timediff = $timediff_inMonth . "m"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
m does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
69 | } |
||
70 | else |
||
71 | { |
||
72 | if($timediff_inDays!=0) |
||
73 | { |
||
74 | $timediff = $timediff_inDays . "d"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
d does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
75 | } |
||
76 | else |
||
77 | { |
||
78 | if($timediff_inHours!=0) |
||
79 | { |
||
80 | $timediff = $timediff_inHours . "h"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
h does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
81 | } |
||
82 | else |
||
83 | { |
||
84 | if($timediff_inMinutes!=0) |
||
85 | { |
||
86 | $timediff = $timediff_inMinutes . "m"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
m does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
87 | } |
||
88 | else |
||
89 | { |
||
90 | $timediff = $timediff_inSeconds . "s"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
s does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
91 | } |
||
92 | } |
||
93 | } |
||
94 | } |
||
95 | |||
96 | |||
97 | ?> |
||
98 | <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;"> |
||
0 ignored issues
–
show
|
|||
99 | <content> |
||
100 | <?php |
||
101 | if(isset($post['image_url'])) |
||
102 | { |
||
103 | $regexRest = '/[^\w$ .!?-]+/u'; |
||
104 | |||
105 | echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">'; |
||
0 ignored issues
–
show
|
|||
106 | } |
||
107 | else { |
||
108 | echo str_replace(' ', ' ', nl2br(htmlspecialchars($post['message']))); |
||
109 | } |
||
110 | ?> |
||
111 | </content> |
||
112 | <aside> |
||
113 | <button onclick="vote('<?php echo $post['post_id'];?>', 'up', this)"> |
||
114 | <i class="fa fa-angle-up fa-3x"></i> |
||
115 | </button> |
||
116 | <br><span><?php echo $post["vote_count"];?></span><br> |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
vote_count does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
117 | |||
118 | <button onclick="vote('<?php echo $post['post_id'];?>', 'down', this)"> |
||
119 | <i class="fa fa-angle-down fa-3x"></i> |
||
120 | </button> |
||
121 | </aside> |
||
122 | |||
123 | <footer> |
||
124 | <span class="wrapper"> |
||
125 | |||
126 | <span class="time"> |
||
127 | <span class="tip" data-tooltip="Time"> |
||
128 | <i class="fa fa-clock-o"></i> |
||
129 | <?php echo $timediff;?> |
||
130 | <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span> |
||
131 | </span> |
||
132 | </span> |
||
133 | <?php if(!$this->isDetailedView) {?> |
||
134 | <span class="comments"> |
||
135 | <span data-tooltip="Comments"> |
||
136 | <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>"> |
||
137 | <i class="fa fa-commenting-o"></i> |
||
138 | <?php if(array_key_exists("child_count", $post)) |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
child_count does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
139 | { |
||
140 | echo $post["child_count"]; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
child_count does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
141 | } else echo "0"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
0 does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
142 | ?> |
||
143 | </a> |
||
144 | </span> |
||
145 | |||
146 | </span> |
||
147 | <?php |
||
148 | } |
||
149 | if($this->rights == 'admin' || $this->rights == 'voter') |
||
150 | { |
||
151 | ?> |
||
152 | <span class="voting"> |
||
153 | <a target="_blank" href="admin.php?postId=<?php echo $post['post_id'] ?>"> |
||
154 | <i class="fa fa-thumbs-o-up"></i> Vote |
||
155 | </a> |
||
156 | </span> |
||
157 | <?php |
||
158 | } |
||
159 | ?> |
||
160 | <span class="distance"> |
||
161 | <?php |
||
162 | if($this->isDetailedView) |
||
163 | { |
||
164 | if(isset($post['user_handle']) && $post['user_handle'] == 'OJ') |
||
165 | { |
||
166 | ?> |
||
167 | <span data-tooltip="Author"> |
||
168 | <i class="fa fa-user-o"></i> OJ | |
||
169 | </span> |
||
170 | <?php |
||
171 | } |
||
172 | } |
||
173 | ?> |
||
174 | |||
175 | <span class="tip" data-tooltip="Distance"> |
||
176 | <i class="fa fa-map-marker"></i> |
||
177 | <?php echo $post['distance'];?> km |
||
178 | <span class="tiptext"><?php echo $post['location']['name'];?></span> |
||
179 | </span> |
||
180 | </span> |
||
181 | |||
182 | </span> |
||
183 | </footer> |
||
184 | </article> |
||
185 | <?php |
||
186 | } |
||
187 | |||
188 | |||
189 | /** |
||
190 | * Gets the title. |
||
191 | * |
||
192 | * @return string The title. |
||
193 | */ |
||
194 | function getTitle($post = '') |
||
0 ignored issues
–
show
|
|||
195 | { |
||
196 | $title = 'JodelBlue - Top Jodel from ' . htmlspecialchars($this->city) . ' Web-App and Browser-Client'; |
||
197 | |||
198 | if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView) |
||
199 | { |
||
200 | $title = 'JodelBlue: ' . substr(htmlspecialchars($post['message']), 0, 44); |
||
201 | } |
||
202 | |||
203 | return $title; |
||
204 | } |
||
205 | |||
206 | /** |
||
207 | * Gets the meta description. |
||
208 | * |
||
209 | * @return string The meta description. |
||
210 | */ |
||
211 | function getMetaDescription($post = '') |
||
0 ignored issues
–
show
|
|||
212 | { |
||
213 | $description = 'JodelBlue is a Web-App and Browser-Client for the Jodel App. No registration required! Browse Jodels in ' . htmlspecialchars($this->city) . ' or all over the world.'; |
||
0 ignored issues
–
show
|
|||
214 | |||
215 | if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView) |
||
216 | { |
||
217 | $description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130); |
||
0 ignored issues
–
show
|
|||
218 | } |
||
219 | |||
220 | return $description; |
||
221 | } |
||
222 | |||
223 | function toUrl($msg = '') |
||
0 ignored issues
–
show
|
|||
224 | { |
||
225 | $url = $this->baseUrl . 'index.php?country=DE' . |
||
226 | '&city=' . urlencode($this->city) . |
||
227 | '&hashtag=' . urlencode($this->hashtag) . |
||
228 | '&view=' . $this->view; |
||
229 | if($this->postId != '') |
||
230 | { |
||
231 | $url .= '&postId=' . $this->postId . |
||
232 | '&getPostDetails=TRUE'; |
||
233 | } |
||
234 | |||
235 | if($msg != '') |
||
236 | { |
||
237 | $url .= '&msg=' . urlencode($msg); |
||
238 | } |
||
239 | |||
240 | return $url; |
||
241 | } |
||
242 | |||
243 | function changePostId($postId) |
||
0 ignored issues
–
show
|
|||
244 | { |
||
245 | $tempView = clone $this; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 17 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
246 | $tempView->postId = $postId; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
247 | $tempView->isDetailedView = TRUE; |
||
248 | return $tempView; |
||
249 | } |
||
250 | |||
251 | function back() |
||
0 ignored issues
–
show
|
|||
252 | { |
||
253 | $tempView = clone $this; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
254 | $tempView->postId = ''; |
||
255 | return $tempView; |
||
256 | } |
||
257 | |||
258 | function changeView($view) |
||
0 ignored issues
–
show
|
|||
259 | { |
||
260 | $tempView = clone $this; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
261 | $tempView->view = $view; |
||
262 | return $tempView; |
||
263 | } |
||
264 | |||
265 | function getPosts($jodelAccount) |
||
0 ignored issues
–
show
The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a ![]() |
|||
266 | { |
||
267 | if($this->hashtag != '#all' && $this->hashtag != '' && $this->hashtag != NULL) |
||
268 | { |
||
269 | $accountCreator = new GetChannel(); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
270 | $accountCreator->view = $this->view; |
||
271 | $accountCreator->setAccessToken($jodelAccount->accessToken); |
||
272 | $accountCreator->channel = $this->hashtag; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
273 | $accountCreator->lastPostId = $this->lastPostId; |
||
274 | $data = $accountCreator->execute(); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 23 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
275 | } |
||
276 | else |
||
277 | { |
||
278 | if($this->lastPostId == '' && $this->view == 'combo') |
||
279 | { |
||
280 | $url = "/v3/posts/location/combo"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/v3/posts/location/combo does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
281 | } |
||
282 | else |
||
283 | { |
||
284 | if($this->view == 'discussed') |
||
285 | { |
||
286 | $url = "/v2/posts/location/discussed/"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/v2/posts/location/discussed/ does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
287 | } |
||
288 | else |
||
289 | { |
||
290 | if($this->view == 'popular') |
||
291 | { |
||
292 | $url = "/v2/posts/location/popular/"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/v2/posts/location/popular/ does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
293 | } |
||
294 | else |
||
295 | { |
||
296 | $url = "/v2/posts/location/"; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
/v2/posts/location/ does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
297 | } |
||
298 | } |
||
299 | } |
||
300 | |||
301 | $accountCreator = new GetPosts(); |
||
302 | $accountCreator->setLastPostId($this->lastPostId); |
||
303 | $accountCreator->setAccessToken($jodelAccount->accessToken); |
||
304 | $accountCreator->setUrl($url); |
||
305 | $accountCreator->version = 'v3'; |
||
306 | |||
307 | $config = parse_ini_file('config/config.ini.php'); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
308 | $location = new Location(); |
||
309 | $location->setLat($config['default_lat']); |
||
310 | $location->setLng($config['default_lng']); |
||
311 | $location->setCityName($config['default_location']); |
||
312 | $accountCreator->location = $location; |
||
313 | $data = $accountCreator->execute(); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 21 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
314 | } |
||
315 | if(is_array($data) && array_key_exists('recent', $data) && array_key_exists(0, $data['recent'])) |
||
316 | { |
||
317 | return $data['recent']; |
||
318 | } |
||
319 | else if(is_array($data) && array_key_exists('posts', $data)&& array_key_exists(0, $data['posts'])) |
||
320 | { |
||
321 | return $data['posts']; |
||
322 | } |
||
323 | else |
||
324 | { |
||
325 | if($this->lastPostId == '') |
||
326 | { |
||
327 | error_log('Could not find Posts in: ' . $this->city . ' Error: ' . print_r($data, true)); |
||
328 | //error_log(print_r($data, true)); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
73% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||
329 | |||
330 | $notFound[0] = array( |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
$notFound was never initialized. Although not strictly required by PHP, it is generally a good practice to add $notFound = array(); before regardless.
Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code. Let’s take a look at an example: foreach ($collection as $item) {
$myArray['foo'] = $item->getFoo();
if ($item->hasBar()) {
$myArray['bar'] = $item->getBar();
}
// do something with $myArray
}
As you can see in this example, the array This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop. ![]() |
|||
331 | "post_id" => "0", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
post_id does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
0 does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
332 | "discovered_by" => 0, |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
discovered_by does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
333 | "message" => "No more Posts found", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
message does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
No more Posts found does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
334 | "created_at" => "2017-02-11T16:44:50.385Z", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
created_at does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
2017-02-11T16:44:50.385Z does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
335 | "updated_at" => "2017-02-11T16:44:50.385Z", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
updated_at does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
2017-02-11T16:44:50.385Z does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
336 | "pin_count" => 0, |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
pin_count does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
337 | "color" => "5682a3", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
color does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
5682a3 does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
338 | "got_thanks" => FALSE, |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
got_thanks does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
339 | "post_own" => "friend", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
post_own does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
friend does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
340 | "discovered" => 0, |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
discovered does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
341 | "distance" => 9, |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
distance does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
342 | "vote_count" => 0, |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
vote_count does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
343 | "location" => |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
location does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
344 | array("name" => "Berlin", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
name does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
Berlin does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
345 | "loc_coordinates" => |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
loc_coordinates does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
346 | array( |
||
347 | "lat" => 0, |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
lat does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
348 | "lng" => 0 |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
lng does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
349 | ), |
||
350 | "loc_accuracy" => 0, |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
loc_accuracy does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
351 | "country" => "", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
country does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
352 | "city" => "", |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
city does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
353 | ), |
||
354 | "tags" => |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
tags does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
355 | array(), |
||
356 | "user_handle" => "0" |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
user_handle does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() Coding Style
Comprehensibility
introduced
by
The string literal
0 does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
357 | ); |
||
358 | return $notFound; |
||
359 | } |
||
360 | else |
||
361 | { |
||
362 | return FALSE; |
||
363 | } |
||
364 | } |
||
365 | } |
||
366 | } |
||
0 ignored issues
–
show
|
|||
367 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.