mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
PHPStorm can order methods by alphabet, who knew.
This commit is contained in:
@@ -28,43 +28,6 @@ namespace FireflyIII\Support\Request;
|
||||
*/
|
||||
trait AppendsLocationData
|
||||
{
|
||||
/**
|
||||
* Abstract method.
|
||||
*
|
||||
* @param mixed $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract public function has($key);
|
||||
|
||||
/**
|
||||
* Abstract method.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function method();
|
||||
|
||||
/**
|
||||
* Abstract method.
|
||||
*
|
||||
* @param mixed ...$patterns
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function routeIs(...$patterns);
|
||||
|
||||
/**
|
||||
* Abstract method stolen from "InteractsWithInput".
|
||||
*
|
||||
* @param null $key
|
||||
* @param bool $default
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
|
||||
*/
|
||||
abstract public function boolean($key = null, $default = false);
|
||||
|
||||
public function addFromromTransactionStore(array $information, array $return): array
|
||||
{
|
||||
$return['store_location'] = false;
|
||||
@@ -82,6 +45,29 @@ trait AppendsLocationData
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function validLongitude(string $longitude): bool
|
||||
{
|
||||
$number = (float)$longitude;
|
||||
|
||||
return $number >= -180 && $number <= 180;
|
||||
}
|
||||
|
||||
private function validLatitude(string $latitude): bool
|
||||
{
|
||||
$number = (float)$latitude;
|
||||
|
||||
return $number >= -90 && $number <= 90;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract method.
|
||||
*
|
||||
* @param mixed $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract public function has($key);
|
||||
|
||||
/**
|
||||
* Read the submitted Request data and add new or updated Location data to the array.
|
||||
*/
|
||||
@@ -136,20 +122,6 @@ trait AppendsLocationData
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function validLongitude(string $longitude): bool
|
||||
{
|
||||
$number = (float) $longitude;
|
||||
|
||||
return $number >= -180 && $number <= 180;
|
||||
}
|
||||
|
||||
private function validLatitude(string $latitude): bool
|
||||
{
|
||||
$number = (float) $latitude;
|
||||
|
||||
return $number >= -90 && $number <= 90;
|
||||
}
|
||||
|
||||
private function getLocationKey(?string $prefix, string $key): string
|
||||
{
|
||||
if (null === $prefix) {
|
||||
@@ -197,6 +169,34 @@ trait AppendsLocationData
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract method.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function method();
|
||||
|
||||
/**
|
||||
* Abstract method.
|
||||
*
|
||||
* @param mixed ...$patterns
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function routeIs(...$patterns);
|
||||
|
||||
/**
|
||||
* Abstract method stolen from "InteractsWithInput".
|
||||
*
|
||||
* @param null $key
|
||||
* @param bool $default
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
|
||||
*/
|
||||
abstract public function boolean($key = null, $default = false);
|
||||
|
||||
private function isValidPUT(?string $prefix): bool
|
||||
{
|
||||
$longitudeKey = $this->getLocationKey($prefix, 'longitude');
|
||||
|
@@ -189,16 +189,6 @@ trait ConvertsDataTypes
|
||||
return (string)$this->clearStringKeepNewlines((string)($this->get($field) ?? ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract method that always exists in the Request classes that use this
|
||||
* trait, OR a stub needs to be added by any other class that uses this train.
|
||||
*
|
||||
* @param mixed $key
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function has($key);
|
||||
|
||||
/**
|
||||
* @param mixed $array
|
||||
*/
|
||||
@@ -340,6 +330,16 @@ trait ConvertsDataTypes
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract method that always exists in the Request classes that use this
|
||||
* trait, OR a stub needs to be added by any other class that uses this train.
|
||||
*
|
||||
* @param mixed $key
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function has($key);
|
||||
|
||||
/**
|
||||
* Return date or NULL.
|
||||
*/
|
||||
|
@@ -37,12 +37,12 @@ trait GetRecurrenceData
|
||||
|
||||
foreach ($stringKeys as $key) {
|
||||
if (array_key_exists($key, $transaction)) {
|
||||
$return[$key] = (string) $transaction[$key];
|
||||
$return[$key] = (string)$transaction[$key];
|
||||
}
|
||||
}
|
||||
foreach ($intKeys as $key) {
|
||||
if (array_key_exists($key, $transaction)) {
|
||||
$return[$key] = (int) $transaction[$key];
|
||||
$return[$key] = (int)$transaction[$key];
|
||||
}
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
|
Reference in New Issue
Block a user