heal25 /
ced
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 | class MissionsController extends GameController |
||
| 3 | { |
||
| 4 | public function actionIndex() |
||
| 5 | { |
||
| 6 | $this->redirect(['missions/list', 'id'=>Yii::app()->player->model->last_location]); |
||
| 7 | } |
||
| 8 | |||
| 9 | public function actionList($id = 1) |
||
| 10 | { |
||
| 11 | $location = new Location(); |
||
| 12 | $location->setId($id); |
||
| 13 | if (!$location->isVisited()) { |
||
| 14 | Yii::app()->player->model->rewriteAttributes(['last_location'=>1]); |
||
| 15 | $this->render('not_visited'); |
||
| 16 | return false; |
||
| 17 | } |
||
| 18 | |||
| 19 | $location->setActive(); |
||
| 20 | |||
| 21 | //list missions |
||
| 22 | $location->fetchRoutine(); |
||
| 23 | $location->fetchMissions(); |
||
| 24 | |||
| 25 | //complete selected mission |
||
| 26 | $mission_id = Yii::app()->request->getPost('mission_id', 0); |
||
|
0 ignored issues
–
show
|
|||
| 27 | $completedId = 0; |
||
| 28 | $error = ''; |
||
|
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. Loading history...
|
|||
| 29 | if ($mission_id) { |
||
| 30 | $error = ''; |
||
| 31 | try { |
||
| 32 | $locAction = new LocationAction(); |
||
|
0 ignored issues
–
show
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...
|
|||
| 33 | $locAction->location = $location; |
||
|
0 ignored issues
–
show
The property
location cannot be accessed from this context as it is declared private in class LocationAction.
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...
|
|||
| 34 | $locAction->completeMission($mission_id); |
||
| 35 | $completedId = $locAction->completedId; |
||
|
0 ignored issues
–
show
The property
completedId cannot be accessed from this context as it is declared private in class LocationAction.
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...
|
|||
| 36 | } catch (CFlashException $e) { |
||
| 37 | $error = $e->getMessage(); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | //name of location |
||
| 42 | $name = [ |
||
| 43 | 'location' => $location->getName(), |
||
| 44 | 'county' => $location->getCounty(), |
||
| 45 | ]; |
||
| 46 | |||
| 47 | //navigation from current location |
||
| 48 | $nav = $location->getNavigationLinks(); |
||
| 49 | |||
| 50 | //tutorial |
||
| 51 | $tutorialToShow = 0; |
||
| 52 | if ($id==1) { |
||
| 53 | //only in first location |
||
| 54 | $tutorial = new Tutorial; |
||
|
0 ignored issues
–
show
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...
|
|||
| 55 | $tutorial->state = Yii::app()->player->model->tutorial_mission; |
||
|
0 ignored issues
–
show
The property
state cannot be accessed from this context as it is declared private in class Tutorial.
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...
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...
|
|||
| 56 | $tutorial->location = $location; |
||
|
0 ignored issues
–
show
The property
location cannot be accessed from this context as it is declared private in class Tutorial.
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...
|
|||
| 57 | $tutorialToShow = $tutorial->descriptionToShow; |
||
|
0 ignored issues
–
show
The property
descriptionToShow cannot be accessed from this context as it is declared private in class Tutorial.
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...
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...
|
|||
| 58 | } |
||
| 59 | $this->render('index', [ |
||
| 60 | 'location' => $location, |
||
| 61 | 'name' => $name, |
||
| 62 | 'missions'=>$location->missions, |
||
|
0 ignored issues
–
show
The property
missions cannot be accessed from this context as it is declared private in class Location.
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...
|
|||
| 63 | 'missionTypeList'=>$location->missionTypes, |
||
|
0 ignored issues
–
show
The property
missionTypes cannot be accessed from this context as it is declared private in class Location.
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...
|
|||
| 64 | 'nav' => $nav, |
||
| 65 | 'mission_id'=>$mission_id, |
||
| 66 | 'completedId'=>$completedId, |
||
| 67 | 'routine'=>$location->routineStars, |
||
| 68 | 'tutorialToShow'=>$tutorialToShow, |
||
| 69 | 'error'=>$error, |
||
| 70 | ]); |
||
| 71 | |||
| 72 | } |
||
| 73 | |||
| 74 | public function actionMap() |
||
| 75 | { |
||
| 76 | $this->layout = 'fullscreen'; |
||
| 77 | |||
| 78 | $location = new Location(); |
||
| 79 | $visited = $location->listVisited(); |
||
|
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. Loading history...
|
|||
| 80 | |||
| 81 | $center = Yii::app()->params['mapCenterCoords']; //id 1 |
||
|
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. Loading history...
|
|||
| 82 | $last = []; |
||
|
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. Loading history...
|
|||
| 83 | $locations = []; |
||
| 84 | foreach ($visited as $v) { |
||
| 85 | $id = (int)$v['id']; |
||
|
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. Loading history...
|
|||
| 86 | $txtRoutine = ''; |
||
| 87 | if ($v['routine']) { |
||
| 88 | $routine = $location->getRoutineStars($v['routine']); |
||
|
0 ignored issues
–
show
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...
|
|||
| 89 | $txtRoutine = 'HelyszÃnen megszerzett rutinod: <br/>'; |
||
|
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. Loading history...
|
|||
| 90 | $txtRoutine .= $location->getRoutineImages($routine); |
||
| 91 | } else { |
||
| 92 | $last[] = $id; |
||
| 93 | } |
||
| 94 | |||
| 95 | $locations[] = "[{$v['position']}, '{$v['title']}', {$id}, '{$txtRoutine}']"; |
||
|
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $v instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
As per coding-style, please use concatenation or
sprintf for the variable $id instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
As per coding-style, please use concatenation or
sprintf for the variable $txtRoutine instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
|
|||
| 96 | if (isset($v['last'])) { |
||
| 97 | $center = $v['position']; |
||
| 98 | } |
||
| 99 | } |
||
| 100 | |||
| 101 | $this->render('map', [ |
||
| 102 | 'visited'=>$visited, |
||
| 103 | 'locations'=>implode(",\n", $locations), |
||
| 104 | 'center'=>$center, |
||
| 105 | 'last'=>implode(', ', $last) |
||
| 106 | ]); |
||
| 107 | } |
||
| 108 | } |
||
|
0 ignored issues
–
show
|
|||
| 109 |
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
will produce issues in the first and second line, while this second example
will produce no issues.