Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
- Uses `Dotenv::createArrayBacked()` for isolated, deterministic env loading
- New `environment()` helper function and shorthand check methods: `isProduction()`, `isTesting()`, `isStaging()`, `isDevelopment()`, `isLocal()`
- `env()` helper now delegates through `environment()->getValue()`
- **BREAKING:** Renamed `Quantum\\Service\\QtService` to `Quantum\\Service\\Service` (#500)
- **BREAKING:** Renamed `Quantum\\Middleware\\QtMiddleware` to `Quantum\\Middleware\\Middleware` (#500)
- **BREAKING:** Renamed `Quantum\\Migration\\QtMigration` to `Quantum\\Migration\\Migration` (#500)
- **BREAKING:** Renamed `Quantum\\Console\\QtCommand` to `Quantum\\Console\\CliCommand` (#500)

- **BREAKING:** Minimum PHP version requirement raised from 7.3 to 7.4
- Modernized codebase with PHP 7.4+ syntax using Rector:
Expand Down
4 changes: 2 additions & 2 deletions src/Auth/Factories/AuthFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use Quantum\Auth\Adapters\JwtAuthAdapter;
use Quantum\Di\Exceptions\DiException;
use Quantum\Auth\Enums\AuthType;
use Quantum\Service\QtService;
use Quantum\Service\Service;
use Quantum\Hasher\Hasher;
use Quantum\Jwt\JwtToken;
use Quantum\Loader\Setup;
Expand Down Expand Up @@ -126,7 +126,7 @@ private function createAuthService(string $adapter): AuthServiceInterface
{
$authServiceClass = config()->get('auth.' . $adapter . '.service');

/** @var class-string<QtService> $authServiceClass */
/** @var class-string<Service> $authServiceClass */
$authService = ServiceFactory::create($authServiceClass);

if (!$authService instanceof AuthServiceInterface) {
Expand Down
6 changes: 3 additions & 3 deletions src/Console/QtCommand.php → src/Console/CliCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
use RuntimeException;

/**
* Class QtCommand
* Class CliCommand
* @package Quantum\Console
*/
abstract class QtCommand extends Command implements CommandInterface
abstract class CliCommand extends Command implements CommandInterface
{
/**
* Console command name
Expand Down Expand Up @@ -65,7 +65,7 @@ abstract class QtCommand extends Command implements CommandInterface
protected ?OutputInterface $output = null;

/**
* QtCommand constructor.
* CliCommand constructor.
*/
public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/CommandDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function discover(string $directory, string $namespace): array

$commandReflection = new ReflectionClass($commandClass);

if (!$commandReflection->isInstantiable() || !$commandReflection->isSubclassOf(QtCommand::class)) {
if (!$commandReflection->isInstantiable() || !$commandReflection->isSubclassOf(CliCommand::class)) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/CronRunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Quantum\Cron\Exceptions\CronException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Di\Exceptions\DiException;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use Quantum\Cron\CronManager;
use ReflectionException;
use Throwable;
Expand All @@ -29,7 +29,7 @@
* Class CronRunCommand
* @package Quantum\Console
*/
class CronRunCommand extends QtCommand
class CronRunCommand extends CliCommand
{
/**
* The console command name.
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/DebugBarCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
use Quantum\Storage\Factories\FileSystemFactory;
use Quantum\App\Exceptions\BaseException;
use Quantum\Storage\FileSystem;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use ReflectionException;

/**
* Class DebugBarAssetsCommand
* @package Quantum\Console
*/
class DebugBarCommand extends QtCommand
class DebugBarCommand extends CliCommand
{
/**
* File System
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/EnvCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
use Quantum\Config\Exceptions\ConfigException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Di\Exceptions\DiException;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use ReflectionException;
use Quantum\App\App;

/**
* Class EnvCommand
* @package Quantum\Console
*/
class EnvCommand extends QtCommand
class EnvCommand extends CliCommand
{
/**
* Command name
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/InstallToolkitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
use Quantum\Config\Exceptions\ConfigException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Di\Exceptions\DiException;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use ReflectionException;
use RuntimeException;

/**
* Class InstallToolkitCommand
* @package Quantum\Console
*/
class InstallToolkitCommand extends QtCommand
class InstallToolkitCommand extends CliCommand
{
/**
* Command name
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/KeyGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
namespace Quantum\Console\Commands;

use Quantum\Environment\Exceptions\EnvException;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use Exception;

/**
* Class KeyGenerateCommand
* @package Quantum\Console
*/
class KeyGenerateCommand extends QtCommand
class KeyGenerateCommand extends CliCommand
{
/**
* Command name
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/MigrationGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

use Quantum\Migration\Exceptions\MigrationException;
use Quantum\Migration\MigrationManager;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;

/**
* Class MigrationGenerateCommand
* @package Quantum\Console
*/
class MigrationGenerateCommand extends QtCommand
class MigrationGenerateCommand extends CliCommand
{
/**
* The console command name.
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/MigrationMigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
use Quantum\Database\Exceptions\DatabaseException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Migration\MigrationManager;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;

/**
* Class MigrationMigrateCommand
* @package Quantum\Console
*/
class MigrationMigrateCommand extends QtCommand
class MigrationMigrateCommand extends CliCommand
{
/**
* The console command name.
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/ModuleGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

use Symfony\Component\VarExporter\Exception\ExceptionInterface;
use Quantum\Module\ModuleManager;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use Exception;

/**
* Class ModuleGenerateCommand
* @package Quantum\Console\Commands
*/
class ModuleGenerateCommand extends QtCommand
class ModuleGenerateCommand extends CliCommand
{
/**
* Command name
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/OpenApiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use Quantum\Module\ModuleLoader;
use Quantum\Router\RouteBuilder;
use Quantum\Storage\FileSystem;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use ReflectionException;
use OpenApi\Generator;
use Quantum\Di\Di;
Expand All @@ -34,7 +34,7 @@
* Class OpenApiUiAssetsCommand
* @package Quantum\Console
*/
class OpenApiCommand extends QtCommand
class OpenApiCommand extends CliCommand
{
/**
* File System
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/ResourceCacheClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Quantum\App\Exceptions\BaseException;
use Quantum\Di\Exceptions\DiException;
use Quantum\Storage\FileSystem;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use Quantum\Loader\Setup;
use ReflectionException;
use Exception;
Expand All @@ -31,7 +31,7 @@
* Class ResourceCacheClearCommand
* @package Quantum\Console
*/
class ResourceCacheClearCommand extends QtCommand
class ResourceCacheClearCommand extends CliCommand
{
/**
* Command name
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/RouteListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Quantum\Router\RouteCollection;
use Quantum\Router\RouteBuilder;
use Quantum\Module\ModuleLoader;
use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use Quantum\Router\Route;
use ReflectionException;
use Quantum\Di\Di;
Expand All @@ -32,7 +32,7 @@
* Class RouteListCommand
* @package Quantum\Console
*/
class RouteListCommand extends QtCommand
class RouteListCommand extends CliCommand
{
/**
* The console command name.
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

namespace Quantum\Console\Commands;

use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use RuntimeException;
use Throwable;

/**
* Class ServeCommand
* @package Quantum\Console
*/
class ServeCommand extends QtCommand
class ServeCommand extends CliCommand
{
/**
* Platform Windows
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

namespace Quantum\Console\Commands;

use Quantum\Console\QtCommand;
use Quantum\Console\CliCommand;
use Povils\Figlet\Figlet;

/**
* Class VersionCommand
* @package Quantum\Console
*/
class VersionCommand extends QtCommand
class VersionCommand extends CliCommand
{
/**
* Command name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
use Closure;

/**
* Class QtMiddleware
* Class Middleware
* @package Quantum\Middleware
*/
abstract class QtMiddleware
abstract class Middleware
{
/**
* Applies the middleware
Expand Down
8 changes: 4 additions & 4 deletions src/Middleware/MiddlewareManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public function applyMiddlewares(Request $request, Closure $terminal): Response

/**
* Loads and gets the current middleware instance
* @throws MiddlewareException|BaseException|ReflectionException
* @throws MiddlewareException|BaseException
*/
private function getMiddleware(Request $request): QtMiddleware
private function getMiddleware(Request $request): Middleware
{
$middlewareClass = request()->getModuleBaseNamespace() . '\\' . $this->module . '\\Middlewares\\' . current($this->middlewares);

Expand All @@ -79,8 +79,8 @@ private function getMiddleware(Request $request): QtMiddleware

$middleware = new $middlewareClass($request);

if (!$middleware instanceof QtMiddleware) {
throw MiddlewareException::notInstanceOf($middlewareClass, QtMiddleware::class);
if (!$middleware instanceof Middleware) {
throw MiddlewareException::notInstanceOf($middlewareClass, Middleware::class);
}

return $middleware;
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Enums/ExceptionMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ final class ExceptionMessages extends BaseExceptionMessages

public const NOTHING_TO_MIGRATE = 'Nothing to migrate';

public const INVALID_MIGRATION_CLASS = 'Migration class `{%1}` must extend QtMigration';
public const INVALID_MIGRATION_CLASS = 'Migration class `{%1}` must extend Migration';
}
4 changes: 2 additions & 2 deletions src/Migration/QtMigration.php → src/Migration/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
use Quantum\Database\Factories\TableFactory;

/**
* Class QtMigration
* Class Migration
* @package Quantum\Migration
*/
abstract class QtMigration
abstract class Migration
{
/**
* Upgrades with the specified migration class
Expand Down
4 changes: 2 additions & 2 deletions src/Migration/MigrationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private function upgrade(): int

$migration = new $migrationClassName();

if (!$migration instanceof QtMigration) {
if (!$migration instanceof Migration) {
throw MigrationException::invalidMigrationClass($migrationClassName);
}

Expand Down Expand Up @@ -195,7 +195,7 @@ private function downgrade(?int $step): int

$migration = new $migrationClassName();

if (!$migration instanceof QtMigration) {
if (!$migration instanceof Migration) {
throw MigrationException::invalidMigrationClass($migrationClassName);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Migration/MigrationTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Class MigrationTable
* @package Quantum\Migration
*/
class MigrationTable extends QtMigration
class MigrationTable extends Migration
{
/**
* Migrations table name
Expand Down
Loading
Loading