These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace XoopsModules\Smallworld; |
||
4 | |||
5 | /* |
||
6 | * You may not change or alter any portion of this comment or credits |
||
7 | * of supporting developers from this source code or any supporting source code |
||
8 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||
9 | * |
||
10 | * This program is distributed in the hope that it will be useful, |
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
13 | */ |
||
14 | |||
15 | use XoopsModules\Smallworld\Constants; |
||
16 | |||
17 | /** |
||
18 | * SmallWorld |
||
19 | * |
||
20 | * @package \XoopsModules\Smallworld |
||
21 | * @license GNU GPL (https://www.gnu.org/licenses/gpl-2.0.html/) |
||
22 | * @copyright The XOOPS Project (https://xoops.org) |
||
23 | * @copyright 2011 Culex |
||
24 | * @author Michael Albertsen (http://culex.dk) <[email protected]> |
||
25 | * @link https://github.com/XoopsModules25x/smallworld |
||
26 | * @since 1.0 |
||
27 | */ |
||
28 | class Profile |
||
29 | { |
||
30 | /** |
||
31 | * @Show user |
||
32 | * @param int $id |
||
33 | */ |
||
34 | public function showUser($id) |
||
35 | { |
||
36 | global $arr04, $arr05; |
||
37 | $id = (int)$id; |
||
38 | if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser'] instanceof \XoopsUser) { |
||
0 ignored issues
–
show
|
|||
39 | $myName = $GLOBALS['xoopsUser']->uname(); // My name |
||
40 | $swDB = new SwDatabase(); |
||
41 | $wall = new WallUpdates(); |
||
42 | |||
43 | /** |
||
44 | * @var \XoopsModules\Smallworld\Helper $helper |
||
45 | * @var \XoopsModules\Smallworld\SwUserHandler $swUserHandler |
||
46 | */ |
||
47 | $helper = Helper::getInstance(); |
||
48 | $swUserHandler = $helper->getHandler('SwUser'); |
||
49 | |||
50 | $rArray = $swUserHandler->getAll(new \Criteria('userid', $id), null, false); |
||
51 | foreach ($rArray as $r) { |
||
52 | //$cdb = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('smallworld_user') . " WHERE userid = '" . $id . "'"; |
||
53 | //$result = $GLOBALS['xoopsDB']->queryF($cdb); |
||
54 | //while (false !== ($r = $GLOBALS['xoopsDB']->fetchArray($result))) { |
||
55 | $uname = $r['username']; |
||
56 | $realname = $r['realname']; |
||
57 | $membersince = date('d-m-Y', $GLOBALS['xoopsUser']->user_regdate());; |
||
0 ignored issues
–
show
$membersince is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the
Loading history...
|
|||
58 | $birthday = smallworld_UsToEuroDate($r['birthday']); |
||
59 | $cnt_bday = smallworldNextBDaySecs($r['birthday']); |
||
60 | $birthcity = $r['birthplace']; |
||
61 | $email = $GLOBALS['xoopsUser']->email(); |
||
0 ignored issues
–
show
$email is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the
Loading history...
|
|||
62 | $country = $GLOBALS['xoopsUser']->user_from(); |
||
0 ignored issues
–
show
$country is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the
Loading history...
|
|||
63 | $signature = $GLOBALS['xoopsUser']->user_sig(); |
||
64 | $messenger = $GLOBALS['xoopsUser']->user_msnm(); |
||
65 | $totalposts = $wall->countMsges($id); |
||
66 | $membersince = date('m-d-Y', $GLOBALS['xoopsUser']->user_regdate()); |
||
67 | $usersratedplus = $swDB->countUsersRates($id, 'up'); |
||
68 | $usersratedminus = $swDB->countUsersRates($id, 'down'); |
||
69 | $workfull = $swDB->getJobsToDiv($id); |
||
70 | //$workArray = unserialize($r['employer']); |
||
71 | //$work = "<a href='javascript:void(0)' id='_smallworld_workmore'>" . $workArray[0] . ' (' . _SMALLWORLD_MORE . ')</a>'; |
||
72 | $work = "<a href='javascript:void(0)' id='_smallworld_workmore'>" . $r['employer'][0] . ' (' . _SMALLWORLD_MORE . ')</a>'; |
||
73 | $educationfull = $swDB->getSchoolToDiv($id); |
||
74 | //$educationArray = unserialize($r['school_type']); |
||
75 | //$education = "<a href='javascript:void(0)' id='_smallworld_educationmore'>" . $educationArray[0] . ' (' . _SMALLWORLD_MORE . ')</a>'; |
||
76 | $education = "<a href='javascript:void(0)' id='_smallworld_educationmore'>" . $r['school_type'][0] . ' (' . _SMALLWORLD_MORE . ')</a>'; |
||
77 | $lng = $r['birthplace_lng']; |
||
78 | $latt = $r['birthplace_lat']; |
||
79 | $country = $r['birthplace_country']; |
||
80 | $rank = $GLOBALS['xoopsUser']->rank(); |
||
81 | $rank_title = $rank['title']; |
||
82 | View Code Duplication | if (isset($rank['image'])) { |
|
83 | $rank_image = "<img class='center' src='" . XOOPS_UPLOAD_URL . '/' . $rank['image'] . "'>"; |
||
84 | } else { |
||
85 | $rank_image = ''; |
||
86 | } |
||
87 | $commentsrating = "<img src='" . $helper->url('assets/images/like.png') . "' height='10px' width='10px'" . '> ' . $usersratedplus |
||
88 | . " <img src='" . $helper->url('assets/images/dislike.png') . "' height='10px' width='10px'" . '> ' . $usersratedminus; |
||
89 | $lastlogin = $GLOBALS['xoopsUser']->getVar('last_login'); |
||
90 | |||
91 | $gender = $r['gender']; |
||
92 | if (Constants::MALE == $gender) { |
||
93 | $heorshe = _SMALLWORLD_HE; |
||
94 | $hisorher = _SMALLWORLD_HIS; |
||
95 | } |
||
96 | if (Constants::FEMALE == $gender) { |
||
97 | $heorshe = _SMALLWORLD_SHE; |
||
98 | $hisorher = _SMALLWORLD_HER; |
||
99 | } |
||
100 | if (Constants::GENDER_UNKNOWN == (int)$gender) { |
||
101 | $heorshe = _SMALLWORLD_HEORSHE; |
||
102 | $hisorher = _SMALLWORLD_HISHER; |
||
103 | } |
||
104 | $avatar = $swUserHandler->gravatar($id); |
||
105 | $avatar_size = smallworld_getImageSize(80, 100, $swUserHandler->getAvatarLink($id, $avatar)); |
||
106 | $avatar_highwide = smallworld_imageResize($avatar_size[0], $avatar_size[1], 100); |
||
107 | $user_img = "<img src='" . $swUserHandler->getAvatarLink($id, $avatar) . "' id='smallworld_user_img' " . $avatar_highwide . '>'; |
||
108 | |||
109 | $currentcity = $r['present_city']; |
||
110 | $currlng = $r['present_lng']; |
||
111 | $currlatt = $r['present_lat']; |
||
112 | $currcountry = $r['present_country']; |
||
113 | |||
114 | // experimental. Set javascript var using php getVar() |
||
115 | $js = "<script type='text/javascript'>"; |
||
116 | $js .= 'var smallworld_currlng = ' . $currlng . "\n"; |
||
117 | $js .= 'var smallworld_currlatt = ' . $currlatt . "\n"; |
||
118 | $js .= 'var smallworld_birthlng = ' . $lng . "\n"; |
||
119 | $js .= 'var smallworld_birthlatt = ' . $latt . "\n"; |
||
120 | $js .= '</script>'; |
||
121 | echo $js; |
||
122 | |||
123 | $relationship = $r['relationship']; |
||
124 | $spouseExists = $swUserHandler->spouseExists($r['partner']); |
||
125 | |||
126 | switch ((int)$relationship) { |
||
127 | View Code Duplication | case Constants::RELATIONSHIP_MARRIED: |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
128 | $status = _SMALLWORLD_ISMARRIED; |
||
129 | $spouse = ($spouseExists > 0) ? "<a href='" . $helper->url('userprofile.php?username=' . $r['partner']) . "' target='_self'>" . $r['partner'] . '</a>' : $r['partner']; |
||
130 | break; |
||
131 | View Code Duplication | case Constants::RELATIONSHIP_ENGAGED: |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
132 | $status = _SMALLWORLD_ISENGAGED; |
||
133 | $spouse = ($spouseExists > 0) ? "<a href='" . $helper->url('userprofile.php?username=' . $r['partner']) . "' target='_self'>" . $r['partner'] . '</a>' : $r['partner']; |
||
134 | break; |
||
135 | case Constants::RELATIONSHIP_SINGLE: |
||
136 | $status = _SMALLWORLD_ISSINGLE; |
||
137 | $spouse = ''; |
||
138 | break; |
||
139 | View Code Duplication | case Constants::RELATIONSHIP_ISIN: |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
140 | $status = _SMALLWORLD_INRELATIONSHIP; |
||
141 | $spouse = ($spouseExists > 0) ? "<a href='" . $helper->url('userprofile.php?username=' . $r['partner']) . "' target='_self'>" . $r['partner'] . '</a>' : $r['partner']; |
||
142 | break; |
||
143 | View Code Duplication | case Constants::RELATIONSHIP_OPEN: |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
144 | $status = _SMALLWORLD_OPENRELATIONSHIP; |
||
145 | $spouse = ($spouseExists > 0) ? "<a href='" . $helper->url('userprofile.php?username=' . $r['partner']) . "' target='_self'>" . $r['partner'] . '</a>' : $r['partner']; |
||
146 | break; |
||
147 | View Code Duplication | case Constants::RELATIONSHIP_COMPLICATED: |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
148 | $status = _SMALLWORLD_ISCOMPLICATED; |
||
149 | $spouse = ($spouseExists > 0) ? "<a href='" . $helper->url('userprofile.php?username=' . $r['partner']) . "' target='_self'>" . $r['partner'] . '</a>' : $r['partner']; |
||
150 | break; |
||
151 | } |
||
152 | //Personal info |
||
153 | $aboutme = $r['aboutme']; |
||
154 | $religion = $arr05[$r['religion']]; |
||
155 | $politic = $arr04[$r['politic']]; |
||
156 | |||
157 | //Interests |
||
158 | $favbook = $r['books']; |
||
159 | $favmusic = $r['music']; |
||
160 | $favmovie = $r['movie']; |
||
161 | $favtvshow = $r['tvshow']; |
||
162 | $favinterests = $r['interests']; |
||
163 | |||
164 | // Contact and adresses |
||
165 | //$email = unserialize($r['emailtype']); |
||
166 | $email = $r['emailtype']; |
||
167 | $screenname = $swDB->getScreennamesToDiv($id); |
||
168 | $phone = ('' == $r['phone'] || 0 == $r['phone']) ? 'xxx-xxx-xxxx' : $r['phone']; |
||
169 | $gsm = ('' == $r['mobile'] || 0 == $r['mobile']) ? 'xxx-xxx-xxxx' : $r['mobile']; |
||
170 | $adress = $r['adress']; |
||
171 | $website = $r['website']; |
||
172 | $age = smallworld_Birthday($r['birthday']); |
||
173 | } |
||
174 | |||
175 | //SW_CheckIfUser ($userid);; |
||
176 | $GLOBALS['xoopsTpl']->assign([ |
||
177 | 'userid' => $id, |
||
178 | // ----- LANG DEFINES ------ |
||
179 | 'username' => $uname, |
||
0 ignored issues
–
show
The variable
$uname does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
180 | 'MyUserName' => $myName, |
||
181 | 'avatar' => $user_img, |
||
0 ignored issues
–
show
The variable
$user_img does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
182 | 'realname' => $realname, |
||
0 ignored issues
–
show
The variable
$realname does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
183 | 'birthday' => $birthday, |
||
0 ignored issues
–
show
The variable
$birthday does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
184 | 'nextBDay' => $cnt_bday, |
||
0 ignored issues
–
show
The variable
$cnt_bday does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
185 | // |
||
186 | 'usersratinf' => $commentsrating, |
||
0 ignored issues
–
show
The variable
$commentsrating does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
187 | // |
||
188 | 'age' => $age, |
||
0 ignored issues
–
show
The variable
$age does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
189 | 'birthcity' => $birthcity, |
||
0 ignored issues
–
show
The variable
$birthcity does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
190 | 'country' => $country, |
||
0 ignored issues
–
show
The variable
$country does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
191 | 'heorshe' => $heorshe, |
||
0 ignored issues
–
show
The variable
$heorshe does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
192 | 'hisorher' => $hisorher, |
||
0 ignored issues
–
show
The variable
$hisorher does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
193 | // |
||
194 | 'membersince' => $membersince, |
||
0 ignored issues
–
show
The variable
$membersince does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
195 | 'msn' => $messenger, |
||
0 ignored issues
–
show
The variable
$messenger does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
196 | 'website' => $website, |
||
0 ignored issues
–
show
The variable
$website does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
197 | 'totalposts' => $totalposts, |
||
0 ignored issues
–
show
The variable
$totalposts does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
198 | 'ranktitle' => $rank_title, |
||
0 ignored issues
–
show
The variable
$rank_title does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
199 | 'rankimage' => $rank_image, |
||
0 ignored issues
–
show
The variable
$rank_image does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
200 | 'lastlogin' => date('d-m-Y', $lastlogin), |
||
0 ignored issues
–
show
The variable
$lastlogin does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
201 | 'signature' => $signature, |
||
0 ignored issues
–
show
The variable
$signature does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
202 | 'currentcity' => $currentcity, |
||
0 ignored issues
–
show
The variable
$currentcity does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
203 | 'currcity' => $currentcity, |
||
204 | 'currcountry' => $currcountry, |
||
0 ignored issues
–
show
The variable
$currcountry does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
205 | // |
||
206 | 'education' => $education, |
||
0 ignored issues
–
show
The variable
$education does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
207 | 'educationfull' => $educationfull, |
||
0 ignored issues
–
show
The variable
$educationfull does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
208 | // |
||
209 | 'work' => $work, |
||
0 ignored issues
–
show
The variable
$work does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
210 | 'workfull' => $workfull, |
||
0 ignored issues
–
show
The variable
$workfull does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
211 | // |
||
212 | 'relationship' => $status, |
||
0 ignored issues
–
show
The variable
$status does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
213 | 'status' => $status, |
||
214 | 'spouse' => $spouse, |
||
0 ignored issues
–
show
The variable
$spouse does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
215 | 'aboutme' => $aboutme, |
||
0 ignored issues
–
show
The variable
$aboutme does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
216 | 'lang.avatar' => _SMALLWORLD_AVATAR, |
||
217 | // Pers info language define |
||
218 | 'politic' => $politic, |
||
0 ignored issues
–
show
The variable
$politic does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
219 | 'religion' => $religion, |
||
0 ignored issues
–
show
The variable
$religion does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
220 | // |
||
221 | 'favbook' => $favbook, |
||
0 ignored issues
–
show
The variable
$favbook does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
222 | 'favmusic' => $favmusic, |
||
0 ignored issues
–
show
The variable
$favmusic does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
223 | 'favmovie' => $favmovie, |
||
0 ignored issues
–
show
The variable
$favmovie does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
224 | 'favtvshow' => $favtvshow, |
||
0 ignored issues
–
show
The variable
$favtvshow does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
225 | 'favinterests' => $favinterests, |
||
0 ignored issues
–
show
The variable
$favinterests does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
226 | |||
227 | 'email' => $email, |
||
0 ignored issues
–
show
The variable
$email does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
228 | 'screenname' => $screenname, |
||
0 ignored issues
–
show
The variable
$screenname does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
229 | 'phone' => $phone, |
||
0 ignored issues
–
show
The variable
$phone does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
230 | 'mobile' => $gsm, |
||
0 ignored issues
–
show
The variable
$gsm does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
231 | 'adress' => $adress, |
||
0 ignored issues
–
show
The variable
$adress does not seem to be defined for all execution paths leading up to this point.
If you define a variable conditionally, it can happen that it is not defined for all execution paths. Let’s take a look at an example: function myFunction($a) {
switch ($a) {
case 'foo':
$x = 1;
break;
case 'bar':
$x = 2;
break;
}
// $x is potentially undefined here.
echo $x;
}
In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined. Available Fixes
Loading history...
|
|||
232 | // |
||
233 | 'website' => $website, |
||
234 | 'addsomeinfo' => _SMALLWORLD_ADDSOMEINFO, |
||
235 | 'pagename' => 'profile' |
||
236 | ]); |
||
237 | } |
||
238 | } |
||
239 | } |
||
240 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.