old array syntax cleanup and legacy json serializable removal

pull/524/head
n0nag0n 1 year ago
parent 2d4c7d4bcd
commit 83d33348e0

@ -173,8 +173,8 @@ class Engine
$this->before('start', function () use ($self) {
// Enable error handling
if ($self->get('flight.handle_errors')) {
set_error_handler(array($self, 'handleError'));
set_exception_handler(array($self, 'handleException'));
set_error_handler([$self, 'handleError']);
set_exception_handler([$self, 'handleException']);
}
// Set case-sensitivity

@ -98,7 +98,7 @@ class Flight
* @param ?Closure(T $instance): void $callback Perform actions with the instance
* @return void
*/
static function register($name, $class, $params = array(), $callback = null)
static function register($name, $class, $params = [], $callback = null)
{
static::__callStatic('register', func_get_args());
}

@ -146,7 +146,7 @@ final class Request
*
* @param array<string, mixed> $config Request configuration
*/
public function __construct($config = array())
public function __construct($config = [])
{
// Default properties
if (empty($config)) {
@ -312,7 +312,7 @@ final class Request
*/
public static function parseQuery(string $url): array
{
$params = array();
$params = [];
$args = parse_url($url);
if (isset($args['query'])) {

@ -15,10 +15,6 @@ use Countable;
use Iterator;
use JsonSerializable;
if (!interface_exists('JsonSerializable')) {
require_once __DIR__ . '/LegacyJsonSerializable.php'; // @codeCoverageIgnore
}
/**
* The Collection class allows you to access a set of data
* using both array and object notation.

@ -1,17 +0,0 @@
<?php
declare(strict_types=1);
/**
* Flight: An extensible micro-framework.
*
* @copyright Copyright (c) 2011, Mike Cao <mike@mikecao.com>
* @license MIT, http://flightphp.com/license
*/
interface LegacyJsonSerializable
{
/**
* Gets the collection data which can be serialized to JSON.
* @return mixed Collection data which can be serialized by <b>json_encode</b>
*/
public function jsonSerialize();
}
Loading…
Cancel
Save