Location   B
last analyzed

Complexity

Total Complexity 43

Size/Duplication

Total Lines 289
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 43
lcom 1
cbo 1
dl 0
loc 289
rs 8.3157
c 0
b 0
f 0

19 Methods

Rating   Name   Duplication   Size   Complexity  
A attributeNames() 0 4 1
A setId() 0 4 1
A getId() 0 4 1
A getMissions() 0 4 1
A getMissionTypes() 0 4 1
A getCounty() 0 16 3
A getRoutine() 0 4 1
A incrementRoutine() 0 4 1
A getRoutineStars() 0 23 2
A getRoutineImages() 0 10 3
B getNavigationLinks() 0 36 4
B isVisited() 0 27 5
A setActive() 0 17 4
B fetchMissions() 0 28 4
A getEnergyExpansion() 0 14 3
A fetchRoutine() 0 9 1
A fetchSkill_extended_at_visit() 0 10 1
A listVisited() 0 19 3
A fetchWater() 0 10 1

How to fix   Complexity   

Complex Class

Complex classes like Location often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Location, and based on these observations, apply Extract Interface, too.

1
<?php
2
/**
3
 * @property integer $id
4
 * @property array $missions
5
 * @property array $missionTypes
6
 * @property string $name
7
 * @property string $county
8
 * @property integer $routine
9
 * @property array $routineStars
10
 * @property string $routineImages
11
 * @property array $navigationLinks
12
 */
13
class Location extends CModel
14
{
15
    private $id;
16
    private $routine;
17
    private $skill_extended_at_visit;
18
19
    private $county = ['', 'Baranya', 'Bács-Kiskun', 'Jász-Nagykun-Szolnok', 'Csongrád', 'Békés', 'Hajdú-Bihar', 'Szabolcs-Szatmár-Bereg', 'Borsod-Abaúj-Zemplén', 'Heves', 'Nógrád', 'Pest', 'Komárom-Esztergom', 'Győr-Moson-Sopron', 'Fejér', 'Veszprém', 'Vas', 'Zala', 'Somogy', 'Tolna'];
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
20
    private $missions = [];
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 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.

Loading history...
21
    private $missionTypes = ['simple'=>[], 'gate'=>[]];
22
    private $visitedGates = [];
23
24
    public function attributeNames()
25
    {
26
        return [];
27
    }
28
29
    /**
30
     * @param integer $id
31
     */
32
    public function setId($id)
33
    {
34
        $this->id = (int)$id;
35
    }
36
37
    public function getId()
38
    {
39
        return $this->id;
40
    }
41
42
    public function getMissions()
43
    {
44
        return $this->missions;
45
    }
46
47
    public function getMissionTypes()
48
    {
49
        return $this->missionTypes;
50
    }
51
52
    public function getName($id = 0)
0 ignored issues
show
Documentation introduced by
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 @return annotation as described here.

Loading history...
53
    {
54
        if (!$id) {
55
            $id = $this->id;
56
        }
57
58
        $res = $this->fetchWater($id);
59
        return $res['title'];
60
    }
61
62
    public function getCounty($id = 0)
0 ignored issues
show
Documentation introduced by
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 @return annotation as described here.

Loading history...
63
    {
64
        if (!$id) {
65
            $id = $this->id;
66
        }
67
68
        $res = $this->fetchWater($id);
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
69
        $countyId = $res['county_id'];
70
71
        $county = @$this->county[$countyId];
72
        if (!$county) {
73
            $county = '?';
74
        }
75
76
        return $county;
77
    }
78
79
    public function getRoutine()
80
    {
81
        return $this->routine;
82
    }
83
    public function incrementRoutine()
84
    {
85
        return $this->routine++;
86
    }
87
88
    public function getRoutineStars($r = 0)
89
    {
90
        if (!$r) {
91
            $r = $this->routine;
92
        }
93
94
        $d = floor($r / 81);
95
96
        $eRem = $r % 81;
97
        $e = floor($eRem / 27);
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
98
99
        $gRem = $r % 27;
100
        $g = floor($gRem / 9);
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
101
102
        $sRem = $r % 9;
103
        $s = floor($sRem / 3);
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
104
105
        $bRem = $r % 3;
106
        $b = $bRem;
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
107
108
        $ret = ['routine'=>$r, 'diamant'=>$d, 'emerald'=>$e, 'gold'=>$g, 'silver'=>$s, 'bronze'=>$b];
109
        return $ret;
110
    }
111
112
    public function getRoutineImages($routine)
113
    {
114
        $txt = '';
115
        foreach (['diamant', 'emerald', 'gold', 'silver', 'bronze'] as $star) {
116
            for ($i=0; $i<$routine[$star]; $i++) {
117
                $txt .= '<span class="spr star-'.$star[0].'"></span>';
118
            }
119
        }
120
        return $txt;
121
    }
122
    
123
    public function getNavigationLinks()
124
    {
125
        $nav = [];
126
        //previous locations
127
        $res = $this->fetchWater($this->id);
128
129
        foreach (['from', 'from2'] as $id) {
130
            if ($res[$id]) {
131
                $navId = (int)$res[$id];
132
                $link = [
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
133
                    'id' => $navId,
134
                    'type' => 'prev',
135
                    'title' => $this->getName($navId),
136
                    'active' => true,
137
                    ];
138
                $nav[] = $link;
139
            }
140
        }
141
142
        //next locations
143
        foreach ($this->missionTypes['gate'] as $missionId) {
144
            $nextId = (int)$this->missions[$missionId]->gate;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 22 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.

Loading history...
145
            $visited = $this->isVisited($nextId);
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
146
            $this->visitedGates[$nextId] = $visited;
147
148
            $link = [
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
149
                'id' => $nextId,
150
                'type' => 'next',
151
                'title' => $this->getName($nextId),
152
                'active' => $this->visitedGates[$nextId],
153
                ];
154
            $nav[] = $link;
155
        }
156
157
        return $nav;
158
    }
159
160
    public function isVisited($id = 0)
161
    {
162
        if (!$id) {
163
            $id = $this->id;
164
        }
165
166
        $uid = Yii::app()->player->model->uid;
167
168
        $visited = Yii::app()->db->createCommand()
169
            ->select('*')
170
            ->from('visited')
171
            ->where('uid=:uid AND water_id=:id', [':uid'=>$uid, ':id'=>$id])
172
            ->queryScalar();
173
174
        if (!$visited && $id==1) {
175
            //visit 1. location
176
            Yii::app()->db->createCommand()
177
                ->insert('visited', [
178
                'uid'=>$uid,
179
                'water_id'=>$id,
180
                ]);
181
            $visited = true;
182
            Yii::app()->gameLogger->log(['type'=>'travel', 'traveled_to'=>$id]);
183
        }
184
185
        return $visited ? true : false;
186
    }
187
188
    public function setActive()
189
    {
190
        $player = Yii::app()->player->model;
191
        if ($player->last_location == $this->id) {
192
            return false;
193
        }
194
195
        $attr = ['last_location'=>$this->id];
196
        
197
        if ($this->id > 1 && $player->tutorial_mission==6) {
198
            $attr['tutorial_mission'] = 7;
199
        }
200
        
201
        $player->rewriteAttributes($attr);
202
        Yii::app()->badge->model->triggerTravel($this->id);
203
        return true;
204
    }
205
206
    public function fetchMissions()
207
    {
208
        $res = Yii::app()->db->createCommand()
209
            ->select('id')
210
            ->from('missions')
211
            ->where('water_id=:id', [':id'=>$this->id])
212
            ->order('id ASC')
213
            ->queryAll();
214
215
        $this->fetchSkill_extended_at_visit();
216
217
        foreach ($res as $mission) {
218
            $m = new Mission();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 26 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.

Loading history...
219
            $m->id = $mission['id'];
0 ignored issues
show
Bug introduced by
The property id cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 22 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.

Loading history...
220
            $m->skill_extended_at_visit = $this->skill_extended_at_visit;
0 ignored issues
show
Bug introduced by
The property skill_extended_at_visit cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
221
            $m->req_energy_expansion = $this->getEnergyExpansion();
0 ignored issues
show
Bug introduced by
The property req_energy_expansion cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Coding Style introduced by
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.

Loading history...
222
            $m->fetch();
223
            if ($m->gate) {
0 ignored issues
show
Bug introduced by
The property gate cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
224
                $m->gate_name = $this->getName($m->gate);
0 ignored issues
show
Bug introduced by
The property gate_name cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Bug introduced by
The property gate cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Coding Style introduced by
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.

Loading history...
225
                $m->gate_visited = $this->isVisited($m->gate);
0 ignored issues
show
Bug introduced by
The property gate_visited cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Bug introduced by
The property gate cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 14 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.

Loading history...
226
                $this->visitedGates[$m->gate] = $m->gate_visited;
0 ignored issues
show
Bug introduced by
The property gate cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Bug introduced by
The property gate_visited cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
227
            }
228
229
            $this->missions[$mission['id']] = $m;
230
            $key = $m->gate ? 'gate' : 'simple';
0 ignored issues
show
Bug introduced by
The property gate cannot be accessed from this context as it is declared private in class Mission.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 28 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.

Loading history...
231
            $this->missionTypes[$key][] = $mission['id'];
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 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.

Loading history...
232
        }
233
    }
234
235
    private function getEnergyExpansion()
236
    {
237
        $exp = 0;
238
239
        if ($this->routine >= 27) {
240
            $exp = 1; // gold
241
        }
242
243
        if ($this->routine >= 243) {
244
            $exp = 2; // diamant
245
        }
246
247
        return $exp;
248
    }
249
250
    public function fetchRoutine()
251
    {
252
        $res = Yii::app()->db->createCommand()
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 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.

Loading history...
253
            ->select('routine')
254
            ->from('visited')
255
            ->where('uid=:uid AND water_id=:water_id', [':uid'=>Yii::app()->player->model->uid, ':water_id'=>$this->id])
256
            ->queryScalar();
257
        $this->routine = (int)$res;
258
    }
259
260
    public function fetchSkill_extended_at_visit()
261
    {
262
        $dependency = new CExpressionDependency('Yii::app()->params["visited_version"]');
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 20 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.

Loading history...
263
        $res = Yii::app()->db->cache(Yii::app()->params['cacheDuration'], $dependency)->createCommand()
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 27 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.

Loading history...
264
            ->select('skill_extended_at_visit')
265
            ->from('visited')
266
            ->where('uid=:uid AND water_id=:water_id', [':uid'=>Yii::app()->player->model->uid, ':water_id'=>$this->id])
267
            ->queryScalar();
268
        $this->skill_extended_at_visit = (int)$res;
269
    }
270
271
    public function listVisited()
272
    {
273
        $res = Yii::app()->db->createCommand()
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 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.

Loading history...
274
            ->select('water_id, routine')
275
            ->from('visited')
276
            ->where('uid=:uid', [':uid'=>Yii::app()->player->model->uid])
277
            ->queryAll();
278
        $visited = [];
279
        foreach ($res as $l) {
280
            $water = $this->fetchWater($l['water_id']);
281
            if ($l['water_id'] == Yii::app()->player->model->last_location) {
282
                $water['last']=1;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned correctly; expected 1 space but found 0 spaces

This check looks for improperly formatted assignments.

Every assignment must have exactly one space before and one space after the equals operator.

To illustrate:

$a = "a";
$ab = "ab";
$abc = "abc";

will have no issues, while

$a   = "a";
$ab  = "ab";
$abc = "abc";

will report issues in lines 1 and 2.

Loading history...
283
            }
284
285
            $water['routine'] = $l['routine'];
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
286
            $visited[$l['water_id']] = $water;
287
        }
288
        return $visited;
289
    }
290
291
    private function fetchWater($id)
0 ignored issues
show
Documentation introduced by
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 @return annotation as described here.

Loading history...
292
    {
293
        $dependency = new CExpressionDependency('Yii::app()->params["waters_version"]');
294
        $res = Yii::app()->db->cache(Yii::app()->params['cacheDuration'], $dependency)->createCommand()
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
295
            ->select('*')
296
            ->from('waters')
297
            ->where('id=:id', [':id'=>(int)$id])
298
            ->queryRow();
299
        return $res;
300
    }
301
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
302