mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix(analyze): drop redundant null-check on injected GeoRecord
PHPStan flagged Executions/Create.php:242 `if ($geoRecord)` as always true. GeoRecord is DI-injected and non-nullable; the inner guard is dead weight. Outer `if (!empty($ip))` is the real condition.
This commit is contained in:
@@ -239,13 +239,11 @@ class Create extends Base
|
||||
$headers['x-appwrite-client-ip'] = $ip;
|
||||
|
||||
if (!empty($ip)) {
|
||||
if ($geoRecord) {
|
||||
$eu = Config::getParam('locale-eu');
|
||||
$eu = Config::getParam('locale-eu');
|
||||
|
||||
$headers['x-appwrite-country-code'] = $geoRecord->getCountryCode();
|
||||
$headers['x-appwrite-continent-code'] = $geoRecord->getContinentCode();
|
||||
$headers['x-appwrite-continent-eu'] = (\in_array(($geoRecord->getCountryCode()), $eu)) ? 'true' : 'false';
|
||||
}
|
||||
$headers['x-appwrite-country-code'] = $geoRecord->getCountryCode();
|
||||
$headers['x-appwrite-continent-code'] = $geoRecord->getContinentCode();
|
||||
$headers['x-appwrite-continent-eu'] = (\in_array(($geoRecord->getCountryCode()), $eu)) ? 'true' : 'false';
|
||||
}
|
||||
|
||||
$headersFiltered = [];
|
||||
|
||||
Reference in New Issue
Block a user