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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 20 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,23 @@
*.md text eol=lf
*.sh text eol=lf
*.js text eol=lf
*.css text eol=lf
*.css text eol=lf

# Export ignore - exclude development and test files
tests/ export-ignore
.git/ export-ignore
.github/ export-ignore
.idea/ export-ignore
nbproject/ export-ignore
vendor/ export-ignore
.php-cs-fixer.cache export-ignore
.php-cs-fixer.php export-ignore
.phpunit.result.cache export-ignore
coverage.xml export-ignore
test-teamcity.log export-ignore
phpstan.neon.dist export-ignore
phpunit.xml export-ignore
rector.php export-ignore
.scrutinizer.yml export-ignore
composer.lock export-ignore
_config.yml export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress
run: composer update --prefer-dist --no-progress --no-interaction

- name: Run PHP-CS-Fixer
run: composer cs:check
Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ext-openssl": "*",
"ext-bcmath": "*",
"j4mie/paris": "^1.5",
"firebase/php-jwt": "^6.0",
"firebase/php-jwt": "^6.0 || ^7.0",
"gumlet/php-image-resize": "^2.0",
"symfony/var-dumper": "^5.4",
"symfony/var-exporter": "^5.2",
Expand Down Expand Up @@ -84,5 +84,12 @@
"test": "vendor/bin/phpunit --stderr --testdox --coverage-clover coverage.xml"
},
"minimum-stability": "stable",
"prefer-stable": true
"prefer-stable": true,
"config": {
"audit": {
"ignore": [
"CVE-2025-45769"
]
}
}
}
3 changes: 1 addition & 2 deletions src/App/Adapters/AppAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class AppAdapter implements AppInterface
/**
* @var string
*/
private static $baseDir;
private static string $baseDir;

/**
* @throws BaseException
Expand All @@ -42,7 +42,6 @@ public function __construct()
{
$this->loadCoreDependencies();
$this->loadComponentHelperFunctions();
$this->loadLibraryHelperFunctions();
$this->loadAppHelperFunctions();
$this->loadModuleHelperFunctions();
}
Expand Down
10 changes: 5 additions & 5 deletions src/App/Adapters/ConsoleAppAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

namespace Quantum\App\Adapters;

use Quantum\Libraries\Lang\Exceptions\LangException;
use Symfony\Component\Console\Output\ConsoleOutput;
use Quantum\App\Exceptions\StopExecutionException;
use Quantum\Environment\Exceptions\EnvException;
use Symfony\Component\Console\Input\ArgvInput;
use Quantum\Config\Exceptions\ConfigException;
use Symfony\Component\Console\Application;
use Quantum\Lang\Exceptions\LangException;
use Quantum\App\Exceptions\BaseException;
use Quantum\App\Traits\ConsoleAppTrait;
use Quantum\Di\Exceptions\DiException;
Expand All @@ -41,17 +41,17 @@ class ConsoleAppAdapter extends AppAdapter
/**
* @var ArgvInput
*/
protected $input;
protected ArgvInput $input;

/**
* @var ConsoleOutput
*/
protected $output;
protected ConsoleOutput $output;

/**
* @var Application
* @var Application|null
*/
protected $application;
protected ?Application $application = null;

public function __construct()
{
Expand Down
8 changes: 4 additions & 4 deletions src/App/Adapters/WebAppAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

namespace Quantum\App\Adapters;

use Quantum\Libraries\Database\Exceptions\DatabaseException;
use Quantum\Libraries\Session\Exceptions\SessionException;
use Quantum\Middleware\Exceptions\MiddlewareException;
use Quantum\Libraries\Csrf\Exceptions\CsrfException;
use Quantum\Libraries\Lang\Exceptions\LangException;
use Quantum\Database\Exceptions\DatabaseException;
use Quantum\App\Exceptions\StopExecutionException;
use Quantum\Session\Exceptions\SessionException;
use Quantum\Environment\Exceptions\EnvException;
use Quantum\Module\Exceptions\ModuleException;
use Quantum\Config\Exceptions\ConfigException;
use Quantum\Router\Exceptions\RouteException;
use Quantum\Http\Exceptions\HttpException;
use Quantum\Csrf\Exceptions\CsrfException;
use Quantum\Lang\Exceptions\LangException;
use Quantum\Middleware\MiddlewareManager;
use Quantum\App\Exceptions\BaseException;
use Quantum\Di\Exceptions\DiException;
Expand Down
42 changes: 12 additions & 30 deletions src/App/Traits/AppTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

namespace Quantum\App\Traits;

use Quantum\Libraries\Logger\Factories\LoggerFactory;
use Quantum\Libraries\Lang\Exceptions\LangException;
use Quantum\Libraries\Lang\Factories\LangFactory;
use Quantum\Config\Exceptions\ConfigException;
use Quantum\Logger\Factories\LoggerFactory;
use Quantum\Lang\Exceptions\LangException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Lang\Factories\LangFactory;
use Quantum\Di\Exceptions\DiException;
use Quantum\Tracer\ErrorHandler;
use Quantum\Loader\Loader;
Expand Down Expand Up @@ -52,6 +52,9 @@ public static function getBaseDir(): string
return self::$baseDir;
}

/**
* @throws DiException
*/
protected function loadCoreDependencies()
{
$file = dirname(__DIR__) . DS . 'Config' . DS . 'dependencies.php';
Expand All @@ -70,37 +73,16 @@ protected function loadComponentHelperFunctions(): void
{
$loader = Di::get(Loader::class);

$components = [
'Environment',
'Config',
'Router',
'Service',
'Model',
'Hook',
'Http',
'View',
'App',
];

foreach ($components as $component) {
$componentHelperPath = dirname(__DIR__, 2) . DS . $component . DS . 'Helpers';
if (is_dir($componentHelperPath)) {
$loader->loadDir($componentHelperPath);
$srcDir = dirname(__DIR__, 2);

foreach (glob($srcDir . DS . '*', GLOB_ONLYDIR) as $componentDir) {
$helperPath = $componentDir . DS . 'Helpers';
if (is_dir($helperPath)) {
$loader->loadDir($helperPath);
}
}
}

/**
* Loads library helper functions
* @throws DiException
* @throws ReflectionException
*/
protected function loadLibraryHelperFunctions()
{
$loader = Di::get(Loader::class);
$loader->loadDir(dirname(__DIR__, 2) . DS . 'Libraries' . DS . '*' . DS . 'Helpers');
}

/**
* Loads app helper functions
* @throws DiException
Expand Down
2 changes: 1 addition & 1 deletion src/App/Traits/WebAppTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
namespace Quantum\App\Traits;

use Quantum\Environment\Exceptions\EnvException;
use Quantum\Libraries\ResourceCache\ViewCache;
use Quantum\Config\Exceptions\ConfigException;
use Quantum\Http\Exceptions\HttpException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Di\Exceptions\DiException;
use Quantum\ResourceCache\ViewCache;
use Quantum\Environment\Environment;
use DebugBar\DebugBarException;
use Quantum\Environment\Server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
* @since 3.0.0
*/

namespace Quantum\Libraries\Archive\Adapters;
namespace Quantum\Archive\Adapters;

use Quantum\Libraries\Archive\Exceptions\ArchiveException;
use Quantum\Libraries\Storage\Factories\FileSystemFactory;
use Quantum\Libraries\Archive\Contracts\ArchiveInterface;
use Quantum\Archive\Exceptions\ArchiveException;
use Quantum\Storage\Factories\FileSystemFactory;
use Quantum\Archive\Contracts\ArchiveInterface;
use Quantum\App\Exceptions\BaseException;
use Quantum\Libraries\Storage\FileSystem;
use Quantum\Storage\FileSystem;
use Exception;
use Phar;

/**
* Class PharAdapter
* @package Quantum\Libraries\Archive
* @package Quantum\Archive
*/
class PharAdapter implements ArchiveInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
* @since 3.0.0
*/

namespace Quantum\Libraries\Archive\Adapters;
namespace Quantum\Archive\Adapters;

use Quantum\Libraries\Archive\Exceptions\ArchiveException;
use Quantum\Libraries\Storage\Factories\FileSystemFactory;
use Quantum\Libraries\Archive\Contracts\ArchiveInterface;
use Quantum\Libraries\Storage\FileSystem;
use Quantum\Archive\Exceptions\ArchiveException;
use Quantum\Storage\Factories\FileSystemFactory;
use Quantum\Archive\Contracts\ArchiveInterface;
use Quantum\Storage\FileSystem;
use Quantum\App\Exceptions\BaseException;
use ZipArchive;
use Exception;

/**
* Class ZipAdapter
* @package Quantum\Libraries\Archive\Adapters
* @package Quantum\Archive\Adapters
*/
class ZipAdapter implements ArchiveInterface
{
Expand Down
8 changes: 4 additions & 4 deletions src/Libraries/Archive/Archive.php → src/Archive/Archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
* @since 3.0.0
*/

namespace Quantum\Libraries\Archive;
namespace Quantum\Archive;

use Quantum\Libraries\Archive\Exceptions\ArchiveException;
use Quantum\Libraries\Archive\Contracts\ArchiveInterface;
use Quantum\Archive\Exceptions\ArchiveException;
use Quantum\Archive\Contracts\ArchiveInterface;
use Quantum\App\Exceptions\BaseException;

/**
* Class Archive
* @package Quantum\Libraries\Archive
* @package Quantum\Archive
* @method void setName(string $archiveName)
* @method bool offsetExists(string $filename)
* @method bool addEmptyDir(string $directory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
* @since 3.0.0
*/

namespace Quantum\Libraries\Archive\Contracts;
namespace Quantum\Archive\Contracts;

/**
* Interface ArchiveInterface
* @package Quantum\Libraries\Archive
* @package Quantum\Archive
*/
interface ArchiveInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
* @since 3.0.0
*/

namespace Quantum\Libraries\Archive\Enums;
namespace Quantum\Archive\Enums;

use Quantum\App\Enums\ExceptionMessages as BaseExceptionMessages;

/**
* Class ExceptionMessages
* @package Quantum\Libraries\Archive
* @package Quantum\Archive
*/
final class ExceptionMessages extends BaseExceptionMessages
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* @since 3.0.0
*/

namespace Quantum\Libraries\Archive\Exceptions;
namespace Quantum\Archive\Exceptions;

use Quantum\Libraries\Archive\Enums\ExceptionMessages;
use Quantum\Archive\Enums\ExceptionMessages;
use Quantum\App\Exceptions\BaseException;

/**
* Class CacheException
* @package Quantum\Libraries\Archive
* @package Quantum\Archive
*/
class ArchiveException extends BaseException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
* @since 3.0.0
*/

namespace Quantum\Libraries\Archive\Factories;
namespace Quantum\Archive\Factories;

use Quantum\Libraries\Archive\Exceptions\ArchiveException;
use Quantum\Libraries\Archive\Adapters\PharAdapter;
use Quantum\Libraries\Archive\Adapters\ZipAdapter;
use Quantum\Archive\Exceptions\ArchiveException;
use Quantum\Archive\Adapters\PharAdapter;
use Quantum\Archive\Adapters\ZipAdapter;
use Quantum\App\Exceptions\BaseException;
use Quantum\Libraries\Archive\Archive;
use Quantum\Archive\Archive;

/**
* Class Cryptor
* @package Quantum\Libraries\Encryption
* @package Quantum\Encryption
*/
class ArchiveFactory
{
Expand Down
4 changes: 2 additions & 2 deletions src/Libraries/Asset/Asset.php → src/Asset/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
*
*/

namespace Quantum\Libraries\Asset;
namespace Quantum\Asset;

/**
* Class Asset
* @package Quantum\Libraries\Asset
* @package Quantum\Asset
*/
class Asset
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
* @since 3.0.0
*/

namespace Quantum\Libraries\Asset;
namespace Quantum\Asset;

use Quantum\Libraries\Asset\Exceptions\AssetException;
use Quantum\Libraries\Lang\Exceptions\LangException;
use Quantum\Asset\Exceptions\AssetException;
use Quantum\Lang\Exceptions\LangException;

/**
* Class AssetFactory
* @package Quantum\Libraries\Asset
* @package Quantum\Asset
*/
class AssetManager
{
Expand Down
Loading