[TOOLS] Fix all level 0 errors found by PHPStan and move constant definition to bootstrap file

This commit is contained in:
2021-09-06 19:49:03 +01:00
parent 0eb0236feb
commit eb833b62e2
33 changed files with 312 additions and 285 deletions

View File

@@ -23,7 +23,6 @@ namespace App\Core;
use App\Core\DB\DB;
use App\Util\Exception\NotFoundException;
use App\Util\Exception\ServerException;
use App\Util\Formatting;
use DateTime;
@@ -53,7 +52,7 @@ abstract class Entity
*/
public static function create(array $args, $obj = null)
{
$class = get_called_class();
$class = static::class;
$obj = $obj ?: new $class();
$date = new DateTime();
foreach (['created', 'modified'] as $prop) {