Issues (72)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

code/BrowseCitiesPage.php (27 issues)

Upgrade to new PHP Analysis Engine

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 BrowseCitiesPage extends BrowseAbstractPage
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
6
    /**
7
     * Standard SS static
8
     **/
9
    public static $icon = "geobrowser/images/treeicons/BrowseCitiesPage";
10
11
    /**
12
     * Standard SS static
13
     **/
14
    public static $default_parent = "BrowseRegionsPage";
15
16
    /**
17
     * Standard SS static
18
     **/
19
    public static $can_be_root = false;
20
21
    /**
22
     * Standard SS static
23
     **/
24
    public static $db = array(
25
        "Latitude" => "Double",
26
        "Longitude" => "Double",
27
        "TimeZone"=> "Varchar(10)",
28
        "County" => "Varchar(25)",
29
        "Code" => "Varchar(4)",
30
    );
31
32
    /**
33
     * Standard SS Static
34
     **/
35
    public static $defaults = array(
36
        "ShowInMenus" => false
37
    );
38
    
39
    /**
40
     * @param Array - $googleMapAddressArray: an array of geographic data provided by google maps
41
     * @param Int - $maxRadius: maximum number of kilometers (as the bird flies) between search point defined in $googleMapAddressArray and city found.
42
     * @return Object | false : returns a BrowseCitiesPage or false if nothing was found
0 ignored issues
show
Should the return type not be object|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
43
     **/
44
    public static function get_clostest_city_page($googleMapAddressArray, $maxRadius = 500)
45
    {
46
        $cityPage = null;
47
        $suburbPage    = null;
48
        $bt = defined('DB::USE_ANSI_SQL') ? "\"" : "`";
49
        $existingDistance = $maxRadius+1;
50
        $newDistance = $maxRadius+1;
51
        $existingPage = null;
52
        $newPage = null;
53
        $radiusSelectionSQL = self::radiusDefinitionOtherTable($googleMapAddressArray[0], $googleMapAddressArray[1], "BrowseCitiesPage", "Latitude", "Longitude");
54
        $sqlQuery = new SQLQuery();
0 ignored issues
show
Deprecated Code introduced by
The class SQLQuery has been deprecated with message: since version 4.0

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
55
        $sqlQuery->select = array("{$bt}BrowseCitiesPage{$bt}.{$bt}ID{$bt}, ". $radiusSelectionSQL." as distance");
56
        $sqlQuery->from[] = "{$bt}BrowseCitiesPage{$bt}";
57
        $sqlQuery->where[] = $radiusSelectionSQL . " < ".$maxRadius;
58
        $sqlQuery->orderby = " distance ";
59
        $sqlQuery->limit = "1";
0 ignored issues
show
Documentation Bug introduced by
It seems like '1' of type string is incompatible with the declared type array of property $limit.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
60
        $result = $sqlQuery->execute();
61
        $page = null;
0 ignored issues
show
$page 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 $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
62
        foreach ($result as $row) {
63
            $existingDistance = $row["distance"];
64
            $existingPage = DataObject::get_by_id("BrowseCitiesPage", $row["ID"]);
65
        }
66
        $radiusSelectionSQL = self::radiusDefinitionOtherTable($googleMapAddressArray[0], $googleMapAddressArray[1], "cities", "Latitude", "Longitude");
67
        $sqlQuery = new SQLQuery();
0 ignored issues
show
Deprecated Code introduced by
The class SQLQuery has been deprecated with message: since version 4.0

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
68
        $sqlQuery->select = array("cities.CityID", $radiusSelectionSQL." as distance");
69
        $sqlQuery->from[] = "{$bt}cities{$bt}";
70
        $sqlQuery->where[] = $radiusSelectionSQL . " < ".$maxRadius;
71
        $sqlQuery->orderby = " distance ";
72
        $sqlQuery->limit = "1";
73
        $result = $sqlQuery->execute();
74
        foreach ($result as $row) {
75
            $sameOne = false;
76
            if ($existingPage) {
77
                if ($row["CityID"] == $existingPage->HiddenDataID) {
78
                    $sameOne = true;
79
                }
80
            }
81
            if (!$sameOne) {
82
                $newPage = self::create_city_and_parents($row["CityID"]);
83
                $newDistance = $row["distance"];
84
            }
85
        }
86
        if (($newPage) && ($newDistance < $existingDistance) &&  ($newDistance < $maxRadius)) {
87
            $cityPage = $newPage;
88
        } elseif ($existingPage && $existingDistance < $maxRadius) {
89
            $cityPage = $existingPage;
90
        }
91
        if ($cityPage) {
92
            if ($cityPage->allowBrowseChildren()) {
0 ignored issues
show
The method allowBrowseChildren does only exist in BrowseCitiesPage, but not in DataObject.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
93
                $suburbPage = BrowseSuburbPage::create_suburb($googleMapAddressArray, $cityPage);
94
            }
95
        }
96
        if ($suburbPage) {
97
            return $suburbPage;
98
        }
99
        return $cityPage;
100
    }
101
102
    /**
103
     * formulae for working out distance
104
     **/
105
    protected static function radiusDefinitionOtherTable($lon, $lat, $table, $latitudeField, $longitudeField)
106
    {
107
        $bt = defined('DB::USE_ANSI_SQL') ? "\"" : "`";
108
        return "(6378.137 * ACOS( ( SIN( PI( ) * ".$lat." /180 ) * SIN( PI( ) * {$bt}".$table."{$bt}.{$bt}".$latitudeField."{$bt} /180 ) ) + ( COS( PI( ) * ".$lat." /180 ) * cos( PI( ) * {$bt}".$table."{$bt}.{$bt}".$latitudeField."{$bt} /180 ) * COS( (PI( ) * {$bt}".$table."{$bt}.{$bt}".$longitudeField."{$bt} /180 ) - ( PI( ) *".$lon." /180 ) ) ) ) ) ";
109
    }
110
111
    /**
112
     * name for page level.
113
     **/
114
    public function GeoLevelName()
115
    {
116
        return "Cities";
117
    }
118
    
119
    /**
120
     * number for page level.
121
     **/
122
    public function GeoLevelNumber()
123
    {
124
        return 3;
125
    }
126
    
127
    /**
128
     * This static method creates a city page and all the required parent pages...
129
     *@param Int - $CityID: the ID for the city to create
130
     **/
131
    public static function create_city_and_parents($CityID)
132
    {
133
        $cityPage = null;
134
        //check if the city exists at all
135
        $sql = '
136
			SELECT cities.RegionID, regions.CountryID, countries.ContinentID From cities, regions, countries, continents
137
			WHERE
138
				cities.RegionID = regions.RegionID AND
139
				regions.CountryID = countries.CountryID AND
140
				countries.ContinentID = continents.ContinentID AND
141
				cities.CityID = '.$CityID.'
142
			LIMIT 1;';
143
        $result = DB::query($sql);
144
145
        foreach ($result as $row) {
146
            break;
147
        }
148
        $abstractHelpPage = new BrowseAbstractPage();
149
        if ($row) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $row of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
150
            //1 check if world exists
151
            if ($worldPage = DataObject::get_one("BrowseWorldPage")) {
0 ignored issues
show
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
152
                //do nothing
153
            } else {
154
                $worldPage = new BrowseWorldPage();
155
                $name = "Find";
156
                $worldPage->Title = $name;
157
                $worldPage->MetaTitle = $name;
158
                $worldPage->MenuTitle = $name;
159
                $worldPage->writeToStage('Stage');
160
                $worldPage->publish('Stage', 'Live');
161
                $worldPage->flushCache();
162
            }
163
164
            //2 check if continent exists
165
            $ContinentID = $row["ContinentID"];
0 ignored issues
show
The variable $row seems to be defined by a foreach iteration on line 145. Are you sure the iterator is never empty, otherwise this variable is not defined?

It seems like you are relying on a variable being defined by an iteration:

foreach ($a as $b) {
}

// $b is defined here only if $a has elements, for example if $a is array()
// then $b would not be defined here. To avoid that, we recommend to set a
// default value for $b.


// Better
$b = 0; // or whatever default makes sense in your context
foreach ($a as $b) {
}

// $b is now guaranteed to be defined here.
Loading history...
166 View Code Duplication
            if ($continentPage = DataObject::get_one("BrowseContinentsPage", 'HiddenDataID = '.$ContinentID)) {
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...
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
167
                //debug::show("continent exists");
0 ignored issues
show
Unused Code Comprehensibility introduced by
72% 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.

Loading history...
168
            } else {
169
                //create continent
170
                $continents = $abstractHelpPage->getDataFromTable("continents", "ContinentID = ".$ContinentID, null);
171
                foreach ($continents as $continentData) {
172
                    $continentPage = new BrowseContinentsPage();
173
                    $continentPage->CreateContinent($continentData, $worldPage);
174
                }
175
            }
176
177
            //3 check if country exists
178
            $CountryID = $row["CountryID"];
179 View Code Duplication
            if ($countryPage = DataObject::get_one("BrowseCountriesPage", 'HiddenDataID = '.$CountryID)) {
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...
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
180
                //debug::show("country exists");
0 ignored issues
show
Unused Code Comprehensibility introduced by
72% 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.

Loading history...
181
            } else {
182
                //create Country
183
                $countries = $abstractHelpPage->getDataFromTable("countries", "CountryID = ".$CountryID, null);
184
                foreach ($countries as $countryData) {
185
                    $countryPage = new BrowseCountriesPage();
186
                    $countryPage->CreateCountry($countryData, $continentPage);
187
                }
188
            }
189
190
            //4 check if region exists
191
            $RegionID = $row["RegionID"];
192 View Code Duplication
            if ($regionPage = DataObject::get_one("BrowseRegionsPage", 'HiddenDataID = '.$RegionID)) {
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...
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
193
                //debug::show("region exists");
0 ignored issues
show
Unused Code Comprehensibility introduced by
72% 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.

Loading history...
194
            } else {
195
                //create region
196
                $regions = $abstractHelpPage->getDataFromTable("regions", "RegionID = ".$RegionID, null);
197
                foreach ($regions as $regionData) {
198
                    $regionPage = new BrowseRegionsPage();
199
                    $regionPage->CreateRegion($regionData, $countryPage);
200
                }
201
            }
202 View Code Duplication
            if ($cityPage = DataObject::get_one("BrowseCitiesPage", 'HiddenDataID = '.$CityID)) {
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...
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
203
                //debug::show("city exists");
0 ignored issues
show
Unused Code Comprehensibility introduced by
72% 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.

Loading history...
204
            } else {
205
                //create region
206
                $cities = $abstractHelpPage->getDataFromTable("cities", "CityID = ".$CityID, null);
207
                foreach ($cities as $city) {
208
                    $cityPage = new BrowseCitiesPage();
209
                    $cityPage->CreateCity($city, $regionPage);
210
                }
211
            }
212
        }
213
        return $cityPage;
214
    }
215
216
    /**
217
     * fix URLS
218
     * NOTE: you must set get variables: urls, from and to....
219
     **/
220
    public function requireDefaultRecords()
0 ignored issues
show
requireDefaultRecords uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
221
    {
222
        parent::requireDefaultRecords();
223
        if (isset($_GET["urls"]) && isset($_GET["from"]) && isset($_GET["to"])) {
224
            $dos = DataObject::get("SiteTree", null, null, null, $_GET["from"].','.$_GET["to"]);
225
            foreach ($dos as $page) {
226
                if (isset($page)) {
227
                    echo "<li>fixing ".$page->Title."</li>";
228
                    $page->URLSegment = $this->generateURLSegment($page->Title);
229
                    $page->writeToStage('Stage');
230
                    $page->publish('Stage', 'Live');
231
                    $page->flushCache();
232
                    $page->detroy();
233
                }
234
            }
235
        }
236
    }
237
238
    /**
239
     * Create a page
240
     * @param Array - $city: the data for the city
241
     * @param Object $parent: BrowseRegionsPage
0 ignored issues
show
There is no parameter named $parent:. Did you maybe mean $parent?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
242
     **/
243
    public function CreateCity(array $city, BrowseRegionsPage $parent)
0 ignored issues
show
CreateCity uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
244
    {
245
        if ($parent && isset($city["City"])) {
246
            $name = htmlentities($city["City"]);
247
            if (isset($name)) {
248
                if (isset($_GET["geobuild"])) {
249
                    echo "<li>creating ".$name."</li>";
250
                }
251
                $this->ParentID = $parent->ID;
252
                $this->Title = $name;
253
                $this->MetaTitle = $name;
254
                $this->MenuTitle = $name;
255
                $this->HiddenDataID = $city["CityID"];
256
257
                $this->Code = $city["Code"];
258
                $this->Latitude = $city["Latitude"];
259
                $this->Longitude = $city["Longitude"];
260
                $this->TimeZone = $city["TimeZone"];
261
                $this->County = htmlentities($city["County"]);
262
                $this->Code = $city["Code"];
263
264
                $this->CreateChildren = $parent->CreateAllChildren;
265
                $this->CreateAllChildren = $parent->CreateAllChildren;
266
267
                $this->URLSegment = $this->generateURLSegment($this->Title);
268
269
                $this->writeToStage('Stage');
270
                $this->publish('Stage', 'Live');
271
                $this->flushCache();
272
            } else {
273
                if (isset($_GET["geobuild"])) {
274
                    debug::show("No name can be found");
275
                }
276
            }
277
        } else {
278
            if (isset($_GET["geobuild"])) {
279
                debug::show("Parent does not exist");
280
            }
281
        }
282
    }
283
}
284
285
class BrowseCitiesPage_Controller extends BrowseAbstractPage_Controller
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
286
{
287
}
288