Add some PHP 8.3-only features.

This commit is contained in:
James Cole
2023-12-02 12:56:48 +01:00
parent 2b0a3ec818
commit b02a61dfbd
54 changed files with 350 additions and 348 deletions

View File

@@ -34,7 +34,7 @@ use SplObjectStorage;
*/
class Calculator
{
public const DEFAULT_INTERVAL = 1;
public const int DEFAULT_INTERVAL = 1;
private static ?SplObjectStorage $intervalMap = null;
private static array $intervals = [];

View File

@@ -30,5 +30,5 @@ namespace FireflyIII\Support\Calendar\Periodicity;
*/
final class Bimonthly extends Monthly
{
public const INTERVAL = 2;
public const int INTERVAL = 2;
}

View File

@@ -30,5 +30,5 @@ namespace FireflyIII\Support\Calendar\Periodicity;
*/
final class Fortnightly extends Weekly
{
public const INTERVAL = 2;
public const int INTERVAL = 2;
}

View File

@@ -30,5 +30,5 @@ namespace FireflyIII\Support\Calendar\Periodicity;
*/
final class HalfYearly extends Monthly
{
public const INTERVAL = 6;
public const int INTERVAL = 6;
}

View File

@@ -30,7 +30,7 @@ namespace FireflyIII\Support\Calendar\Periodicity;
*/
abstract class Interval implements Interspacable
{
public const INTERVAL = 1;
public const int INTERVAL = 1;
/**
* @param int $skip

View File

@@ -30,5 +30,5 @@ namespace FireflyIII\Support\Calendar\Periodicity;
*/
final class Quarterly extends Monthly
{
public const INTERVAL = 3;
public const int INTERVAL = 3;
}

View File

@@ -66,8 +66,8 @@ class ExportDataGenerator
{
use ConvertsDataTypes;
private const ADD_RECORD_ERR = 'Could not add record to set: %s';
private const EXPORT_ERR = 'Could not export to string: %s';
private const string ADD_RECORD_ERR = 'Could not add record to set: %s';
private const string EXPORT_ERR = 'Could not export to string: %s';
private Collection $accounts;
private Carbon $end;
private bool $exportAccounts;

View File

@@ -35,15 +35,15 @@ use Illuminate\Support\Collection;
class AccountSearch implements GenericSearchInterface
{
/** @var string */
public const SEARCH_ALL = 'all';
public const string SEARCH_ALL = 'all';
/** @var string */
public const SEARCH_IBAN = 'iban';
public const string SEARCH_IBAN = 'iban';
/** @var string */
public const SEARCH_ID = 'id';
public const string SEARCH_ID = 'id';
/** @var string */
public const SEARCH_NAME = 'name';
public const string SEARCH_NAME = 'name';
/** @var string */
public const SEARCH_NUMBER = 'number';
public const string SEARCH_NUMBER = 'number';
private string $field;
private string $query;
private array $types;

View File

@@ -37,8 +37,8 @@ use Psr\Container\NotFoundExceptionInterface;
*/
class OAuthKeys
{
private const PRIVATE_KEY = 'oauth_private_key';
private const PUBLIC_KEY = 'oauth_public_key';
private const string PRIVATE_KEY = 'oauth_private_key';
private const string PUBLIC_KEY = 'oauth_public_key';
/**
*